From bd27916aa51e21cd4d0290df9e17eabd61c301a0 Mon Sep 17 00:00:00 2001 From: pyrite Date: Wed, 28 May 2025 10:20:55 +0200 Subject: [PATCH] chore: update schema and release versions --- Cargo.lock | 4 +- torn-api-codegen/Cargo.toml | 2 +- torn-api-codegen/src/model/enum.rs | 1 + torn-api/Cargo.toml | 4 +- torn-api/openapi.json | 152 ++++++++++++++++++++++++++--- 5 files changed, 143 insertions(+), 20 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index c7c0243..06a011d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2294,7 +2294,7 @@ dependencies = [ [[package]] name = "torn-api" -version = "1.6.1" +version = "1.6.2" dependencies = [ "bon", "bytes", @@ -2316,7 +2316,7 @@ dependencies = [ [[package]] name = "torn-api-codegen" -version = "0.6.1" +version = "0.6.2" dependencies = [ "heck", "indexmap", diff --git a/torn-api-codegen/Cargo.toml b/torn-api-codegen/Cargo.toml index 8d57044..da49172 100644 --- a/torn-api-codegen/Cargo.toml +++ b/torn-api-codegen/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "torn-api-codegen" authors = ["Pyrit [2111649]"] -version = "0.6.1" +version = "0.6.2" edition = "2021" description = "Contains the v2 torn API model descriptions and codegen for the bindings" license-file = { workspace = true } diff --git a/torn-api-codegen/src/model/enum.rs b/torn-api-codegen/src/model/enum.rs index 4ba292f..4920c03 100644 --- a/torn-api-codegen/src/model/enum.rs +++ b/torn-api-codegen/src/model/enum.rs @@ -429,6 +429,7 @@ impl Enum { }); } + // HACK: idk let shared: Vec<_> = result .variants .iter_mut() diff --git a/torn-api/Cargo.toml b/torn-api/Cargo.toml index 9e10e3d..c0d31ee 100644 --- a/torn-api/Cargo.toml +++ b/torn-api/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "torn-api" -version = "1.6.1" +version = "1.6.2" edition = "2021" description = "Auto-generated bindings for the v2 torn api" license-file = { workspace = true } @@ -39,7 +39,7 @@ strum = { version = "0.27.1", features = ["derive"], optional = true } tokio = { version = "1", features = ["full"] } [build-dependencies] -torn-api-codegen = { path = "../torn-api-codegen", version = "0.6.0" } +torn-api-codegen = { path = "../torn-api-codegen", version = "0.6.2" } syn = { workspace = true, features = ["parsing"] } proc-macro2 = { workspace = true } prettyplease = "0.2" diff --git a/torn-api/openapi.json b/torn-api/openapi.json index bee9fe7..e01f22b 100644 --- a/torn-api/openapi.json +++ b/torn-api/openapi.json @@ -3059,6 +3059,12 @@ { "$ref": "#/components/parameters/ApiFactionSearchFilter" }, + { + "$ref": "#/components/parameters/ApiLimit20" + }, + { + "$ref": "#/components/parameters/ApiOffset" + }, { "$ref": "#/components/parameters/ApiTimestamp" }, @@ -3647,7 +3653,23 @@ "description": "selection id", "required": false, "schema": { - "type": "string" + "oneOf": [ + { + "$ref": "#/components/schemas/FactionId" + }, + { + "$ref": "#/components/schemas/FactionCrimeId" + }, + { + "$ref": "#/components/schemas/ChainId" + }, + { + "$ref": "#/components/schemas/RankedWarId" + }, + { + "$ref": "#/components/schemas/TerritoryWarId" + } + ] } }, { @@ -3665,7 +3687,40 @@ "description": "Selection category", "required": false, "schema": { - "type": "string" + "oneOf": [ + { + "type": "string", + "enum": [ + "all", + "current" + ] + }, + { + "type": "string", + "enum": [ + "all", + "recruiting", + "planning", + "failure", + "successful", + "expired", + "available", + "completed" + ] + }, + { + "$ref": "#/components/schemas/FactionNewsCategory" + }, + { + "$ref": "#/components/schemas/FactionRankedWarsCategoryEnum" + }, + { + "$ref": "#/components/schemas/ReportTypeEnum" + }, + { + "$ref": "#/components/schemas/FactionTerritoryWarsCategoryEnum" + } + ] } }, { @@ -3674,7 +3729,7 @@ "description": "Stat category", "required": false, "schema": { - "type": "string" + "$ref": "#/components/schemas/FactionStatEnum" } }, { @@ -4171,7 +4226,17 @@ "description": "selection id", "required": false, "schema": { - "type": "string" + "oneOf": [ + { + "$ref": "#/components/schemas/ForumThreadId" + }, + { + "type": "array", + "items": { + "$ref": "#/components/schemas/ForumId" + } + } + ] } }, { @@ -4557,7 +4622,7 @@ "description": "selection id", "required": false, "schema": { - "type": "string" + "$ref": "#/components/schemas/ItemId" } }, { @@ -4569,15 +4634,6 @@ "$ref": "#/components/schemas/WeaponBonusEnum" } }, - { - "name": "cat", - "in": "query", - "description": "Selection category", - "required": false, - "schema": { - "type": "string" - } - }, { "name": "sort", "in": "query", @@ -4712,6 +4768,66 @@ "x-stability": "Stable" } }, + "/racing/races": { + "get": { + "tags": [ + "Racing" + ], + "summary": "Get races", + "description": "Requires public access key.
Returns a list of races, ordered by race start timestamp.", + "operationId": "4be921a67d32b5e82c68835ef56175d0", + "parameters": [ + { + "$ref": "#/components/parameters/ApiLimit100" + }, + { + "$ref": "#/components/parameters/ApiSortDesc" + }, + { + "$ref": "#/components/parameters/ApiTo" + }, + { + "$ref": "#/components/parameters/ApiFrom" + }, + { + "name": "cat", + "in": "query", + "description": "Category of races returned", + "required": false, + "schema": { + "$ref": "#/components/schemas/RacingRaceTypeEnum" + } + }, + { + "$ref": "#/components/parameters/ApiTimestamp" + }, + { + "$ref": "#/components/parameters/ApiComment" + }, + { + "$ref": "#/components/parameters/ApiKeyPublic" + } + ], + "responses": { + "200": { + "description": "Successful operation", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RacingRacesResponse" + } + } + } + } + }, + "security": [ + { + "api_key": [] + } + ], + "x-stability": "Stable" + } + }, "/racing/{raceId}/race": { "get": { "tags": [ @@ -20288,7 +20404,8 @@ "ItemMarket": { "required": [ "item", - "listings" + "listings", + "timestamp" ], "properties": { "item": { @@ -20306,6 +20423,11 @@ } ] } + }, + "cache_timestamp": { + "description": "Timestamp when the data was globally cached at.", + "type": "integer", + "format": "int32" } }, "type": "object"