563 lines
16 KiB
Rust
563 lines
16 KiB
Rust
use crate::ResponseError;
|
|
|
|
#[derive(Debug)]
|
|
pub enum PostError{
|
|
Reqwest(reqwest::Error),
|
|
CSRF,
|
|
}
|
|
impl std::fmt::Display for PostError{
|
|
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
|
write!(f,"{self:?}")
|
|
}
|
|
}
|
|
impl std::error::Error for PostError{}
|
|
|
|
#[derive(Debug,serde::Deserialize,serde::Serialize)]
|
|
#[allow(nonstandard_style,dead_code)]
|
|
pub struct CreateRequest{
|
|
pub name:String,
|
|
pub description:String,
|
|
pub ispublic:bool,
|
|
pub allowComments:bool,
|
|
pub groupId:Option<u64>,
|
|
}
|
|
#[derive(Debug)]
|
|
pub enum CreateError{
|
|
ParseError(url::ParseError),
|
|
PostError(PostError),
|
|
Response(ResponseError),
|
|
Reqwest(reqwest::Error),
|
|
ParseInt{
|
|
response:String,
|
|
err:std::num::ParseIntError,
|
|
},
|
|
}
|
|
impl std::fmt::Display for CreateError{
|
|
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
|
write!(f,"{self:?}")
|
|
}
|
|
}
|
|
impl std::error::Error for CreateError{}
|
|
|
|
#[allow(nonstandard_style,dead_code)]
|
|
pub struct UploadRequest{
|
|
pub assetid:u64,
|
|
pub name:Option<String>,
|
|
pub description:Option<String>,
|
|
pub ispublic:Option<bool>,
|
|
pub allowComments:Option<bool>,
|
|
pub groupId:Option<u64>,
|
|
}
|
|
#[derive(Debug)]
|
|
pub enum UploadError{
|
|
ParseError(url::ParseError),
|
|
PostError(PostError),
|
|
Reqwest(reqwest::Error),
|
|
Response(ResponseError),
|
|
AssetIdIsZero,
|
|
ParseInt{
|
|
response:String,
|
|
err:std::num::ParseIntError,
|
|
},
|
|
}
|
|
impl std::fmt::Display for UploadError{
|
|
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
|
write!(f,"{self:?}")
|
|
}
|
|
}
|
|
impl std::error::Error for UploadError{}
|
|
#[derive(Debug,serde::Deserialize,serde::Serialize)]
|
|
#[allow(nonstandard_style,dead_code)]
|
|
pub struct UploadResponse{
|
|
pub AssetId:u64,
|
|
}
|
|
|
|
#[allow(nonstandard_style,dead_code)]
|
|
pub struct GetAssetDetailsRequest{
|
|
pub asset_id:u64,
|
|
}
|
|
#[allow(nonstandard_style,dead_code)]
|
|
pub struct GetAssetRequest{
|
|
pub asset_id:u64,
|
|
pub version:Option<u64>,
|
|
}
|
|
#[derive(Debug)]
|
|
pub enum GetError{
|
|
ParseError(url::ParseError),
|
|
Response(ResponseError),
|
|
Reqwest(reqwest::Error),
|
|
IO(std::io::Error)
|
|
}
|
|
impl std::fmt::Display for GetError{
|
|
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
|
write!(f,"{self:?}")
|
|
}
|
|
}
|
|
impl std::error::Error for GetError{}
|
|
|
|
#[derive(Debug)]
|
|
pub enum GetAssetV2Error{
|
|
ParseError(url::ParseError),
|
|
Response(ResponseError),
|
|
VersionHeaderMissing,
|
|
ToStr(reqwest::header::ToStrError),
|
|
ParseInt(std::num::ParseIntError),
|
|
Reqwest(reqwest::Error),
|
|
}
|
|
impl std::fmt::Display for GetAssetV2Error{
|
|
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
|
write!(f,"{self:?}")
|
|
}
|
|
}
|
|
impl std::error::Error for GetAssetV2Error{}
|
|
|
|
#[derive(serde::Deserialize)]
|
|
#[allow(nonstandard_style,dead_code)]
|
|
pub struct GetAssetV2AssetMetadata{
|
|
pub metadataType:u32,
|
|
pub value:String,
|
|
}
|
|
#[derive(serde::Deserialize)]
|
|
#[allow(nonstandard_style,dead_code)]
|
|
pub struct GetAssetV2Location{
|
|
pub assetFormat:String,// "source"
|
|
location:String,// this value is private so users cannot mutate it
|
|
#[serde(default)]
|
|
pub assetMetadatas:Vec<GetAssetV2AssetMetadata>,
|
|
}
|
|
impl GetAssetV2Location{
|
|
pub fn location(&self)->&str{
|
|
&self.location
|
|
}
|
|
}
|
|
#[derive(serde::Deserialize)]
|
|
#[allow(nonstandard_style,dead_code)]
|
|
pub struct GetAssetV2Info{
|
|
pub locations:Vec<GetAssetV2Location>,
|
|
pub requestId:String,
|
|
pub IsHashDynamic:bool,
|
|
pub IsCopyrightProtected:bool,
|
|
pub isArchived:bool,
|
|
pub assetTypeId:u32,
|
|
}
|
|
|
|
pub struct GetAssetV2{
|
|
pub version:u64,
|
|
pub info:GetAssetV2Info,
|
|
}
|
|
|
|
#[derive(Clone,Copy,Debug,Eq,PartialEq,Hash)]
|
|
#[derive(serde::Deserialize,serde::Serialize)]
|
|
pub enum CreatorType{
|
|
User,
|
|
Group,
|
|
}
|
|
|
|
#[derive(Debug)]
|
|
#[derive(serde::Deserialize)]
|
|
#[allow(nonstandard_style,dead_code)]
|
|
pub struct Creator{
|
|
pub Id:u64,
|
|
pub Name:String,
|
|
pub CreatorType:CreatorType,
|
|
pub CreatorTargetId:u64,
|
|
pub HasVerifiedBadge:bool,
|
|
}
|
|
|
|
#[derive(Debug)]
|
|
#[derive(serde::Deserialize)]
|
|
#[allow(nonstandard_style,dead_code)]
|
|
pub struct AssetDetails{
|
|
pub TargetId:u64,
|
|
pub ProductType:Option<String>,
|
|
pub AssetId:u64,
|
|
pub ProductId:u64,
|
|
pub Name:String,
|
|
pub Description:String,
|
|
pub AssetTypeId:u32,
|
|
pub Creator:Creator,
|
|
pub IconImageAssetId:u64,
|
|
pub Created:chrono::DateTime<chrono::Utc>,
|
|
pub Updated:chrono::DateTime<chrono::Utc>,
|
|
pub PriceInRobux:Option<u32>,
|
|
pub PriceInTickets:Option<u32>,
|
|
pub Sales:u32,
|
|
pub IsNew:bool,
|
|
pub IsForSale:bool,
|
|
pub IsPublicDomain:bool,
|
|
pub IsLimited:bool,
|
|
pub IsLimitedUnique:bool,
|
|
pub Remaining:Option<u32>,
|
|
pub MinimumMembershipLevel:u32,
|
|
pub ContentRatingTypeId:u32,
|
|
pub SaleAvailabilityLocations:Option<String>,
|
|
pub SaleLocation:Option<String>,
|
|
pub CollectibleItemId:Option<u64>,
|
|
pub CollectibleProductId:Option<u64>,
|
|
pub CollectiblesItemDetails:Option<String>,
|
|
}
|
|
|
|
pub struct AssetVersionsPageRequest{
|
|
pub asset_id:u64,
|
|
pub cursor:Option<String>,
|
|
}
|
|
#[derive(serde::Deserialize,serde::Serialize)]
|
|
#[allow(nonstandard_style,dead_code)]
|
|
pub struct AssetVersion{
|
|
pub Id:u64,
|
|
pub assetId:u64,
|
|
pub assetVersionNumber:u64,
|
|
pub creatorType:CreatorType,
|
|
pub creatorTargetId:u64,
|
|
pub creatingUniverseId:Option<u64>,
|
|
pub created:chrono::DateTime<chrono::Utc>,
|
|
pub isPublished:bool,
|
|
}
|
|
#[derive(serde::Deserialize)]
|
|
#[allow(nonstandard_style,dead_code)]
|
|
pub struct AssetVersionsPageResponse{
|
|
pub previousPageCursor:Option<String>,
|
|
pub nextPageCursor:Option<String>,
|
|
pub data:Vec<AssetVersion>,
|
|
}
|
|
#[derive(Debug)]
|
|
pub enum PageError{
|
|
ParseError(url::ParseError),
|
|
Response(ResponseError),
|
|
Reqwest(reqwest::Error),
|
|
}
|
|
impl std::fmt::Display for PageError{
|
|
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
|
write!(f,"{self:?}")
|
|
}
|
|
}
|
|
impl std::error::Error for PageError{}
|
|
|
|
pub enum Owner{
|
|
User(u64),
|
|
Group(u64),
|
|
}
|
|
impl Owner{
|
|
fn get_url_info(&self)->(&str,u64){
|
|
match self{
|
|
&Owner::User(id)=>("user",id),
|
|
&Owner::Group(id)=>("group",id),
|
|
}
|
|
}
|
|
}
|
|
pub struct CreationsPageRequest{
|
|
pub owner:Owner,
|
|
pub cursor:Option<String>,
|
|
}
|
|
#[derive(serde::Deserialize,serde::Serialize)]
|
|
#[allow(nonstandard_style,dead_code)]
|
|
pub struct CreationsItem{
|
|
pub id:u64,
|
|
pub name:String,
|
|
}
|
|
#[derive(serde::Deserialize,serde::Serialize)]
|
|
#[allow(nonstandard_style,dead_code)]
|
|
pub struct CreationsPageResponse{
|
|
pub totalResults:u64,//up to 50
|
|
pub filteredKeyword:Option<String>,//""
|
|
pub searchDebugInfo:Option<String>,//null
|
|
pub spellCheckerResult:Option<String>,//null
|
|
pub queryFacets:Option<String>,//null
|
|
pub imageSearchStatus:Option<String>,//null
|
|
pub previousPageCursor:Option<String>,
|
|
pub nextPageCursor:Option<String>,
|
|
pub data:Vec<CreationsItem>,
|
|
}
|
|
|
|
pub struct UserInventoryPageRequest{
|
|
pub user_id:u64,
|
|
pub cursor:Option<String>,
|
|
}
|
|
|
|
#[derive(serde::Deserialize,serde::Serialize)]
|
|
#[allow(nonstandard_style,dead_code)]
|
|
pub struct UserInventoryItemOwner{
|
|
userId:u64,
|
|
username:String,
|
|
buildersClubMembershipType:u64,
|
|
}
|
|
#[derive(serde::Deserialize,serde::Serialize)]
|
|
#[allow(nonstandard_style,dead_code)]
|
|
pub struct UserInventoryItem{
|
|
userAssetId:u64,
|
|
assetId:u64,
|
|
assetName:String,
|
|
collectibleItemId:Option<String>,
|
|
collectibleItemInstanceId:Option<String>,
|
|
owner:UserInventoryItemOwner,
|
|
created:chrono::DateTime<chrono::Utc>,
|
|
updated:chrono::DateTime<chrono::Utc>,
|
|
}
|
|
#[derive(serde::Deserialize,serde::Serialize)]
|
|
#[allow(nonstandard_style,dead_code)]
|
|
pub struct UserInventoryPageResponse{
|
|
pub previousPageCursor:Option<String>,
|
|
pub nextPageCursor:Option<String>,
|
|
pub data:Vec<UserInventoryItem>,
|
|
}
|
|
|
|
//idk how to do this better
|
|
enum ReaderType<R:std::io::Read>{
|
|
GZip(flate2::read::GzDecoder<std::io::BufReader<R>>),
|
|
Raw(std::io::BufReader<R>),
|
|
}
|
|
fn maybe_gzip_decode<R:std::io::Read>(input:R)->std::io::Result<ReaderType<R>>{
|
|
let mut buf=std::io::BufReader::new(input);
|
|
let peek=std::io::BufRead::fill_buf(&mut buf)?;
|
|
match &peek[0..2]{
|
|
b"\x1f\x8b"=>Ok(ReaderType::GZip(flate2::read::GzDecoder::new(buf))),
|
|
_=>Ok(ReaderType::Raw(buf)),
|
|
}
|
|
}
|
|
fn read_readable(mut readable:impl std::io::Read)->std::io::Result<Vec<u8>>{
|
|
let mut contents=Vec::new();
|
|
readable.read_to_end(&mut contents)?;
|
|
Ok(contents)
|
|
}
|
|
|
|
#[derive(Clone)]
|
|
pub struct Cookie(String);
|
|
impl Cookie{
|
|
/// cookie is prepended with ".ROBLOSECURITY=" by this function
|
|
pub fn new(cookie:String)->Self{
|
|
Self(format!(".ROBLOSECURITY={cookie}"))
|
|
}
|
|
pub fn get(self)->String{
|
|
self.0
|
|
}
|
|
}
|
|
#[derive(Clone)]
|
|
pub struct CookieContext{
|
|
pub cookie:String,
|
|
pub client:reqwest::Client,
|
|
}
|
|
|
|
impl CookieContext{
|
|
pub fn new(cookie:Cookie)->Self{
|
|
Self{
|
|
cookie:cookie.get(),
|
|
client:reqwest::Client::new(),
|
|
}
|
|
}
|
|
async fn get(&self,url:impl reqwest::IntoUrl)->Result<reqwest::Response,reqwest::Error>{
|
|
self.client.get(url)
|
|
.header("Cookie",self.cookie.as_str())
|
|
.send().await
|
|
}
|
|
async fn post(&self,url:url::Url,body:impl Into<reqwest::Body>+Clone)->Result<reqwest::Response,PostError>{
|
|
let mut resp=self.client.post(url.clone())
|
|
.header("Cookie",self.cookie.as_str())
|
|
.body(body.clone())
|
|
.send().await.map_err(PostError::Reqwest)?;
|
|
|
|
//This is called a CSRF challenge apparently
|
|
if resp.status()==reqwest::StatusCode::FORBIDDEN{
|
|
if let Some(csrf_token)=resp.headers().get("X-CSRF-Token"){
|
|
resp=self.client.post(url)
|
|
.header("X-CSRF-Token",csrf_token)
|
|
.header("Cookie",self.cookie.as_str())
|
|
.body(body)
|
|
.send().await.map_err(PostError::Reqwest)?;
|
|
}else{
|
|
Err(PostError::CSRF)?;
|
|
}
|
|
}
|
|
|
|
Ok(resp)
|
|
}
|
|
pub async fn create(&self,config:CreateRequest,body:impl Into<reqwest::Body>+Clone)->Result<UploadResponse,CreateError>{
|
|
let mut url=reqwest::Url::parse("https://data.roblox.com/Data/Upload.ashx?json=1&type=Model&genreTypeId=1").map_err(CreateError::ParseError)?;
|
|
//url borrow scope
|
|
{
|
|
let mut query=url.query_pairs_mut();//borrow here
|
|
//archaic roblox api uses 0 for new asset
|
|
query.append_pair("assetid","0");
|
|
query.append_pair("name",config.name.as_str());
|
|
query.append_pair("description",config.description.as_str());
|
|
query.append_pair("ispublic",if config.ispublic{"True"}else{"False"});
|
|
query.append_pair("allowComments",if config.allowComments{"True"}else{"False"});
|
|
if let Some(group_id)=config.groupId{
|
|
query.append_pair("groupId",group_id.to_string().as_str());
|
|
}
|
|
}
|
|
let response=crate::response_ok(
|
|
self.post(url,body).await.map_err(CreateError::PostError)?
|
|
).await.map_err(CreateError::Response)?
|
|
.text().await.map_err(CreateError::Reqwest)?;
|
|
|
|
match response.parse(){
|
|
Ok(asset_id)=>Ok(UploadResponse{
|
|
AssetId:asset_id,
|
|
}),
|
|
Err(err)=>Err(CreateError::ParseInt{
|
|
response,
|
|
err,
|
|
})
|
|
}
|
|
}
|
|
pub async fn upload(&self,config:UploadRequest,body:impl Into<reqwest::Body>+Clone)->Result<UploadResponse,UploadError>{
|
|
let mut url=reqwest::Url::parse("https://data.roblox.com/Data/Upload.ashx?json=1&type=Model&genreTypeId=1").map_err(UploadError::ParseError)?;
|
|
//url borrow scope
|
|
{
|
|
let mut query=url.query_pairs_mut();//borrow here
|
|
//archaic roblox api uses 0 for new asset
|
|
match config.assetid{
|
|
0=>return Err(UploadError::AssetIdIsZero),
|
|
assetid=>{query.append_pair("assetid",assetid.to_string().as_str());},
|
|
}
|
|
if let Some(name)=config.name.as_deref(){
|
|
query.append_pair("name",name);
|
|
}
|
|
if let Some(description)=config.description.as_deref(){
|
|
query.append_pair("description",description);
|
|
}
|
|
if let Some(ispublic)=config.ispublic{
|
|
query.append_pair("ispublic",if ispublic{"True"}else{"False"});
|
|
}
|
|
if let Some(allow_comments)=config.allowComments{
|
|
query.append_pair("allowComments",if allow_comments{"True"}else{"False"});
|
|
}
|
|
if let Some(group_id)=config.groupId{
|
|
query.append_pair("groupId",group_id.to_string().as_str());
|
|
}
|
|
}
|
|
let response=crate::response_ok(
|
|
self.post(url,body).await.map_err(UploadError::PostError)?
|
|
).await.map_err(UploadError::Response)?
|
|
.text().await.map_err(UploadError::Reqwest)?;
|
|
|
|
match response.parse(){
|
|
Ok(asset_id)=>Ok(UploadResponse{
|
|
AssetId:asset_id,
|
|
}),
|
|
Err(err)=>Err(UploadError::ParseInt{
|
|
response,
|
|
err,
|
|
})
|
|
}
|
|
}
|
|
pub async fn get_asset(&self,config:GetAssetRequest)->Result<Vec<u8>,GetError>{
|
|
let mut url=reqwest::Url::parse("https://assetdelivery.roblox.com/v1/asset/").map_err(GetError::ParseError)?;
|
|
//url borrow scope
|
|
{
|
|
let mut query=url.query_pairs_mut();//borrow here
|
|
query.append_pair("ID",config.asset_id.to_string().as_str());
|
|
if let Some(version)=config.version{
|
|
query.append_pair("version",version.to_string().as_str());
|
|
}
|
|
}
|
|
let body=crate::response_ok(
|
|
self.get(url).await.map_err(GetError::Reqwest)?
|
|
).await.map_err(GetError::Response)?
|
|
.bytes().await.map_err(GetError::Reqwest)?;
|
|
|
|
match maybe_gzip_decode(std::io::Cursor::new(body)){
|
|
Ok(ReaderType::GZip(readable))=>read_readable(readable),
|
|
Ok(ReaderType::Raw(readable))=>read_readable(readable),
|
|
Err(e)=>Err(e),
|
|
}.map_err(GetError::IO)
|
|
}
|
|
pub async fn get_asset_v2(&self,config:GetAssetRequest)->Result<GetAssetV2,GetAssetV2Error>{
|
|
let mut url=reqwest::Url::parse("https://assetdelivery.roblox.com/v2/asset").map_err(GetAssetV2Error::ParseError)?;
|
|
//url borrow scope
|
|
{
|
|
let mut query=url.query_pairs_mut();//borrow here
|
|
query.append_pair("ID",config.asset_id.to_string().as_str());
|
|
if let Some(version)=config.version{
|
|
query.append_pair("version",version.to_string().as_str());
|
|
}
|
|
}
|
|
let response=crate::response_ok(
|
|
self.get(url).await.map_err(GetAssetV2Error::Reqwest)?
|
|
).await.map_err(GetAssetV2Error::Response)?;
|
|
|
|
let version=response
|
|
.headers()
|
|
.get("roblox-assetversionnumber")
|
|
.ok_or(GetAssetV2Error::VersionHeaderMissing)?
|
|
.to_str()
|
|
.map_err(GetAssetV2Error::ToStr)?
|
|
.parse()
|
|
.map_err(GetAssetV2Error::ParseInt)?;
|
|
|
|
let info=response.json().await.map_err(GetAssetV2Error::Reqwest)?;
|
|
|
|
Ok(GetAssetV2{
|
|
version,
|
|
info,
|
|
})
|
|
}
|
|
pub async fn get_asset_v2_download(&self,config:&GetAssetV2Location)->Result<Vec<u8>,GetError>{
|
|
let url=reqwest::Url::parse(config.location.as_str()).map_err(GetError::ParseError)?;
|
|
|
|
let body=crate::response_ok(
|
|
self.get(url).await.map_err(GetError::Reqwest)?
|
|
).await.map_err(GetError::Response)?
|
|
.bytes().await.map_err(GetError::Reqwest)?;
|
|
|
|
match maybe_gzip_decode(std::io::Cursor::new(body)){
|
|
Ok(ReaderType::GZip(readable))=>read_readable(readable),
|
|
Ok(ReaderType::Raw(readable))=>read_readable(readable),
|
|
Err(e)=>Err(e),
|
|
}.map_err(GetError::IO)
|
|
}
|
|
pub async fn get_asset_details(&self,config:GetAssetDetailsRequest)->Result<AssetDetails,GetError>{
|
|
let url=reqwest::Url::parse(format!("https://economy.roblox.com/v2/assets/{}/details",config.asset_id).as_str()).map_err(GetError::ParseError)?;
|
|
crate::response_ok(
|
|
self.get(url).await.map_err(GetError::Reqwest)?
|
|
).await.map_err(GetError::Response)?
|
|
.json().await.map_err(GetError::Reqwest)
|
|
}
|
|
pub async fn get_asset_versions_page(&self,config:AssetVersionsPageRequest)->Result<AssetVersionsPageResponse,PageError>{
|
|
let mut url=reqwest::Url::parse(format!("https://develop.roblox.com/v1/assets/{}/saved-versions",config.asset_id).as_str()).map_err(PageError::ParseError)?;
|
|
//url borrow scope
|
|
{
|
|
let mut query=url.query_pairs_mut();//borrow here
|
|
//query.append_pair("sortOrder","Asc");
|
|
//query.append_pair("limit","100");
|
|
//query.append_pair("count","100");
|
|
if let Some(cursor)=config.cursor.as_deref(){
|
|
query.append_pair("cursor",cursor);
|
|
}
|
|
}
|
|
crate::response_ok(
|
|
self.get(url).await.map_err(PageError::Reqwest)?
|
|
).await.map_err(PageError::Response)?
|
|
.json::<AssetVersionsPageResponse>().await.map_err(PageError::Reqwest)
|
|
}
|
|
pub async fn get_creations_page(&self,config:&CreationsPageRequest)->Result<CreationsPageResponse,PageError>{
|
|
let (owner,id)=config.owner.get_url_info();
|
|
let mut url=reqwest::Url::parse(format!("https://apis.roblox.com/toolbox-service/v1/creations/{}/{}/10?limit=50",owner,id).as_str()).map_err(PageError::ParseError)?;
|
|
//url borrow scope
|
|
{
|
|
let mut query=url.query_pairs_mut();//borrow here
|
|
if let Some(cursor)=config.cursor.as_deref(){
|
|
query.append_pair("cursor",cursor);
|
|
}
|
|
}
|
|
crate::response_ok(
|
|
self.get(url).await.map_err(PageError::Reqwest)?
|
|
).await.map_err(PageError::Response)?
|
|
.json::<CreationsPageResponse>().await.map_err(PageError::Reqwest)
|
|
}
|
|
pub async fn get_user_inventory_page(&self,config:&UserInventoryPageRequest)->Result<UserInventoryPageResponse,PageError>{
|
|
let mut url=reqwest::Url::parse(format!("https://inventory.roblox.com/v2/users/{}/inventory/10?limit=100&sortOrder=Desc",config.user_id).as_str()).map_err(PageError::ParseError)?;
|
|
//url borrow scope
|
|
{
|
|
let mut query=url.query_pairs_mut();//borrow here
|
|
if let Some(cursor)=config.cursor.as_deref(){
|
|
query.append_pair("cursor",cursor);
|
|
}
|
|
}
|
|
crate::response_ok(
|
|
self.get(url).await.map_err(PageError::Reqwest)?
|
|
).await.map_err(PageError::Response)?
|
|
.json::<UserInventoryPageResponse>().await.map_err(PageError::Reqwest)
|
|
}
|
|
}
|