Skip to content

Commit 272f5f5

Browse files
v0.8.7 (#82)
* ci(actions): bump actions/checkout from 3 to 4 Bumps [actions/checkout](https://github.com/actions/checkout) from 3 to 4. - [Release notes](https://github.com/actions/checkout/releases) - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md) - [Commits](actions/checkout@v3...v4) --- updated-dependencies: - dependency-name: actions/checkout dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com> * chore(cargo): update typed-builder requirement from 0.16 to 0.18 Updates the requirements on [typed-builder](https://github.com/idanarye/rust-typed-builder) to permit the latest version. - [Changelog](https://github.com/idanarye/rust-typed-builder/blob/master/CHANGELOG.md) - [Commits](https://github.com/idanarye/rust-typed-builder/commits) --- updated-dependencies: - dependency-name: typed-builder dependency-type: direct:production ... Signed-off-by: dependabot[bot] <support@github.com> * chore(cargo): update redis requirement from 0.23.2 to 0.24.0 Updates the requirements on [redis](https://github.com/redis-rs/redis-rs) to permit the latest version. - [Release notes](https://github.com/redis-rs/redis-rs/releases) - [Commits](redis-rs/redis-rs@redis-0.23.2...redis-0.24.0) --- updated-dependencies: - dependency-name: redis dependency-type: direct:production ... Signed-off-by: dependabot[bot] <support@github.com> * Ft/Made model's field public (#81) * Made public all model's fields * Fixed clippy * Added docs * Small changes in docs for queries.rs * Added workflow * Bumping to v0.8.7 * removed the -p option from cargo publish --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
1 parent ef1b452 commit 272f5f5

File tree

12 files changed

+111
-53
lines changed

12 files changed

+111
-53
lines changed

.github/workflows/cargo_publish.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: Publish to crates registry
2+
3+
on:
4+
release:
5+
types: [published]
6+
7+
jobs:
8+
build:
9+
runs-on: ubuntu-latest
10+
name: Publish to crates registry
11+
steps:
12+
- name: Checkout sources
13+
uses: actions/checkout@v2
14+
- name: Install stable toolchain
15+
uses: actions-rs/toolchain@v1
16+
with:
17+
profile: minimal
18+
toolchain: stable
19+
override: true
20+
- run: cargo publish --token ${CARGO_REGISTRY_TOKEN}
21+
env:
22+
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}

.github/workflows/rust.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ jobs:
3434
--health-retries 5
3535
3636
steps:
37-
- uses: actions/checkout@v3
37+
- uses: actions/checkout@v4
3838

3939
- name: Setup Rust
4040
uses: actions-rs/toolchain@v1
@@ -71,7 +71,7 @@ jobs:
7171
needs: test
7272

7373
steps:
74-
- uses: actions/checkout@v3
74+
- uses: actions/checkout@v4
7575

7676
- name: Setup Rust
7777
uses: actions-rs/toolchain@v1

.github/workflows/style.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ jobs:
1010

1111
steps:
1212
- name: Checkout repository
13-
uses: actions/checkout@v3
13+
uses: actions/checkout@v4
1414

1515
- name: Check code formatting
1616
run: cargo fmt -- --check --verbose

CHANGELOG.md

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,17 @@
11
# Changelog
22

3-
# 0.8.5 (2023-09-4) [#74](https://github.com/TuTarea/vinted-rs/pull/74/)
3+
# 0.8.7 (2024-04-3) [#82](https://github.com/TuTarea/vinted-rs/pull/82/)
4+
5+
## Improved
6+
7+
- Made all fields in the `filter::models` crates _pub_ [#81](https://github.com/TuTarea/vinted-rs/pull/81/)
8+
- Added `cargo_publish` workflow
9+
10+
## Fixes
11+
12+
- Added more documentation on `filter::models` crates fields
13+
14+
# 0.8.6 (2023-09-4) [#74](https://github.com/TuTarea/vinted-rs/pull/74/)
415

516
## Improved
617

@@ -9,7 +20,7 @@
920

1021
# 0.8.5 (2023-09-3) [#72](https://github.com/TuTarea/vinted-rs/pull/72/)
1122

12-
## Improved
23+
## Fixes
1324

1425
- Fixed clients treatment
1526

Cargo.toml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "vinted-rs"
3-
version = "0.8.6"
3+
version = "0.8.7"
44
edition = "2021"
55
repository = "https://github.com/TuTarea/vinted-rs"
66
authors = [
@@ -31,16 +31,16 @@ serde = { version = "1.0", features = ["serde_derive"] }
3131
thiserror = "1.0"
3232
rand = "0.8"
3333
reqwest_cookie_store = "0.6"
34-
typed-builder = "0.16"
34+
typed-builder = "0.18"
3535
fang = { version = "0.10.3", features = ["asynk"], default-features = false }
3636
redis-macros = { version = "0.2.1", optional = true }
37-
redis = { version = "0.23.2", optional = true }
37+
redis = { version = "0.24.0", optional = true }
3838
serde_json = { version = "1.0.91" }
3939
log = "0.4.20"
4040
lazy_static = "1.4.0"
4141
[dev-dependencies]
4242
redis-macros = { version = "0.2.1" }
43-
redis = { version = "0.23.2" }
43+
redis = { version = "0.24.0" }
4444

4545
[dependencies.bb8-postgres]
4646
version = "0.8"

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ Via `cargo` you can add the library to your project's `Cargo.toml`
2424

2525
```toml
2626
[dependencies]
27-
vinted-rs = "0.8.5"
27+
vinted-rs = "0.8.7"
2828
```
2929

3030
## DB setup

src/model/filter.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ pub mod size;
3636
/// let filter: Filter = Filter::builder()
3737
/// .catalog_ids(Some(String::from("4,16")))
3838
/// .brand_ids(Some(String::from("14,53")))
39-
/// .build();
39+
/// .build();
4040
///
4141
/// // Women shoes and Women clothes that are only from brands Adidas and Nike.
4242
///

src/model/item.rs

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,24 +44,31 @@ impl fmt::Display for Item {
4444
#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Hash, Eq)]
4545
#[cfg_attr(feature = "redis", derive(FromRedisValue, ToRedisArgs,))]
4646
pub struct AdvancedItem {
47-
// Products filter info
47+
/// Vinted item ID
4848
pub id: i64,
49+
/// Item title
4950
pub title: String,
51+
/// Item description
5052
pub description: String,
53+
/// See [`Size`](crate::model::filter::size::Size)
5154
#[serde(rename = "size")]
5255
pub size_title: String,
56+
/// See [`Brand`](crate::model::filter::brand::Brand)
5357
#[serde(rename = "brand")]
5458
pub brand_title: String,
5559
#[serde(skip_serializing_if = "Option::is_none")]
5660
pub composition: Option<String>,
5761
#[serde(skip_serializing_if = "Option::is_none")]
5862
pub extra_conditions: Option<String>,
63+
/// See [`Brand`](crate::model::filter::brand::Brand)
5964
#[serde(skip_serializing_if = "Option::is_none")]
6065
pub brand_id: Option<i32>,
6166
#[serde(skip_serializing_if = "Option::is_none")]
6267
pub size_id: Option<i32>,
68+
/// See [`ArticleStatus`](crate::model::filter::ArticleStatus)
6369
#[serde(skip_serializing_if = "Option::is_none")]
6470
pub status_id: Option<i32>,
71+
/// Status of the item in French 🇫🇷
6572
#[serde(rename = "status")]
6673
#[serde(skip_serializing_if = "Option::is_none")]
6774
pub status_fr: Option<String>,
@@ -78,25 +85,33 @@ pub struct AdvancedItem {
7885
#[serde(skip_serializing_if = "Option::is_none")]
7986
pub color2: Option<String>,
8087
pub package_size_id: i32,
81-
//Location
88+
/// See [`Country`](crate::model::filter::country::Country)
8289
pub country_id: i32,
8390
#[serde(skip_serializing_if = "Option::is_none")]
8491
pub city_id: Option<i32>,
8592
#[serde(skip_serializing_if = "Option::is_none")]
8693
pub city: Option<String>,
8794

8895
//Stats
96+
/// Number of bids on the item
8997
pub active_bid_count: i32,
98+
/// Number of times the item was added to favourites
9099
pub favourite_count: i32,
100+
/// Number of times the item was viewed
91101
pub view_count: i32,
102+
/// Moderation status of the item (Vinted internal use only)
92103
pub moderation_status: i32,
93104
#[serde(skip_serializing_if = "Option::is_none")]
94105
pub last_push_up_at: Option<String>,
106+
/// Related ['Brand'](crate::model::filter::brand::Brand) IDs
95107
pub related_catalog_ids: Vec<i32>,
96108

97109
// Pricing
110+
/// Original price of the item
98111
pub original_price_numeric: String,
112+
/// Currency the item was posted with. See [`Currency`](crate::model::filter::Currency) for valid currencies on Vinted
99113
pub currency: String,
114+
/// Current valid price of the item
100115
pub price_numeric: String,
101116

102117
// Order by stats
@@ -106,7 +121,7 @@ pub struct AdvancedItem {
106121
#[serde(skip_serializing_if = "Option::is_none")]
107122
pub user_updated_at_ts: Option<String>,
108123

109-
// Asets
124+
// Assets
110125
pub photos: Vec<Photo>,
111126
pub url: String,
112127
pub user: AdvancedUser,

src/model/payment_method.rs

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,19 +8,22 @@ use redis_macros::{FromRedisValue, ToRedisArgs};
88
#[derive(Debug, Clone, Deserialize, Serialize, PartialEq, Hash, Eq)]
99
#[cfg_attr(feature = "redis", derive(FromRedisValue, ToRedisArgs,))]
1010
pub struct PayInMethod {
11-
id: i32,
12-
code: String,
13-
requires_credit_card: bool,
11+
pub id: i32,
12+
/// Code of the payment method given by Vinted
13+
pub code: String,
14+
/// If the payment method requires a credit card
15+
pub requires_credit_card: bool,
1416
#[serde(skip_serializing_if = "Option::is_none")]
15-
event_tracking_code: Option<String>,
17+
pub event_tracking_code: Option<String>,
18+
/// Icon of the payment method
1619
#[serde(skip_serializing_if = "Option::is_none")]
17-
icon: Option<String>,
18-
enabled: bool,
20+
pub icon: Option<String>,
21+
pub enabled: bool,
1922
#[serde(skip_serializing_if = "Option::is_none")]
20-
translated_name: Option<String>,
23+
pub translated_name: Option<String>,
2124
#[serde(skip_serializing_if = "Option::is_none")]
22-
note: Option<String>,
23-
method_change_possible: bool,
25+
pub note: Option<String>,
26+
pub method_change_possible: bool,
2427
}
2528

2629
impl fmt::Display for PayInMethod {

src/model/user.rs

Lines changed: 34 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,51 +1,60 @@
1-
use std::fmt;
2-
31
use crate::model::{Deserialize, Serialize};
42
#[cfg(feature = "redis")]
53
use crate::model::{FromRedisValue, ToRedisArgs};
4+
use std::fmt;
65

76
use super::{payment_method::PayInMethod, photo::Photo};
87

98
#[derive(Debug, Clone, Serialize, Deserialize, Eq, PartialEq, Hash)]
109
#[cfg_attr(feature = "redis", derive(FromRedisValue, ToRedisArgs,))]
1110
pub struct User {
12-
id: i64,
13-
login: String, //usernameredis_macros
14-
photo: Photo,
11+
/// Vinted user ID
12+
pub id: i64,
13+
// Username
14+
pub login: String,
15+
/// User's profile picture URL
16+
pub photo: Photo,
1517
}
16-
18+
/// All avalible fields for a user
1719
#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Hash, Eq)]
1820
#[cfg_attr(feature = "redis", derive(FromRedisValue, ToRedisArgs,))]
1921
pub struct AdvancedUser {
20-
id: i64,
21-
login: String, //username
22+
/// Vinted user ID
23+
pub id: i64,
24+
/// Username
25+
pub login: String,
26+
/// User's profile picture URL
2227
#[serde(skip_serializing_if = "Option::is_none")]
23-
photo: Option<Photo>,
24-
28+
pub photo: Option<Photo>,
29+
/// User's real name
2530
#[serde(skip_serializing_if = "Option::is_none")]
26-
real_name: Option<String>,
31+
pub real_name: Option<String>,
32+
/// User's email
2733
#[serde(skip_serializing_if = "Option::is_none")]
28-
email: Option<String>,
34+
pub email: Option<String>,
35+
/// User's birthday
2936
#[serde(skip_serializing_if = "Option::is_none")]
30-
birthday: Option<String>,
37+
pub birthday: Option<String>,
3138
#[serde(skip_serializing_if = "Option::is_none")]
32-
gender: Option<String>,
33-
39+
pub gender: Option<String>,
40+
/// Last time the user logged in
3441
#[serde(skip_serializing_if = "Option::is_none")]
35-
last_loged_on_ts: Option<String>,
36-
expose_location: bool,
37-
country_id: i32,
42+
pub last_loged_on_ts: Option<String>,
43+
/// If the user wants to expose his location
44+
pub expose_location: bool,
45+
/// See [`Country`](crate::model::filter::country::Country)
46+
pub country_id: i32,
3847
#[serde(skip_serializing_if = "Option::is_none")]
39-
city_id: Option<i32>,
48+
pub city_id: Option<i32>,
49+
/// City name
4050
#[serde(skip_serializing_if = "Option::is_none")]
41-
city: Option<String>,
42-
51+
pub city: Option<String>,
4352
#[serde(skip_serializing_if = "Option::is_none")]
44-
path: Option<String>,
53+
pub path: Option<String>,
4554
#[serde(skip_serializing_if = "Option::is_none")]
46-
about: Option<String>,
47-
48-
accepted_pay_in_methods: Vec<PayInMethod>,
55+
pub about: Option<String>,
56+
/// Payment methods accepted by the user
57+
pub accepted_pay_in_methods: Vec<PayInMethod>,
4958
}
5059

5160
impl fmt::Display for AdvancedUser {

src/queries.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -425,14 +425,12 @@ impl<'a> VintedWrapper<'a> {
425425
pub fn get_id(&self) -> &usize {
426426
&self.id
427427
}
428-
/**
429-
430-
After changing host is always necessary to refresh cookies
431-
*/
428+
/// After changing host is always necessary to refresh cookies
432429
pub fn set_new_random_host(&mut self) {
433430
self.host = random_host();
434431
}
435432

433+
/// After changing host is always necessary to refresh cookies
436434
pub fn set_new_host(&mut self, host: Host) {
437435
self.host = host.into();
438436
}

src/tests/queries.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ async fn test_get_item_brands() {
6161
match vinted.get_items(&filter, 1, None, None, None).await {
6262
// Limitado el numero de elementos a 1
6363
Ok(items) => {
64-
assert_eq!(items.items.get(0).unwrap().brand_title, brand.title);
64+
assert_eq!(items.items.first().unwrap().brand_title, brand.title);
6565
}
6666
Err(err) => match err {
6767
VintedWrapperError::ItemNumberError => unreachable!(),

0 commit comments

Comments
 (0)