Skip to content

Commit

Permalink
Merge pull request #64 from Chloe-Woahie/dev-main
Browse files Browse the repository at this point in the history
v0.32.3
  • Loading branch information
fekie authored Jun 5, 2023
2 parents c6bb2e9 + 6452a98 commit 03d9d97
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 27 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ license = "MIT"
name = "roboat"
readme = "README.md"
repository = "https://github.com/Chloe-Woahie/roboat"
version = "0.32.2"
version = "0.32.3"

[dependencies]
reqwest = { version = "0.11.14", default-features=false, features = ["rustls-tls", "json"] }
Expand Down
7 changes: 0 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,13 +76,6 @@ You can add the latest version of roboat to your project by running:
cargo add roboat
```

Alternatively, you can add a specific version of roboat to your project by adding the crate to your `Cargo.toml`:

```toml
[dependencies]
roboat = "0.32.2"
```

# Quick Start Examples

## Example 1 - Purchase Free UGC Limited
Expand Down
14 changes: 10 additions & 4 deletions src/catalog/catalog_types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -704,9 +704,15 @@ pub struct AvatarSearchQuery {
/// Subcategory must be filled to query more than one page.
pub subcategory: Option<Subcategory>,
/// The minimum price for each asset.
pub min_price: Option<u64>,
///
/// This is a u32 because large numbers are almost always not needed and cause the
/// endpoint to return an error. More information can be found here: <https://github.com/Chloe-Woahie/roboat/pull/61>.
pub min_price: Option<u32>,
/// The maximum price for each asset.
pub max_price: Option<u64>,
///
/// This is a u32 because large numbers are almost always not needed and cause the
/// endpoint to return an error. More information can be found here: <https://github.com/Chloe-Woahie/roboat/pull/61>.
pub max_price: Option<u32>,
/// The maximum assets Roblox should return per page.
/// View [`CatalogQueryLimit`] for more information.
pub limit: Option<CatalogQueryLimit>,
Expand Down Expand Up @@ -859,13 +865,13 @@ impl AvatarSearchQueryBuilder {
}

#[allow(missing_docs)]
pub fn min_price(mut self, min_price: u64) -> Self {
pub fn min_price(mut self, min_price: u32) -> Self {
self.query.min_price = Some(min_price);
self
}

#[allow(missing_docs)]
pub fn max_price(mut self, max_price: u64) -> Self {
pub fn max_price(mut self, max_price: u32) -> Self {
self.query.max_price = Some(max_price);
self
}
Expand Down
5 changes: 5 additions & 0 deletions src/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,11 @@ use tokio::sync::RwLock;
/// The errors that can be returned by any of `Client`'s methods that require the X-CSRF-TOKEN header are:
/// - [`RoboatError::InvalidXcsrf`]
/// - [`RoboatError::XcsrfNotReturned`]
///
/// # 2-Factor Authentication / Captcha Required Errors
/// The errors that can be returned by any of `Client`'s methods that require 2-factor authentication or a captcha are:
/// - [`RoboatError::ChallengeRequired`]
/// - [`RoboatError::UnknownStatus403Format`]
#[derive(Debug, Default)]
pub struct Client {
/// The full cookie that includes the roblosecurity token.
Expand Down
3 changes: 2 additions & 1 deletion src/economy/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -446,7 +446,6 @@ impl Client {
}
}

// todo: add manual xcsrf refreshing and talk about it here
/// Purchases a limited using <https://economy.roblox.com/v1/purchases/products/{product_id}>.
/// Only works on tradeable (legacy) limiteds.
///
Expand All @@ -456,6 +455,8 @@ impl Client {
///
/// # Return Value Notes
/// * Will return `Ok(())` if the limited was successfully purchased.
/// * As it will repeat once if the x-csrf-token is invalid, you may want to manually refresh the x-csrf-token
/// on another thread by using [`Client::force_refresh_xcsrf`].
///
/// # Argument Notes
/// * `product_id` is the product id of the limited, NOT the item id.
Expand Down
16 changes: 2 additions & 14 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -227,24 +227,12 @@ pub mod users;
/// A module related to validating requests.
mod validation;

// todo: inventory api, groups api, follow api
// todo: add usage to readme
// todo: every type should have an explanation of the typical means by which the user will construct or fetch it, if the answer isn't “this is a struct literal with public methods”.
// todo: figure out authtickets
// todo: maybe respect cookies returned
// todo: maybe post on devforums, reddit, maybe the rust server
// todo: put string of parsing error in MalformedResponse
// todo: apparently a v2 details api does 500 items at once
// todo: make ItemDetails include both price and lowest price
// todo: replace urls with the form GROUP_ROLES_API.replace("{group_id}", &group_id.to_string());
// todo: maybe add stronger types for stuff like cursors? stuff that can be returned basically
// todo: maybe add stronger types for stuff like cursors? stuff that can be returned basically and is unlikely to cbe created by the user.
// todo: add doc example and example count somewhere
// todo: add message apis
// todo: show on readme and crate docs which endpoints are wrappers for other endpoints
// todo: change vecs in arguments to slices
// todo: roblox error code 0 is "Challenge is required to authorize the request" (any captcha/two step)
// todo: add http caching
// todo: the roblox api docs show the roblox error codes, maybe a custom sub error can be made
// todo: add a "2 step not implemented for this endpoint" error

use serde::{Deserialize, Serialize};

Expand Down

0 comments on commit 03d9d97

Please sign in to comment.