Skip to content

Commit 017811a

Browse files
meili-bors[bot]meili-botbidoubiwa
authored
Merge #437
437: Changes related to the next Meilisearch release (v0.28.0) r=bidoubiwa a=meili-bot This PR gathers the changes related to the next Meilisearch release (v0.28.0) so that this package is ready when the official release is out. ⚠️ This PR should NOT be merged until: - the next release of Meilisearch (v0.28.0) is out. - the [`meilisearch-js`](https://github.com/meilisearch/meilisearch-js) dependency has been released to be compatible with Meilisearch v0.28.0. Once the release is out, the upgrade of the `meilisearch-js` dependency might be committed to this branch. _This PR is auto-generated for the [pre-release week](https://github.com/meilisearch/integration-guides/blob/master/guides/pre-release-week.md) purpose._ _Related to this issue: https://github.com/meilisearch/integration-guides/issues/205_ Co-authored-by: meili-bot <[email protected]> Co-authored-by: cvermand <[email protected]> Co-authored-by: Charlotte Vermandel <[email protected]>
2 parents ec8d49e + 3b278c4 commit 017811a

File tree

6 files changed

+15
-10
lines changed

6 files changed

+15
-10
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -533,7 +533,7 @@ If you are using [Strapi v3](https://github.com/strapi/strapi/tree/v3.6.9), plea
533533

534534
**Supported Meilisearch versions**:
535535

536-
This package only guarantees the compatibility with the [version v0.27.0 of Meilisearch](https://github.com/meilisearch/meilisearch/releases/tag/v0.27.0).
536+
This package only guarantees the compatibility with the [version v0.28.0 of Meilisearch](https://github.com/meilisearch/meilisearch/releases/tag/v0.28.0).
537537

538538
**Node / NPM versions**:
539539

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
],
2727
"dependencies": {
2828
"@strapi/utils": "^4.2.2",
29-
"meilisearch": "^0.25.1"
29+
"meilisearch": "^0.27.0"
3030
},
3131
"peerDependencies": {},
3232
"author": {

server/__tests__/meilisearch.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ const deleteDocuments = jest.fn(() => {
1313
return [{ uid: 1 }, { uid: 2 }]
1414
})
1515
const getIndexes = jest.fn(() => {
16-
return [{ uid: 'my_restaurant' }, { uid: 'restaurant' }]
16+
return { results: [{ uid: 'my_restaurant' }, { uid: 'restaurant' }] }
1717
})
1818

1919
const getTasks = jest.fn(() => {
Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
'use strict'
22
const { MeiliSearch: Meilisearch } = require('meilisearch')
3+
const packageJson = require('../../../package.json')
34

45
/**
56
* Create a Meilisearch client instance.
@@ -8,4 +9,8 @@ const { MeiliSearch: Meilisearch } = require('meilisearch')
89
*
910
* @returns { object } - Meilisearch client instance.
1011
*/
11-
module.exports = config => new Meilisearch(config)
12+
module.exports = config =>
13+
new Meilisearch({
14+
...config,
15+
clientAgents: [`Meilisearch Strapi ${packageJson.version}`],
16+
})

server/services/meilisearch/connector.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ module.exports = ({ strapi, adapter, config }) => {
6363
try {
6464
const { apiKey, host } = await store.getCredentials()
6565
const client = Meilisearch({ apiKey, host })
66-
const indexes = await client.getIndexes()
66+
const { results: indexes } = await client.getIndexes()
6767
return indexes
6868
} catch (e) {
6969
strapi.log.error(`meilisearch: ${e.message}`)
@@ -280,7 +280,7 @@ module.exports = ({ strapi, adapter, config }) => {
280280
// Add documents in Meilisearch
281281
const task = await client.index(indexUid).addDocuments(documents)
282282

283-
return task.uid
283+
return task.taskUid
284284
}
285285

286286
const tasksUids = await contentTypeService.actionInBatches({

yarn.lock

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3140,10 +3140,10 @@ [email protected]:
31403140
dependencies:
31413141
tmpl "1.0.5"
31423142

3143-
meilisearch@^0.25.1:
3144-
version "0.25.1"
3145-
resolved "https://registry.yarnpkg.com/meilisearch/-/meilisearch-0.25.1.tgz#0dc25ffad64e6e50eb3da6c0691b0ff54f8578bf"
3146-
integrity sha512-20jO0pK9BhghxHSkOLbdoYn58h/Z0PNL3JQcRq7ipNIeqrxkAetCZZ6ttJC3uxcz0jVglmiFoSXu3Z/lEOLOLQ==
3143+
meilisearch@^0.27.0:
3144+
version "0.27.0"
3145+
resolved "https://registry.yarnpkg.com/meilisearch/-/meilisearch-0.27.0.tgz#8bd57ddb77b975f93e054cb977b951c488ece297"
3146+
integrity sha512-kZOZFIuSO7c6xRf+Y2/9/h6A9pl0sCl/G44X4KuaSwxGbruOZPhmxbeVEgLHBv4pUFvQ56rNVTA/2d/5GCU1YA==
31473147
dependencies:
31483148
cross-fetch "^3.1.5"
31493149

0 commit comments

Comments
 (0)