chore(torn-api): update schema
This commit is contained in:
parent
1c9b4123c3
commit
a90bcb00c4
2
Cargo.lock
generated
2
Cargo.lock
generated
|
@ -2294,7 +2294,7 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "torn-api"
|
name = "torn-api"
|
||||||
version = "1.6.5"
|
version = "1.6.6"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bon",
|
"bon",
|
||||||
"bytes",
|
"bytes",
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
[package]
|
[package]
|
||||||
name = "torn-api"
|
name = "torn-api"
|
||||||
version = "1.6.5"
|
version = "1.6.6"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
description = "Auto-generated bindings for the v2 torn api"
|
description = "Auto-generated bindings for the v2 torn api"
|
||||||
license-file = { workspace = true }
|
license-file = { workspace = true }
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
"info": {
|
"info": {
|
||||||
"title": "Torn API",
|
"title": "Torn API",
|
||||||
"description": "\n * The development of Torn's API v2 is still ongoing.\n * If selections remain unaltered, they will default to the API v1 version.\n * Unlike API v1, API v2 accepts both selections and IDs as path and query parameters.\n * If any discrepancies or errors are found, please submit a [bug report](https://www.torn.com/forums.php#/p=forums&f=19&b=0&a=0) on the Torn Forums.\n * In case you're using bots to check for changes on openapi.json file, make sure to specificy a custom user-agent header - CloudFlare sometimes prevents requests from default user-agents.",
|
"description": "\n * The development of Torn's API v2 is still ongoing.\n * If selections remain unaltered, they will default to the API v1 version.\n * Unlike API v1, API v2 accepts both selections and IDs as path and query parameters.\n * If any discrepancies or errors are found, please submit a [bug report](https://www.torn.com/forums.php#/p=forums&f=19&b=0&a=0) on the Torn Forums.\n * In case you're using bots to check for changes on openapi.json file, make sure to specificy a custom user-agent header - CloudFlare sometimes prevents requests from default user-agents.",
|
||||||
"version": "1.8.0"
|
"version": "1.8.3"
|
||||||
},
|
},
|
||||||
"servers": [
|
"servers": [
|
||||||
{
|
{
|
||||||
|
@ -5910,55 +5910,10 @@
|
||||||
"operationId": "37f1828422f3080da21f9eb4aa576686",
|
"operationId": "37f1828422f3080da21f9eb4aa576686",
|
||||||
"parameters": [
|
"parameters": [
|
||||||
{
|
{
|
||||||
"$ref": "#/components/parameters/ApiOffset"
|
"name": "ids",
|
||||||
},
|
"in": "query",
|
||||||
{
|
"description": "Specific territory id or a list of territory ids (comma separated)",
|
||||||
"$ref": "#/components/parameters/ApiLimit250Default20"
|
"required": false,
|
||||||
},
|
|
||||||
{
|
|
||||||
"$ref": "#/components/parameters/ApiTimestamp"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"$ref": "#/components/parameters/ApiComment"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"$ref": "#/components/parameters/ApiKeyPublic"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"responses": {
|
|
||||||
"200": {
|
|
||||||
"description": "Successful operation",
|
|
||||||
"content": {
|
|
||||||
"application/json": {
|
|
||||||
"schema": {
|
|
||||||
"$ref": "#/components/schemas/TornTerritoriesResponse"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"security": [
|
|
||||||
{
|
|
||||||
"api_key": []
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"x-stability": "Unstable"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"/torn/{territoryIds}/territory": {
|
|
||||||
"get": {
|
|
||||||
"tags": [
|
|
||||||
"Torn"
|
|
||||||
],
|
|
||||||
"summary": "Get territory details",
|
|
||||||
"description": "Requires public access key. <br>",
|
|
||||||
"operationId": "4e528387ddb78befed57cb4c84151399",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "territoryIds",
|
|
||||||
"in": "path",
|
|
||||||
"description": "Territory id or a list of territory ids (comma separated)",
|
|
||||||
"required": true,
|
|
||||||
"style": "form",
|
"style": "form",
|
||||||
"explode": false,
|
"explode": false,
|
||||||
"schema": {
|
"schema": {
|
||||||
|
@ -5968,6 +5923,12 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"$ref": "#/components/parameters/ApiOffset"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"$ref": "#/components/parameters/ApiLimit250Default20"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"$ref": "#/components/parameters/ApiTimestamp"
|
"$ref": "#/components/parameters/ApiTimestamp"
|
||||||
},
|
},
|
||||||
|
@ -11078,7 +11039,6 @@
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"Parameters": {
|
"Parameters": {
|
||||||
"type": "string",
|
|
||||||
"oneOf": [
|
"oneOf": [
|
||||||
{
|
{
|
||||||
"type": "string",
|
"type": "string",
|
||||||
|
@ -13928,7 +13888,8 @@
|
||||||
"awards",
|
"awards",
|
||||||
"merits_bought",
|
"merits_bought",
|
||||||
"refills",
|
"refills",
|
||||||
"donator_days"
|
"donator_days",
|
||||||
|
"ranked_war_wins"
|
||||||
],
|
],
|
||||||
"properties": {
|
"properties": {
|
||||||
"activity": {
|
"activity": {
|
||||||
|
@ -13990,6 +13951,10 @@
|
||||||
"donator_days": {
|
"donator_days": {
|
||||||
"type": "integer",
|
"type": "integer",
|
||||||
"format": "int32"
|
"format": "int32"
|
||||||
|
},
|
||||||
|
"ranked_war_wins": {
|
||||||
|
"type": "integer",
|
||||||
|
"format": "int32"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"type": "object"
|
"type": "object"
|
||||||
|
@ -14966,20 +14931,13 @@
|
||||||
"properties": {
|
"properties": {
|
||||||
"crimes": {
|
"crimes": {
|
||||||
"required": [
|
"required": [
|
||||||
|
"total",
|
||||||
"version"
|
"version"
|
||||||
],
|
],
|
||||||
"properties": {
|
"properties": {
|
||||||
"offenses": {
|
"total": {
|
||||||
"type": "object",
|
"type": "integer",
|
||||||
"required": [
|
"format": "int32"
|
||||||
"total"
|
|
||||||
],
|
|
||||||
"properties": {
|
|
||||||
"total": {
|
|
||||||
"type": "integer",
|
|
||||||
"format": "int32"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
"version": {
|
"version": {
|
||||||
"type": "string"
|
"type": "string"
|
||||||
|
@ -20407,7 +20365,7 @@
|
||||||
"required": [
|
"required": [
|
||||||
"item",
|
"item",
|
||||||
"listings",
|
"listings",
|
||||||
"timestamp"
|
"cache_timestamp"
|
||||||
],
|
],
|
||||||
"properties": {
|
"properties": {
|
||||||
"item": {
|
"item": {
|
||||||
|
@ -21897,6 +21855,22 @@
|
||||||
"type": "null"
|
"type": "null"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
},
|
||||||
|
"attacker_item": {
|
||||||
|
"description": "This field only exists if the attacker is stealthed and they used a temporary item.",
|
||||||
|
"required": [
|
||||||
|
"id",
|
||||||
|
"name"
|
||||||
|
],
|
||||||
|
"properties": {
|
||||||
|
"id": {
|
||||||
|
"$ref": "#/components/schemas/ItemId"
|
||||||
|
},
|
||||||
|
"name": {
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"type": "object"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"type": "object"
|
"type": "object"
|
||||||
|
@ -22554,7 +22528,6 @@
|
||||||
"type": "array",
|
"type": "array",
|
||||||
"items": {
|
"items": {
|
||||||
"schema": "Parameters",
|
"schema": "Parameters",
|
||||||
"type": "string",
|
|
||||||
"oneOf": [
|
"oneOf": [
|
||||||
{
|
{
|
||||||
"type": "string",
|
"type": "string",
|
||||||
|
|
|
@ -11,7 +11,7 @@ pub(super) mod test {
|
||||||
models::{
|
models::{
|
||||||
faction_selection_name::FactionSelectionNameVariant,
|
faction_selection_name::FactionSelectionNameVariant,
|
||||||
user_selection_name::UserSelectionNameVariant, AttackCode, PersonalStatsCategoryEnum,
|
user_selection_name::UserSelectionNameVariant, AttackCode, PersonalStatsCategoryEnum,
|
||||||
PersonalStatsStatName, UserListEnum, UserPersonalStatsPopular,
|
PersonalStatsStatName, UserListEnum,
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -919,6 +919,7 @@ pub(super) mod test {
|
||||||
.unwrap();
|
.unwrap();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[cfg(feature = "strum")]
|
||||||
#[tokio::test]
|
#[tokio::test]
|
||||||
async fn user_personalstats_popular() {
|
async fn user_personalstats_popular() {
|
||||||
let client = test_client().await;
|
let client = test_client().await;
|
||||||
|
@ -938,6 +939,141 @@ pub(super) mod test {
|
||||||
.is_user_personal_stats_popular());
|
.is_user_personal_stats_popular());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[cfg(feature = "strum")]
|
||||||
|
#[tokio::test]
|
||||||
|
async fn user_personalstats_all() {
|
||||||
|
let client = test_client().await;
|
||||||
|
|
||||||
|
let resp = client
|
||||||
|
.user()
|
||||||
|
.for_selections(|b| {
|
||||||
|
b.selections([UserSelectionNameVariant::Personalstats])
|
||||||
|
.cat(PersonalStatsCategoryEnum::All)
|
||||||
|
})
|
||||||
|
.await
|
||||||
|
.unwrap();
|
||||||
|
|
||||||
|
assert!(resp
|
||||||
|
.user_personal_stats_response()
|
||||||
|
.unwrap()
|
||||||
|
.is_user_personal_stats_full());
|
||||||
|
}
|
||||||
|
|
||||||
|
#[cfg(feature = "strum")]
|
||||||
|
#[tokio::test]
|
||||||
|
async fn user_personalstats_cat_attacking() {
|
||||||
|
let client = test_client().await;
|
||||||
|
|
||||||
|
let resp = client
|
||||||
|
.user()
|
||||||
|
.for_selections(|b| {
|
||||||
|
b.selections([UserSelectionNameVariant::Personalstats])
|
||||||
|
.cat(PersonalStatsCategoryEnum::Attacking)
|
||||||
|
})
|
||||||
|
.await
|
||||||
|
.unwrap();
|
||||||
|
|
||||||
|
assert!(resp
|
||||||
|
.user_personal_stats_response()
|
||||||
|
.unwrap()
|
||||||
|
.try_as_user_personal_stats_category()
|
||||||
|
.unwrap()
|
||||||
|
.personalstats
|
||||||
|
.is_personal_stats_attacking_public());
|
||||||
|
}
|
||||||
|
|
||||||
|
#[cfg(feature = "strum")]
|
||||||
|
#[tokio::test]
|
||||||
|
async fn user_personalstats_cat_jobs() {
|
||||||
|
let client = test_client().await;
|
||||||
|
|
||||||
|
let resp = client
|
||||||
|
.user()
|
||||||
|
.for_selections(|b| {
|
||||||
|
b.selections([UserSelectionNameVariant::Personalstats])
|
||||||
|
.cat(PersonalStatsCategoryEnum::Jobs)
|
||||||
|
})
|
||||||
|
.await
|
||||||
|
.unwrap();
|
||||||
|
|
||||||
|
assert!(resp
|
||||||
|
.user_personal_stats_response()
|
||||||
|
.unwrap()
|
||||||
|
.try_as_user_personal_stats_category()
|
||||||
|
.unwrap()
|
||||||
|
.personalstats
|
||||||
|
.is_personal_stats_jobs_public());
|
||||||
|
}
|
||||||
|
|
||||||
|
#[cfg(feature = "strum")]
|
||||||
|
#[tokio::test]
|
||||||
|
async fn user_personalstats_cat_trading() {
|
||||||
|
let client = test_client().await;
|
||||||
|
|
||||||
|
let resp = client
|
||||||
|
.user()
|
||||||
|
.for_selections(|b| {
|
||||||
|
b.selections([UserSelectionNameVariant::Personalstats])
|
||||||
|
.cat(PersonalStatsCategoryEnum::Trading)
|
||||||
|
})
|
||||||
|
.await
|
||||||
|
.unwrap();
|
||||||
|
|
||||||
|
assert!(resp
|
||||||
|
.user_personal_stats_response()
|
||||||
|
.unwrap()
|
||||||
|
.try_as_user_personal_stats_category()
|
||||||
|
.unwrap()
|
||||||
|
.personalstats
|
||||||
|
.is_personal_stats_trading());
|
||||||
|
}
|
||||||
|
|
||||||
|
#[cfg(feature = "strum")]
|
||||||
|
#[tokio::test]
|
||||||
|
async fn user_personalstats_cat_jail() {
|
||||||
|
let client = test_client().await;
|
||||||
|
|
||||||
|
let resp = client
|
||||||
|
.user()
|
||||||
|
.for_selections(|b| {
|
||||||
|
b.selections([UserSelectionNameVariant::Personalstats])
|
||||||
|
.cat(PersonalStatsCategoryEnum::Jail)
|
||||||
|
})
|
||||||
|
.await
|
||||||
|
.unwrap();
|
||||||
|
|
||||||
|
assert!(resp
|
||||||
|
.user_personal_stats_response()
|
||||||
|
.unwrap()
|
||||||
|
.try_as_user_personal_stats_category()
|
||||||
|
.unwrap()
|
||||||
|
.personalstats
|
||||||
|
.is_personal_stats_jail());
|
||||||
|
}
|
||||||
|
|
||||||
|
#[cfg(feature = "strum")]
|
||||||
|
#[tokio::test]
|
||||||
|
async fn user_personalstats_cat_hospital() {
|
||||||
|
let client = test_client().await;
|
||||||
|
|
||||||
|
let resp = client
|
||||||
|
.user()
|
||||||
|
.for_selections(|b| {
|
||||||
|
b.selections([UserSelectionNameVariant::Personalstats])
|
||||||
|
.cat(PersonalStatsCategoryEnum::Hospital)
|
||||||
|
})
|
||||||
|
.await
|
||||||
|
.unwrap();
|
||||||
|
|
||||||
|
assert!(resp
|
||||||
|
.user_personal_stats_response()
|
||||||
|
.unwrap()
|
||||||
|
.try_as_user_personal_stats_category()
|
||||||
|
.unwrap()
|
||||||
|
.personalstats
|
||||||
|
.is_personal_stats_hospital());
|
||||||
|
}
|
||||||
|
|
||||||
#[tokio::test]
|
#[tokio::test]
|
||||||
async fn user_personalstats_for_id() {
|
async fn user_personalstats_for_id() {
|
||||||
let client = test_client().await;
|
let client = test_client().await;
|
||||||
|
|
Loading…
Reference in a new issue