From 39094a45911b6dd11782a8ad04649796641d277e Mon Sep 17 00:00:00 2001 From: meili-bot <74670311+meili-bot@users.noreply.github.com> Date: Thu, 9 Jun 2022 22:59:25 +0200 Subject: [PATCH 1/6] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 331c8518..2f813d57 100644 --- a/README.md +++ b/README.md @@ -533,7 +533,7 @@ If you are using [Strapi v3](https://github.com/strapi/strapi/tree/v3.6.9), plea **Supported Meilisearch versions**: -This package only guarantees the compatibility with the [version v0.27.0 of Meilisearch](https://github.com/meilisearch/meilisearch/releases/tag/v0.27.0). +This package only guarantees the compatibility with the [version v0.28.0 of Meilisearch](https://github.com/meilisearch/meilisearch/releases/tag/v0.28.0). **Node / NPM versions**: From f269693039efa535cb1e161abfe829352c48498c Mon Sep 17 00:00:00 2001 From: cvermand <33010418+bidoubiwa@users.noreply.github.com> Date: Mon, 4 Jul 2022 18:32:54 +0200 Subject: [PATCH 2/6] Update meilisearch-js with beta version compatible with v0.28.0rc1 of Meilisearch (#453) --- package.json | 2 +- yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index 2f092903..f75ec67e 100644 --- a/package.json +++ b/package.json @@ -26,7 +26,7 @@ ], "dependencies": { "@strapi/utils": "^4.1.9", - "meilisearch": "^0.25.1" + "meilisearch": "^0.27.0-beta.1" }, "peerDependencies": {}, "author": { diff --git a/yarn.lock b/yarn.lock index eacdcbe2..c10cc1ad 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3140,10 +3140,10 @@ makeerror@1.0.12: dependencies: tmpl "1.0.5" -meilisearch@^0.25.1: - version "0.25.1" - resolved "https://registry.yarnpkg.com/meilisearch/-/meilisearch-0.25.1.tgz#0dc25ffad64e6e50eb3da6c0691b0ff54f8578bf" - integrity sha512-20jO0pK9BhghxHSkOLbdoYn58h/Z0PNL3JQcRq7ipNIeqrxkAetCZZ6ttJC3uxcz0jVglmiFoSXu3Z/lEOLOLQ== +meilisearch@^0.27.0-beta.1: + version "0.27.0-beta.1" + resolved "https://registry.yarnpkg.com/meilisearch/-/meilisearch-0.27.0-beta.1.tgz#62e64da55227f405e3f352a43e470947ac50f5ef" + integrity sha512-AnUnYKjpghPVC3zBXbF7QeikADfLyHl37aIcLS5xj+zqzku3ldQlOb9AbyBZ1gDhhWxrbltEgb0btmGyBv2jyQ== dependencies: cross-fetch "^3.1.5" From 585d73874bc3eb815fc4471a72e9206481107478 Mon Sep 17 00:00:00 2001 From: cvermand <33010418+bidoubiwa@users.noreply.github.com> Date: Mon, 4 Jul 2022 18:33:09 +0200 Subject: [PATCH 3/6] Update indexes and tasks API for next meilisearch release v0.28.0 (#454) * Update meilisearch-js with beta version compatible with v0.28.0rc1 of Meilisearch * Update indexes and tasks routes for v0.28.0 --- server/__tests__/meilisearch.test.js | 2 +- server/services/meilisearch/connector.js | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/server/__tests__/meilisearch.test.js b/server/__tests__/meilisearch.test.js index 40b93ef3..0b8547c3 100644 --- a/server/__tests__/meilisearch.test.js +++ b/server/__tests__/meilisearch.test.js @@ -13,7 +13,7 @@ const deleteDocuments = jest.fn(() => { return [{ uid: 1 }, { uid: 2 }] }) const getIndexes = jest.fn(() => { - return [{ uid: 'my_restaurant' }, { uid: 'restaurant' }] + return { results: [{ uid: 'my_restaurant' }, { uid: 'restaurant' }] } }) const getTasks = jest.fn(() => { diff --git a/server/services/meilisearch/connector.js b/server/services/meilisearch/connector.js index d0937559..9056b52f 100644 --- a/server/services/meilisearch/connector.js +++ b/server/services/meilisearch/connector.js @@ -63,7 +63,7 @@ module.exports = ({ strapi, adapter, config }) => { try { const { apiKey, host } = await store.getCredentials() const client = Meilisearch({ apiKey, host }) - const indexes = await client.getIndexes() + const { results: indexes } = await client.getIndexes() return indexes } catch (e) { strapi.log.error(`meilisearch: ${e.message}`) @@ -280,7 +280,7 @@ module.exports = ({ strapi, adapter, config }) => { // Add documents in Meilisearch const task = await client.index(indexUid).addDocuments(documents) - return task.uid + return task.taskUid } const tasksUids = await contentTypeService.actionInBatches({ From 6cf66e67c057115967537d0ad1325e36ea83e88e Mon Sep 17 00:00:00 2001 From: cvermand <33010418+bidoubiwa@users.noreply.github.com> Date: Mon, 4 Jul 2022 18:33:18 +0200 Subject: [PATCH 4/6] Add strapi agent to client agents (#455) * Update meilisearch-js with beta version compatible with v0.28.0rc1 of Meilisearch * Update indexes and tasks routes for v0.28.0 * Add strapi agent to client agents --- server/services/meilisearch/client.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/server/services/meilisearch/client.js b/server/services/meilisearch/client.js index bc38bdd0..2bd23adb 100644 --- a/server/services/meilisearch/client.js +++ b/server/services/meilisearch/client.js @@ -1,5 +1,6 @@ 'use strict' const { MeiliSearch: Meilisearch } = require('meilisearch') +const packageJson = require('../../../package.json') /** * Create a Meilisearch client instance. @@ -8,4 +9,10 @@ const { MeiliSearch: Meilisearch } = require('meilisearch') * * @returns { object } - Meilisearch client instance. */ -module.exports = config => new Meilisearch(config) +module.exports = config => + new Meilisearch({ + ...config, + clientAgents: [ + `Meilisearch strapi-plugin-meilisearch ${packageJson.version}`, + ], + }) From 7aaf192f067d2cb3d6c47567235cc0385f742311 Mon Sep 17 00:00:00 2001 From: cvermand <33010418+bidoubiwa@users.noreply.github.com> Date: Wed, 6 Jul 2022 11:50:48 +0200 Subject: [PATCH 5/6] Update client agent to correct format (#456) --- server/services/meilisearch/client.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/server/services/meilisearch/client.js b/server/services/meilisearch/client.js index 2bd23adb..7897f4ae 100644 --- a/server/services/meilisearch/client.js +++ b/server/services/meilisearch/client.js @@ -12,7 +12,5 @@ const packageJson = require('../../../package.json') module.exports = config => new Meilisearch({ ...config, - clientAgents: [ - `Meilisearch strapi-plugin-meilisearch ${packageJson.version}`, - ], + clientAgents: [`Meilisearch Strapi ${packageJson.version}`], }) From 3b278c4b5480be4d3a9bc182092c242f3593fd53 Mon Sep 17 00:00:00 2001 From: cvermand <33010418+bidoubiwa@users.noreply.github.com> Date: Tue, 12 Jul 2022 12:34:07 +0200 Subject: [PATCH 6/6] Update meilisearch-js to v0.27.0 (#459) --- package.json | 2 +- yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index af18ca0e..d60d7b3d 100644 --- a/package.json +++ b/package.json @@ -26,7 +26,7 @@ ], "dependencies": { "@strapi/utils": "^4.2.2", - "meilisearch": "^0.27.0-beta.1" + "meilisearch": "^0.27.0" }, "peerDependencies": {}, "author": { diff --git a/yarn.lock b/yarn.lock index a42c4b2f..3cbb2ae5 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3140,10 +3140,10 @@ makeerror@1.0.12: dependencies: tmpl "1.0.5" -meilisearch@^0.27.0-beta.1: - version "0.27.0-beta.1" - resolved "https://registry.yarnpkg.com/meilisearch/-/meilisearch-0.27.0-beta.1.tgz#62e64da55227f405e3f352a43e470947ac50f5ef" - integrity sha512-AnUnYKjpghPVC3zBXbF7QeikADfLyHl37aIcLS5xj+zqzku3ldQlOb9AbyBZ1gDhhWxrbltEgb0btmGyBv2jyQ== +meilisearch@^0.27.0: + version "0.27.0" + resolved "https://registry.yarnpkg.com/meilisearch/-/meilisearch-0.27.0.tgz#8bd57ddb77b975f93e054cb977b951c488ece297" + integrity sha512-kZOZFIuSO7c6xRf+Y2/9/h6A9pl0sCl/G44X4KuaSwxGbruOZPhmxbeVEgLHBv4pUFvQ56rNVTA/2d/5GCU1YA== dependencies: cross-fetch "^3.1.5"