Skip to content

Commit cb18e04

Browse files
meili-bors[bot]meili-botbidoubiwa
authored
Merge #1257
1257: Changes related to the next Meilisearch release (v0.28.0) r=bidoubiwa a=meili-bot Related to this issue: meilisearch/integration-guides#205 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. - should pass the tests against the [latest pre-release of Meilisearch](https://github.com/meilisearch/meilisearch/releases). - might eventually contain test failures until the Meilisearch v0.28.0 is out. ⚠️ This PR should NOT be merged until the next release of Meilisearch (v0.28.0) is out. _This PR is auto-generated for the [pre-release week](https://github.com/meilisearch/integration-guides/blob/master/guides/pre-release-week.md) purpose._ Co-authored-by: meili-bot <[email protected]> Co-authored-by: cvermand <[email protected]> Co-authored-by: Charlotte Vermandel <[email protected]>
2 parents 066c7a8 + d0d3f0e commit cb18e04

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+1717
-1419
lines changed

.code-samples.meilisearch.yaml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,7 @@ search_parameter_guide_highlight_tag_1: |-
273273
})
274274
search_parameter_guide_matches_1: |-
275275
client.index('movies').search('winter feast', {
276-
matches: true
276+
showMatchesPosition: true
277277
})
278278
settings_guide_synonyms_1: |-
279279
client.index('tops').updateSettings({
@@ -497,7 +497,7 @@ faceted_search_filter_1: |-
497497
faceted_search_facets_distribution_1: |-
498498
client.index('movies')
499499
.search('Batman', {
500-
facetsDistribution: ['genres']
500+
facets: ['genres']
501501
})
502502
faceted_search_walkthrough_filter_1: |-
503503
client.index('movies')
@@ -506,8 +506,6 @@ faceted_search_walkthrough_filter_1: |-
506506
})
507507
post_dump_1: |-
508508
client.createDump()
509-
get_dump_status_1: |-
510-
client.getDumpStatus('20201101-110357260')
511509
phrase_search_1: |-
512510
client.index('movies')
513511
.search('"african american" horror')

.github/scripts/check-release.sh

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,18 @@
22

33
# Checking if current tag matches the package version
44
current_tag=$(echo $GITHUB_REF | cut -d '/' -f 3 | tr -d ' ',v)
5-
file_tag=$(grep '"version":' package.json | cut -d ':' -f 2- | tr -d ' ' | tr -d '"' | tr -d ',')
6-
if [ "$current_tag" != "$file_tag" ]; then
5+
6+
package_json_version=$(grep '"version":' package.json | cut -d ':' -f 2- | tr -d ' ' | tr -d '"' | tr -d ',')
7+
if [ "$current_tag" != "$package_json_version" ]; then
78
echo "Error: the current tag does not match the version in package file(s)."
8-
echo "$current_tag vs $file_tag"
9+
echo "$current_tag vs $package_json_version"
10+
exit 1
11+
fi
12+
13+
package_version_ts=$(grep "PACKAGE_VERSION =" src/package-version.ts | cut -d "=" -f 2- | tr -d " " | tr -d "'")
14+
if [ "$current_tag" != "$package_version_ts" ]; then
15+
echo "Error: the current tag does not match the version in src/package-version.ts."
16+
echo "$current_tag vs $package_version_ts"
917
exit 1
1018
fi
1119

CONTRIBUTING.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,12 +115,18 @@ _[Read more about this](https://github.com/meilisearch/integration-guides/blob/m
115115

116116
⚠️ Before doing anything, make sure you got through the guide about [Releasing an Integration](https://github.com/meilisearch/integration-guides/blob/main/resources/integration-release.md).
117117

118-
Make a PR modifying the file [`package.json`](/package.json) with the right version.
118+
Make a PR modifying the following files with the right version:
119119

120+
[`package.json`](/package.json):
120121
```javascript
121122
"version": "X.X.X",
122123
```
123124

125+
[`src/package-version`](/src/package-version.ts)
126+
```javascript
127+
export const PACKAGE_VERSION = 'X.X.X'
128+
```
129+
124130
Once the changes are merged on `main`, you can publish the current draft release via the [GitHub interface](https://github.com/meilisearch/meilisearch-js/releases): on this page, click on `Edit` (related to the draft release) > update the description (be sure you apply [these recommandations](https://github.com/meilisearch/integration-guides/blob/main/resources/integration-release.md#writting-the-release-description)) > when you are ready, click on `Publish release`.
125131

126132
GitHub Actions will be triggered and push the package to [npm](https://www.npmjs.com/package/meilisearch).

README.md

Lines changed: 36 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ Output:
192192
],
193193
"offset": 0,
194194
"limit": 20,
195-
"nbHits": 1,
195+
"estimatedTotalHits": 1,
196196
"processingTimeMs": 1,
197197
"query": "philoudelphia"
198198
}
@@ -227,7 +227,7 @@ await index.search(
227227
],
228228
"offset": 0,
229229
"limit": 20,
230-
"nbHits": 1,
230+
"estimatedTotalHits": 1,
231231
"processingTimeMs": 0,
232232
"query": "wonder"
233233
}
@@ -270,7 +270,7 @@ await index.search(
270270
],
271271
"offset": 0,
272272
"limit": 20,
273-
"nbHits": 1,
273+
"estimatedTotalHits": 1,
274274
"processingTimeMs": 0,
275275
"query": "wonder"
276276
}
@@ -285,7 +285,7 @@ await index.search(
285285
'',
286286
{
287287
filter: ['genres = fantasy'],
288-
facetsDistribution: ['genres']
288+
facets: ['genres']
289289
}
290290
)
291291
```
@@ -306,10 +306,10 @@ await index.search(
306306
],
307307
"offset": 0,
308308
"limit": 20,
309-
"nbHits": 2,
309+
"estimatedTotalHits": 2,
310310
"processingTimeMs": 0,
311311
"query": "",
312-
"facetsDistribution": {
312+
"facetDistribution": {
313313
"genres": {
314314
"Action": 2,
315315
"Fantasy": 1,
@@ -342,7 +342,7 @@ controller.abort()
342342

343343
## 🤖 Compatibility with Meilisearch
344344

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

347347
## 💡 Learn More
348348

@@ -393,7 +393,7 @@ If you want to know more about the development workflow or want to contribute, p
393393

394394
- [Get Documents](https://docs.meilisearch.com/reference/api/documents.html#get-documents):
395395

396-
`index.getDocuments(params: getDocumentsParams): Promise<Document<T>[]>`
396+
`index.getDocuments(parameters: DocumentsQuery = {}): Promise<DocumentsResults<T>>>`
397397

398398
- [Get one document](https://docs.meilisearch.com/reference/api/documents.html#get-one-document):
399399

@@ -413,47 +413,44 @@ If you want to know more about the development workflow or want to contribute, p
413413

414414
### Tasks <!-- omit in toc -->
415415

416-
- [Get task info using the client](https://docs.meilisearch.com/reference/api/tasks.html#get-all-tasks):
416+
- [Get all tasks](https://docs.meilisearch.com/reference/api/tasks.html#get-all-tasks)
417417

418-
Task list:
419-
`client.getTasks(): Promise<Result<Task[]>>`
418+
`client.getTasks(parameters: TasksQuery): Promise<TasksResults>`
420419

421-
One task:
422-
`client.getTask(uid: number): Promise<Task>`
420+
- [Get one task](https://docs.meilisearch.com/reference/api/tasks.html#get-task)
423421

424-
- [Get task info using the index](https://docs.meilisearch.com/reference/api/tasks.html#get-all-tasks-by-index):
422+
`client.getTask(uid: number): Promise<Task>`
425423

426-
Task list:
427-
`index.getTasks(): Promise<Result<Task[]>>`
424+
- [Get all tasks of an index](https://docs.meilisearch.com/reference/api/tasks.html#get-all-tasks-by-index)
428425

429-
One task:
430-
`index.getTask(uid: number): Promise<Task>`
426+
`index.getTasks(parameters: TasksQuery): Promise<TasksResults>`
427+
428+
- [Get one task of an index](https://docs.meilisearch.com/reference/api/tasks.html#get-task)
429+
430+
`index.getTask(uid: number): Promise<Task>`
431431

432432
- Wait for one task:
433433

434-
Using de client:
435-
`client.waitForTask(uid: number, { timeOutMs?: number, intervalMs?: number }): Promise<Task>`
434+
`client.waitForTask(uid: number, { timeOutMs?: number, intervalMs?: number }): Promise<Task>`
436435

437-
Using the index:
438-
`index.waitForTask(uid: number, { timeOutMs?: number, intervalMs?: number }): Promise<Task>`
436+
With an index instance:
437+
`index.waitForTask(uid: number, { timeOutMs?: number, intervalMs?: number }): Promise<Task>`
439438

440439
- Wait for multiple tasks:
440+
`client.waitForTasks(uids: number[], { timeOutMs?: number, intervalMs?: number }): Promise<Task[]>`
441441

442-
Using the client:
443-
`client.waitForTasks(uids: number[], { timeOutMs?: number, intervalMs?: number }): Promise<Result<Task[]>>`
444-
445-
Using the index:
446-
`index.waitForTasks(uids: number[], { timeOutMs?: number, intervalMs?: number }): Promise<Result<Task[]>>`
442+
With an index instance:
443+
`index.waitForTasks(uids: number[], { timeOutMs?: number, intervalMs?: number }): Promise<Task[]>`
447444

448445
### Indexes <!-- omit in toc -->
449446

450-
- [Get all indexes in Index instances](https://docs.meilisearch.com/reference/api/indexes.html#list-all-indexes):
447+
- [Get all indexes as Index instances](https://docs.meilisearch.com/reference/api/indexes.html#list-all-indexes):
451448

452-
`client.getIndexes(): Promise<Index[]>`
449+
`client.getIndexes(parameters: IndexesQuery): Promise<IndexesResults<Index[]>>`
453450

454-
- [Get raw indexes in JSON response from Meilisearch](https://docs.meilisearch.com/reference/api/indexes.html#list-all-indexes):
451+
- [Get all indexes](https://docs.meilisearch.com/reference/api/indexes.html#list-all-indexes):
455452

456-
`client.getRawIndexes(): Promise<IndexResponse[]>`
453+
`client.getRawIndexes(parameters: IndexesQuery): Promise<IndexesResults<IndexObject[]>>`
457454

458455
- [Create a new index](https://docs.meilisearch.com/reference/api/indexes.html#create-an-index):
459456

@@ -467,10 +464,10 @@ Using the index:
467464
`client.getIndex<T>(uid: string): Promise<Index<T>>`
468465

469466
- [Get the raw index JSON response from Meilisearch](https://docs.meilisearch.com/reference/api/indexes.html#get-one-index):
470-
`client.getRawIndex(uid: string): Promise<IndexResponse>`
467+
`client.getRawIndex(uid: string): Promise<IndexObject>`
471468

472469
- [Get an object with information about the index](https://docs.meilisearch.com/reference/api/indexes.html#get-one-index):
473-
`index.getRawInfo(): Promise<IndexResponse>`
470+
`index.getRawInfo(): Promise<IndexObject>`
474471

475472
- [Update Index](https://docs.meilisearch.com/reference/api/indexes.html#update-an-index):
476473

@@ -620,23 +617,23 @@ Using the index object:
620617

621618
- [Get keys](https://docs.meilisearch.com/reference/api/keys.html#get-all-keys):
622619

623-
`client.getKeys(): Promise<Result<Key[]>>`
620+
`client.getKeys(parameters: KeysQuery): Promise<KeysResults>`
624621

625622
- [Get one key](https://docs.meilisearch.com/reference/api/keys.html#get-one-key):
626623

627-
`client.getKey(key: string): Promise<Key>`
624+
`client.getKey(keyOrUid: string): Promise<Key>`
628625

629626
- [Create a key](https://docs.meilisearch.com/reference/api/keys.html#create-a-key):
630627

631-
`client.createKey(options: KeyPayload): Promise<Key>`
628+
`client.createKey(options: KeyCreation): Promise<Key>`
632629

633630
- [Update a key](https://docs.meilisearch.com/reference/api/keys.html#update-a-key):
634631

635-
`client.updateKey(key: string, options: KeyPayload): Promise<Key>`
632+
`client.updateKey(keyOrUid: string, options: KeyUpdate): Promise<Key>`
636633

637634
- [Delete a key](https://docs.meilisearch.com/reference/api/keys.html#delete-a-key):
638635

639-
`client.deleteKey(key: string): Promise<void>`
636+
`client.deleteKey(keyOrUid: string): Promise<void>`
640637

641638
### isHealthy <!-- omit in toc -->
642639

@@ -666,11 +663,7 @@ Using the index object:
666663

667664
- [Trigger a dump creation process](https://docs.meilisearch.com/reference/api/dump.html#create-a-dump):
668665

669-
`client.createDump(): Promise<Types.EnqueuedDump>`
670-
671-
- [Get the status of a dump creation process](https://docs.meilisearch.com/reference/api/dump.html#get-dump-status):
672-
673-
`client.getDumpStatus(dumpUid: string): Promise<Types.EnqueuedDump>`
666+
`client.createDump(): Promise<EnqueuedTask>`
674667

675668
<hr>
676669

playgrounds/javascript/src/app.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ const indexUid = 'movies'
1010

1111
const addDataset = async () => {
1212
await client.deleteIndex(indexUid)
13-
const { uid } = await client.createIndex(indexUid)
14-
await client.index(indexUid).waitForTask(uid)
13+
const { taskUid } = await client.createIndex(indexUid)
14+
await client.index(indexUid).waitForTask(taskUid)
1515

1616
const documents = await client.index(indexUid).getDocuments()
1717

@@ -27,9 +27,9 @@ const addDataset = async () => {
2727
{ id: 5, title: 'Moana', genres: ['Fantasy', 'Action'] },
2828
{ id: 6, title: 'Philadelphia', genres: ['Drama'] },
2929
]
30-
if (documents.length === 0) {
31-
const task = await client.index(indexUid).addDocuments(dataset)
32-
await client.index(indexUid).waitForTask(task.uid)
30+
if (documents.results.length === 0) {
31+
const { taskUid } = await client.index(indexUid).addDocuments(dataset)
32+
await client.index(indexUid).waitForTask(taskUid)
3333
}
3434
}
3535

0 commit comments

Comments
 (0)