Skip to content

Commit 452201d

Browse files
committed
Fix merge conflicts
2 parents 055e6d8 + 02d1008 commit 452201d

File tree

11 files changed

+446
-222
lines changed

11 files changed

+446
-222
lines changed

.github/dependabot.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ updates:
55
schedule:
66
interval: "monthly"
77
labels:
8-
- 'skip changelog'
8+
- 'skip-changelog'
99
- 'dependencies'
1010
rebase-strategy: disabled
1111

.github/workflows/publish.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ jobs:
99
name: Rust project
1010
runs-on: ubuntu-latest
1111
steps:
12-
- uses: actions/checkout@v2
12+
- uses: actions/checkout@v3
1313
- uses: hecrj/setup-rust-action@master
1414
with:
1515
rust-version: stable

CONTRIBUTING.md

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,26 +2,13 @@
22

33
First of all, thank you for contributing to Meilisearch! The goal of this document is to provide everything you need to know in order to contribute to Meilisearch and its different integrations.
44

5-
- [Hacktoberfest 2022](#hacktoberfest-2022)
65
- [Assumptions](#assumptions)
76
- [How to Contribute](#how-to-contribute)
87
- [Development Workflow](#development-workflow)
98
- [Git Guidelines](#git-guidelines)
109
- [Release Process (for internal team only)](#release-process-for-internal-team-only)
1110

1211

13-
## Hacktoberfest 2022
14-
15-
It's [Hacktoberfest month](https://hacktoberfest.com)! 🥳
16-
17-
Thanks so much for participating with Meilisearch this year!
18-
19-
1. We will follow the quality standards set by the organizers of Hacktoberfest (see detail on their [website](https://hacktoberfest.com/participation/#spam)). Our reviewers will not consider any PR that doesn’t match that standard.
20-
2. PRs reviews will take place from Monday to Thursday, during usual working hours, CEST time. If you submit outside of these hours, there’s no need to panic; we will get around to your contribution.
21-
3. There will be no issue assignment as we don’t want people to ask to be assigned specific issues and never return, discouraging the volunteer contributors from opening a PR to fix this issue. We take the liberty to choose the PR that best fixes the issue, so we encourage you to get to it as soon as possible and do your best!
22-
23-
You can check out the longer, more complete guideline documentation [here](https://github.com/meilisearch/.github/blob/main/Hacktoberfest_2022_contributors_guidelines.md).
24-
2512
## Assumptions
2613

2714
1. **You're familiar with [GitHub](https://github.com) and the [Pull Request](https://help.github.com/en/github/collaborating-with-issues-and-pull-requests/about-pull-requests)(PR) workflow.**

README.md

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -33,22 +33,13 @@
3333

3434
## Table of Contents <!-- omit in TOC -->
3535

36-
- [🎃 Hacktoberfest](#-hacktoberfest)
3736
- [📖 Documentation](#-documentation)
3837
- [🔧 Installation](#-installation)
3938
- [🚀 Getting started](#-getting-started)
4039
- [🌐 Running in the Browser with WASM](#-running-in-the-browser-with-wasm)
4140
- [🤖 Compatibility with Meilisearch](#-compatibility-with-meilisearch)
4241
- [⚙️ Contributing](#️-contributing)
4342

44-
## 🎃 Hacktoberfest
45-
46-
It’s Hacktoberfest 2022 @Meilisearch
47-
48-
[Hacktoberfest](https://hacktoberfest.com/) is a celebration of the open-source community. This year, and for the third time in a row, Meilisearch is participating in this fantastic event.
49-
50-
You’d like to contribute? Don’t hesitate to check out our [contributing guidelines](./CONTRIBUTING.md).
51-
5243
## 📖 Documentation
5344

5445
This readme contains all the documentation you need to start using this Meilisearch SDK.

README.tpl

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -33,22 +33,13 @@
3333

3434
## Table of Contents <!-- omit in TOC -->
3535

36-
- [🎃 Hacktoberfest](#-hacktoberfest)
3736
- [📖 Documentation](#-documentation)
3837
- [🔧 Installation](#-installation)
3938
- [🚀 Getting started](#-getting-started)
4039
- [🌐 Running in the Browser with WASM](#-running-in-the-browser-with-wasm)
4140
- [🤖 Compatibility with Meilisearch](#-compatibility-with-meilisearch)
4241
- [⚙️ Contributing](#️-contributing)
4342

44-
## 🎃 Hacktoberfest
45-
46-
It’s Hacktoberfest 2022 @Meilisearch
47-
48-
[Hacktoberfest](https://hacktoberfest.com/) is a celebration of the open-source community. This year, and for the third time in a row, Meilisearch is participating in this fantastic event.
49-
50-
You’d like to contribute? Don’t hesitate to check out our [contributing guidelines](./CONTRIBUTING.md).
51-
5243
## 📖 Documentation
5344

5445
This readme contains all the documentation you need to start using this Meilisearch SDK.

src/client.rs

Lines changed: 77 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -130,10 +130,10 @@ impl Client {
130130
/// # });
131131
/// ```
132132
pub async fn list_all_indexes_raw(&self) -> Result<Value, Error> {
133-
let json_indexes = request::<(), Value>(
133+
let json_indexes = request::<(), (), Value>(
134134
&format!("{}/indexes", self.host),
135135
&self.api_key,
136-
Method::Get(()),
136+
Method::Get { query: () },
137137
200,
138138
)
139139
.await?;
@@ -166,10 +166,12 @@ impl Client {
166166
&self,
167167
indexes_query: &IndexesQuery<'_>,
168168
) -> Result<Value, Error> {
169-
let json_indexes = request::<&IndexesQuery, Value>(
169+
let json_indexes = request::<&IndexesQuery, (), Value>(
170170
&format!("{}/indexes", self.host),
171171
&self.api_key,
172-
Method::Get(indexes_query),
172+
Method::Get {
173+
query: indexes_query,
174+
},
173175
200,
174176
)
175177
.await?;
@@ -227,10 +229,10 @@ impl Client {
227229
/// ```
228230
/// If you use it directly from an [Index], you can use the method [Index::fetch_info], which is the equivalent method from an index.
229231
pub async fn get_raw_index(&self, uid: impl AsRef<str>) -> Result<Value, Error> {
230-
request::<(), Value>(
232+
request::<(), (), Value>(
231233
&format!("{}/indexes/{}", self.host, uid.as_ref()),
232234
&self.api_key,
233-
Method::Get(()),
235+
Method::Get { query: () },
234236
200,
235237
)
236238
.await
@@ -274,13 +276,16 @@ impl Client {
274276
uid: impl AsRef<str>,
275277
primary_key: Option<&str>,
276278
) -> Result<TaskInfo, Error> {
277-
request::<Value, TaskInfo>(
279+
request::<(), Value, TaskInfo>(
278280
&format!("{}/indexes", self.host),
279281
&self.api_key,
280-
Method::Post(json!({
281-
"uid": uid.as_ref(),
282-
"primaryKey": primary_key,
283-
})),
282+
Method::Post {
283+
query: (),
284+
body: json!({
285+
"uid": uid.as_ref(),
286+
"primaryKey": primary_key,
287+
}),
288+
},
284289
202,
285290
)
286291
.await
@@ -289,10 +294,10 @@ impl Client {
289294
/// Delete an index from its UID.
290295
/// To delete an [Index], use the [Index::delete] method.
291296
pub async fn delete_index(&self, uid: impl AsRef<str>) -> Result<TaskInfo, Error> {
292-
request::<(), TaskInfo>(
297+
request::<(), (), TaskInfo>(
293298
&format!("{}/indexes/{}", self.host, uid.as_ref()),
294299
&self.api_key,
295-
Method::Delete,
300+
Method::Delete { query: () },
296301
202,
297302
)
298303
.await
@@ -340,10 +345,10 @@ impl Client {
340345
/// # });
341346
/// ```
342347
pub async fn get_stats(&self) -> Result<ClientStats, Error> {
343-
request::<(), ClientStats>(
348+
request::<(), (), ClientStats>(
344349
&format!("{}/stats", self.host),
345350
&self.api_key,
346-
Method::Get(()),
351+
Method::Get { query: () },
347352
200,
348353
)
349354
.await
@@ -366,10 +371,10 @@ impl Client {
366371
/// # });
367372
/// ```
368373
pub async fn health(&self) -> Result<Health, Error> {
369-
request::<(), Health>(
374+
request::<(), (), Health>(
370375
&format!("{}/health", self.host),
371376
&self.api_key,
372-
Method::Get(()),
377+
Method::Get { query: () },
373378
200,
374379
)
375380
.await
@@ -422,10 +427,10 @@ impl Client {
422427
/// # });
423428
/// ```
424429
pub async fn get_keys_with(&self, keys_query: &KeysQuery) -> Result<KeysResults, Error> {
425-
let keys = request::<&KeysQuery, KeysResults>(
430+
let keys = request::<&KeysQuery, (), KeysResults>(
426431
&format!("{}/keys", self.host),
427432
&self.api_key,
428-
Method::Get(keys_query),
433+
Method::Get { query: keys_query },
429434
200,
430435
)
431436
.await?;
@@ -454,10 +459,10 @@ impl Client {
454459
/// # });
455460
/// ```
456461
pub async fn get_keys(&self) -> Result<KeysResults, Error> {
457-
let keys = request::<(), KeysResults>(
462+
let keys = request::<(), (), KeysResults>(
458463
&format!("{}/keys", self.host),
459464
&self.api_key,
460-
Method::Get(()),
465+
Method::Get { query: () },
461466
200,
462467
)
463468
.await?;
@@ -490,10 +495,10 @@ impl Client {
490495
/// # });
491496
/// ```
492497
pub async fn get_key(&self, key: impl AsRef<str>) -> Result<Key, Error> {
493-
request::<(), Key>(
498+
request::<(), (), Key>(
494499
&format!("{}/keys/{}", self.host, key.as_ref()),
495500
&self.api_key,
496-
Method::Get(()),
501+
Method::Get { query: () },
497502
200,
498503
)
499504
.await
@@ -525,10 +530,10 @@ impl Client {
525530
/// # });
526531
/// ```
527532
pub async fn delete_key(&self, key: impl AsRef<str>) -> Result<(), Error> {
528-
request::<(), ()>(
533+
request::<(), (), ()>(
529534
&format!("{}/keys/{}", self.host, key.as_ref()),
530535
&self.api_key,
531-
Method::Delete,
536+
Method::Delete { query: () },
532537
204,
533538
)
534539
.await
@@ -559,10 +564,13 @@ impl Client {
559564
/// # });
560565
/// ```
561566
pub async fn create_key(&self, key: impl AsRef<KeyBuilder>) -> Result<Key, Error> {
562-
request::<&KeyBuilder, Key>(
567+
request::<(), &KeyBuilder, Key>(
563568
&format!("{}/keys", self.host),
564569
&self.api_key,
565-
Method::Post(key.as_ref()),
570+
Method::Post {
571+
query: (),
572+
body: key.as_ref(),
573+
},
566574
201,
567575
)
568576
.await
@@ -595,10 +603,13 @@ impl Client {
595603
/// # });
596604
/// ```
597605
pub async fn update_key(&self, key: impl AsRef<KeyUpdater>) -> Result<Key, Error> {
598-
request::<&KeyUpdater, Key>(
606+
request::<(), &KeyUpdater, Key>(
599607
&format!("{}/keys/{}", self.host, key.as_ref().key),
600608
&self.api_key,
601-
Method::Patch(key.as_ref()),
609+
Method::Patch {
610+
body: key.as_ref(),
611+
query: (),
612+
},
602613
200,
603614
)
604615
.await
@@ -620,10 +631,10 @@ impl Client {
620631
/// # });
621632
/// ```
622633
pub async fn get_version(&self) -> Result<Version, Error> {
623-
request::<(), Version>(
634+
request::<(), (), Version>(
624635
&format!("{}/version", self.host),
625636
&self.api_key,
626-
Method::Get(()),
637+
Method::Get { query: () },
627638
200,
628639
)
629640
.await
@@ -721,10 +732,10 @@ impl Client {
721732
/// # });
722733
/// ```
723734
pub async fn get_task(&self, task_id: impl AsRef<u32>) -> Result<Task, Error> {
724-
request::<(), Task>(
735+
request::<(), (), Task>(
725736
&format!("{}/tasks/{}", self.host, task_id.as_ref()),
726737
&self.api_key,
727-
Method::Get(()),
738+
Method::Get { query: () },
728739
200,
729740
)
730741
.await
@@ -752,10 +763,10 @@ impl Client {
752763
&self,
753764
tasks_query: &TasksSearchQuery<'_>,
754765
) -> Result<TasksResults, Error> {
755-
let tasks = request::<&TasksSearchQuery, TasksResults>(
766+
let tasks = request::<&TasksSearchQuery, (), TasksResults>(
756767
&format!("{}/tasks", self.host),
757768
&self.api_key,
758-
Method::Get(tasks_query),
769+
Method::Get { query: tasks_query },
759770
200,
760771
)
761772
.await?;
@@ -819,10 +830,10 @@ impl Client {
819830
/// # });
820831
/// ```
821832
pub async fn get_tasks(&self) -> Result<TasksResults, Error> {
822-
let tasks = request::<(), TasksResults>(
833+
let tasks = request::<(), (), TasksResults>(
823834
&format!("{}/tasks", self.host),
824835
&self.api_key,
825-
Method::Get(()),
836+
Method::Get { query: () },
826837
200,
827838
)
828839
.await?;
@@ -929,31 +940,55 @@ mod tests {
929940
mock("GET", path)
930941
.match_header("User-Agent", user_agent)
931942
.create(),
932-
request::<(), ()>(address, "", Method::Get(()), 200),
943+
request::<(), (), ()>(address, "", Method::Get { query: () }, 200),
933944
),
934945
(
935946
mock("POST", path)
936947
.match_header("User-Agent", user_agent)
937948
.create(),
938-
request::<(), ()>(address, "", Method::Post(()), 200),
949+
request::<(), (), ()>(
950+
address,
951+
"",
952+
Method::Post {
953+
query: (),
954+
body: {},
955+
},
956+
200,
957+
),
939958
),
940959
(
941960
mock("DELETE", path)
942961
.match_header("User-Agent", user_agent)
943962
.create(),
944-
request::<(), ()>(address, "", Method::Delete, 200),
963+
request::<(), (), ()>(address, "", Method::Delete { query: () }, 200),
945964
),
946965
(
947966
mock("PUT", path)
948967
.match_header("User-Agent", user_agent)
949968
.create(),
950-
request::<(), ()>(address, "", Method::Put(()), 200),
969+
request::<(), (), ()>(
970+
address,
971+
"",
972+
Method::Put {
973+
query: (),
974+
body: (),
975+
},
976+
200,
977+
),
951978
),
952979
(
953980
mock("PATCH", path)
954981
.match_header("User-Agent", user_agent)
955982
.create(),
956-
request::<(), ()>(address, "", Method::Patch(()), 200),
983+
request::<(), (), ()>(
984+
address,
985+
"",
986+
Method::Patch {
987+
query: (),
988+
body: (),
989+
},
990+
200,
991+
),
957992
),
958993
];
959994

0 commit comments

Comments
 (0)