Compare commits

..

No commits in common. "3e585d75599cb7b8f6b5b43bd3c156d3dbb206a7" and "485c2ea176aa6910736c846d330490dc0784ebc5" have entirely different histories.

5 changed files with 84 additions and 341 deletions

4
Cargo.lock generated
View file

@ -2294,7 +2294,7 @@ dependencies = [
[[package]]
name = "torn-api"
version = "1.7.1"
version = "1.7.0"
dependencies = [
"bon",
"bytes",
@ -2316,7 +2316,7 @@ dependencies = [
[[package]]
name = "torn-api-codegen"
version = "0.7.1"
version = "0.7.0"
dependencies = [
"heck",
"indexmap",

View file

@ -1,7 +1,7 @@
[package]
name = "torn-api-codegen"
authors = ["Pyrit [2111649]"]
version = "0.7.1"
version = "0.7.0"
edition = "2021"
description = "Contains the v2 torn API model descriptions and codegen for the bindings"
license-file = { workspace = true }

View file

@ -273,60 +273,7 @@ impl Property {
let name = &self.name;
let (name, serde_attr) = match name.as_str() {
// https://doc.rust-lang.org/reference/keywords.html#r-lex.keywords
"as" => (format_ident!("r#as"), None),
"break" => (format_ident!("r#break"), None),
"const" => (format_ident!("r#const"), None),
"continue" => (format_ident!("r#continue"), None),
"crate" => (format_ident!("r#crate"), None),
"else" => (format_ident!("r#else"), None),
"enum" => (format_ident!("r#enum"), None),
"extern" => (format_ident!("r#extern"), None),
"false" => (format_ident!("r#false"), None),
"fn" => (format_ident!("r#fn"), None),
"for" => (format_ident!("r#for"), None),
"if" => (format_ident!("r#if"), None),
"impl" => (format_ident!("r#impl"), None),
"in" => (format_ident!("r#in"), None),
"let" => (format_ident!("r#let"), None),
"loop" => (format_ident!("r#loop"), None),
"match" => (format_ident!("r#match"), None),
"mod" => (format_ident!("r#mod"), None),
"move" => (format_ident!("r#move"), None),
"mut" => (format_ident!("r#mut"), None),
"pub" => (format_ident!("r#pub"), None),
"ref" => (format_ident!("r#ref"), None),
"return" => (format_ident!("r#return"), None),
"self" => (format_ident!("r#self"), None),
"Self" => (format_ident!("r#Self"), None),
"static" => (format_ident!("r#static"), None),
"struct" => (format_ident!("r#struct"), None),
"super" => (format_ident!("r#super"), None),
"trait" => (format_ident!("r#trait"), None),
"true" => (format_ident!("r#true"), None),
"type" => (format_ident!("r#type"), None),
"unsafe" => (format_ident!("r#unsafe"), None),
"use" => (format_ident!("r#use"), None),
"where" => (format_ident!("r#where"), None),
"while" => (format_ident!("r#while"), None),
"async" => (format_ident!("r#async"), None),
"await" => (format_ident!("r#await"), None),
"dyn" => (format_ident!("r#dyn"), None),
"abstract" => (format_ident!("r#abstract"), None),
"become" => (format_ident!("r#become"), None),
"box" => (format_ident!("r#box"), None),
"do" => (format_ident!("r#do"), None),
"final" => (format_ident!("r#final"), None),
"macro" => (format_ident!("r#macro"), None),
"override" => (format_ident!("r#override"), None),
"priv" => (format_ident!("r#priv"), None),
"typeof" => (format_ident!("r#typeof"), None),
"unsized" => (format_ident!("r#unsized"), None),
"virtual" => (format_ident!("r#virtual"), None),
"yield" => (format_ident!("r#yield"), None),
"try" => (format_ident!("r#try"), None),
"gen" => (format_ident!("r#gen"), None),
name if name != self.field_name => (
format_ident!("{}", self.field_name),
Some(quote! { #[serde(rename = #name)]}),

View file

@ -1,6 +1,6 @@
[package]
name = "torn-api"
version = "1.7.1"
version = "1.7.0"
edition = "2021"
description = "Auto-generated bindings for the v2 torn api"
license-file = { workspace = true }

View file

@ -3,7 +3,7 @@
"info": {
"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.",
"version": "2.0.2"
"version": "1.11.4"
},
"servers": [
{
@ -2953,7 +2953,7 @@
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/FactionRacketsResponse"
"$ref": "#/components/schemas/FactionRacketsReponse"
}
}
}
@ -3551,7 +3551,7 @@
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/FactionTerritoriesResponse"
"$ref": "#/components/schemas/FactionTerritoriesReponse"
}
}
}
@ -3599,7 +3599,7 @@
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/FactionTerritoriesResponse"
"$ref": "#/components/schemas/FactionTerritoriesReponse"
}
}
}
@ -4304,7 +4304,7 @@
"$ref": "#/components/schemas/FactionTerritoryWarReportResponse"
},
{
"$ref": "#/components/schemas/FactionTerritoriesResponse"
"$ref": "#/components/schemas/FactionTerritoriesReponse"
},
{
"$ref": "#/components/schemas/FactionUpgradesResponse"
@ -4319,7 +4319,7 @@
"$ref": "#/components/schemas/FactionContributorsResponse"
},
{
"$ref": "#/components/schemas/FactionRacketsResponse"
"$ref": "#/components/schemas/FactionRacketsReponse"
},
{
"$ref": "#/components/schemas/FactionRankedWarResponse"
@ -6773,45 +6773,6 @@
"x-stability": "Stable"
}
},
"/torn/organizedcrimes": {
"get": {
"tags": [
"Torn"
],
"summary": "Get organized crimes information",
"description": "Requires public access key. <br> Return the details about released faction organized crimes.",
"operationId": "b64b8cf22cd9e9c8916bc01439f6b069",
"parameters": [
{
"$ref": "#/components/parameters/ApiTimestamp"
},
{
"$ref": "#/components/parameters/ApiComment"
},
{
"$ref": "#/components/parameters/ApiKeyPublic"
}
],
"responses": {
"200": {
"description": "Successful operation",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/TornOrganizedCrimeResponse"
}
}
}
}
},
"security": [
{
"api_key": []
}
],
"x-stability": "Unstable"
}
},
"/torn/properties": {
"get": {
"tags": [
@ -7187,7 +7148,7 @@
"$ref": "#/components/schemas/TornTerritoriesResponse"
},
{
"$ref": "#/components/schemas/TornTerritoriesNoLinksResponse"
"$ref": "#/components/schemas/TornTerritoriesNoLinksReponse"
},
{
"$ref": "#/components/schemas/TornItemModsResponse"
@ -11890,9 +11851,6 @@
"type": "integer",
"format": "int32"
},
"OrganizedCrimeName": {
"type": "string"
},
"PropertyTypeId": {
"type": "integer",
"format": "int32"
@ -13685,8 +13643,7 @@
],
"properties": {
"properties": {
"type": "array",
"items": {
"type": "object",
"oneOf": [
{
"$ref": "#/components/schemas/UserPropertyBasicDetails"
@ -13704,7 +13661,6 @@
"$ref": "#/components/schemas/UserPropertyDetailsExtendedForSale"
}
]
}
},
"_metadata": {
"$ref": "#/components/schemas/RequestMetadataWithLinks"
@ -14494,7 +14450,7 @@
"races": {
"type": "array",
"items": {
"$ref": "#/components/schemas/RacingRaceDetails"
"$ref": "#/components/schemas/RacingRaceDetailsResponse"
}
},
"_metadata": {
@ -19030,10 +18986,10 @@
},
"FactionTerritoriesOwnershipResponse": {
"required": [
"territoryOwnership"
"territoryownership"
],
"properties": {
"territoryOwnership": {
"territoryownership": {
"type": "array",
"items": {
"$ref": "#/components/schemas/FactionTerritoryOwnership"
@ -19103,7 +19059,7 @@
},
"type": "object"
},
"FactionRacketsResponse": {
"FactionRacketsReponse": {
"required": [
"rackets"
],
@ -19173,7 +19129,7 @@
},
"type": "object"
},
"FactionTerritoriesResponse": {
"FactionTerritoriesReponse": {
"required": [
"territory"
],
@ -20119,8 +20075,6 @@
"format": "int32"
},
"stats": {
"oneOf": [
{
"required": [
"strength",
"speed",
@ -20146,25 +20100,13 @@
}
},
"type": "object"
},
{
"type": "null"
}
]
}
},
"type": "object"
},
"message": {
"oneOf": [
{
"type": "string"
},
{
"type": "null"
}
]
},
"valid_until": {
"type": "integer",
"format": "int32"
@ -20810,7 +20752,7 @@
]
},
"name": {
"$ref": "#/components/schemas/OrganizedCrimeName"
"type": "string"
},
"difficulty": {
"type": "integer",
@ -23276,7 +23218,9 @@
},
"type": "object"
},
"RacingRaceDetails": {
"RacingRaceDetailsResponse": {
"properties": {
"race": {
"allOf": [
{
"$ref": "#/components/schemas/Race"
@ -23300,14 +23244,6 @@
"type": "object"
}
]
},
"RacingRaceDetailsResponse": {
"required": [
"race"
],
"properties": {
"race": {
"$ref": "#/components/schemas/RacingRaceDetails"
}
},
"type": "object"
@ -23375,144 +23311,6 @@
},
"type": "object"
},
"TornOrganizedCrimeResponse": {
"required": [
"organizedcrimes"
],
"properties": {
"organizedcrimes": {
"type": "array",
"items": {
"$ref": "#/components/schemas/TornOrganizedCrime"
}
}
},
"type": "object"
},
"TornOrganizedCrime": {
"required": [
"name",
"description",
"difficulty",
"spawn",
"scope",
"slots",
"prerequisite"
],
"properties": {
"name": {
"$ref": "#/components/schemas/OrganizedCrimeName"
},
"description": {
"type": "string"
},
"difficulty": {
"type": "integer",
"format": "int32"
},
"spawn": {
"$ref": "#/components/schemas/TornOrganizedCrimeSpawn"
},
"scope": {
"$ref": "#/components/schemas/TornOrganizedCrimeScope"
},
"prerequisite": {
"oneOf": [
{
"$ref": "#/components/schemas/OrganizedCrimeName"
},
{
"type": "null"
}
]
},
"slots": {
"type": "array",
"items": {
"$ref": "#/components/schemas/TornOrganizedCrimeSlot"
}
}
},
"type": "object"
},
"TornOrganizedCrimeSpawn": {
"required": [
"level",
"name"
],
"properties": {
"level": {
"type": "integer",
"format": "int32"
},
"name": {
"type": "string"
}
},
"type": "object"
},
"TornOrganizedCrimeScope": {
"required": [
"cost",
"return"
],
"properties": {
"cost": {
"type": "integer",
"format": "int32"
},
"return": {
"type": "integer",
"format": "int32"
}
},
"type": "object"
},
"TornOrganizedCrimeSlot": {
"required": [
"id",
"name",
"required_item"
],
"properties": {
"id": {
"type": "string"
},
"name": {
"type": "string"
},
"required_item": {
"oneOf": [
{
"$ref": "#/components/schemas/TornOrganizedCrimeRequiredItem"
},
{
"type": "null"
}
]
}
},
"type": "object"
},
"TornOrganizedCrimeRequiredItem": {
"required": [
"id",
"name",
"is_used"
],
"properties": {
"id": {
"$ref": "#/components/schemas/ItemId"
},
"name": {
"type": "string"
},
"is_used": {
"type": "boolean"
}
},
"type": "object"
},
"TornProperties": {
"properties": {
"properties": {
@ -23813,7 +23611,7 @@
},
"type": "object"
},
"TornTerritoriesNoLinksResponse": {
"TornTerritoriesNoLinksReponse": {
"required": [
"territory"
],
@ -23870,8 +23668,7 @@
"enhancer_id",
"enhancer_name",
"unique_outcomes_count",
"unique_outcomes_ids",
"notes"
"unique_outcomes_ids"
],
"properties": {
"id": {
@ -25016,7 +24813,6 @@
"logcategories",
"logtypes",
"lookup",
"organizedcrimes",
"properties",
"subcrimes",
"territory",