Compare commits
No commits in common. "df31458f3aaa753d10f699e7b2b4bf4358285e9c" and "f15c44adb607df5ed0f01f4f1f6c012b1a2e062d" have entirely different histories.
df31458f3a
...
f15c44adb6
4 changed files with 9 additions and 60 deletions
4
Cargo.lock
generated
4
Cargo.lock
generated
|
|
@ -2294,7 +2294,7 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "torn-api"
|
name = "torn-api"
|
||||||
version = "1.7.5"
|
version = "1.7.4"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bon",
|
"bon",
|
||||||
"bytes",
|
"bytes",
|
||||||
|
|
@ -2316,7 +2316,7 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "torn-api-codegen"
|
name = "torn-api-codegen"
|
||||||
version = "0.7.4"
|
version = "0.7.3"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"heck",
|
"heck",
|
||||||
"indexmap",
|
"indexmap",
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
[package]
|
[package]
|
||||||
name = "torn-api-codegen"
|
name = "torn-api-codegen"
|
||||||
authors = ["Pyrit [2111649]"]
|
authors = ["Pyrit [2111649]"]
|
||||||
version = "0.7.4"
|
version = "0.7.3"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
description = "Contains the v2 torn API model descriptions and codegen for the bindings"
|
description = "Contains the v2 torn API model descriptions and codegen for the bindings"
|
||||||
license = { workspace = true }
|
license = { workspace = true }
|
||||||
|
|
|
||||||
|
|
@ -444,7 +444,7 @@ impl Enum {
|
||||||
if shared.len() >= 2 {
|
if shared.len() >= 2 {
|
||||||
for (idx, variant) in shared.into_iter().enumerate() {
|
for (idx, variant) in shared.into_iter().enumerate() {
|
||||||
let label = idx + 1;
|
let label = idx + 1;
|
||||||
variant.name = format!("Variant{label}");
|
variant.name = format!("Variant{}", label);
|
||||||
if let EnumVariantValue::Tuple(values) = &mut variant.value {
|
if let EnumVariantValue::Tuple(values) = &mut variant.value {
|
||||||
if let [EnumVariantTupleValue::Enum { name, inner, .. }] = values.as_mut_slice()
|
if let [EnumVariantTupleValue::Enum { name, inner, .. }] = values.as_mut_slice()
|
||||||
{
|
{
|
||||||
|
|
@ -475,6 +475,7 @@ impl Enum {
|
||||||
let name = format_ident!("{}", self.name);
|
let name = format_ident!("{}", self.name);
|
||||||
let desc = self.description.as_ref().map(|d| {
|
let desc = self.description.as_ref().map(|d| {
|
||||||
quote! {
|
quote! {
|
||||||
|
#repr
|
||||||
#[doc = #d]
|
#[doc = #d]
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
@ -539,7 +540,6 @@ impl Enum {
|
||||||
#[derive(Debug, Clone, PartialEq, #(#derives),*)]
|
#[derive(Debug, Clone, PartialEq, #(#derives),*)]
|
||||||
#[cfg_attr(feature = "strum", derive(strum::EnumIs, strum::EnumTryAs))]
|
#[cfg_attr(feature = "strum", derive(strum::EnumIs, strum::EnumTryAs))]
|
||||||
#serde_attr
|
#serde_attr
|
||||||
#repr
|
|
||||||
pub enum #name {
|
pub enum #name {
|
||||||
#(#variants),*
|
#(#variants),*
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -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": "3.0.18"
|
"version": "3.0.12"
|
||||||
},
|
},
|
||||||
"servers": [
|
"servers": [
|
||||||
{
|
{
|
||||||
|
|
@ -8473,13 +8473,6 @@
|
||||||
"E"
|
"E"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"UserDonatorStatusEnum": {
|
|
||||||
"type": "string",
|
|
||||||
"enum": [
|
|
||||||
"Donator",
|
|
||||||
"Subscriber"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"JobTypeEnum": {
|
"JobTypeEnum": {
|
||||||
"type": "string",
|
"type": "string",
|
||||||
"enum": [
|
"enum": [
|
||||||
|
|
@ -8563,9 +8556,7 @@
|
||||||
"Tourist",
|
"Tourist",
|
||||||
"Nudist",
|
"Nudist",
|
||||||
"Sage",
|
"Sage",
|
||||||
"Coward",
|
"Coward"
|
||||||
"Newcomer",
|
|
||||||
"Deserter"
|
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"UserRankEnum": {
|
"UserRankEnum": {
|
||||||
|
|
@ -15203,7 +15194,6 @@
|
||||||
"id",
|
"id",
|
||||||
"type_id",
|
"type_id",
|
||||||
"name",
|
"name",
|
||||||
"rating",
|
|
||||||
"position",
|
"position",
|
||||||
"days_in_company"
|
"days_in_company"
|
||||||
],
|
],
|
||||||
|
|
@ -15223,10 +15213,6 @@
|
||||||
"name": {
|
"name": {
|
||||||
"type": "string"
|
"type": "string"
|
||||||
},
|
},
|
||||||
"rating": {
|
|
||||||
"type": "integer",
|
|
||||||
"format": "int32"
|
|
||||||
},
|
|
||||||
"position": {
|
"position": {
|
||||||
"type": "string"
|
"type": "string"
|
||||||
},
|
},
|
||||||
|
|
@ -15311,8 +15297,7 @@
|
||||||
"forum_posts",
|
"forum_posts",
|
||||||
"karma",
|
"karma",
|
||||||
"last_action",
|
"last_action",
|
||||||
"life",
|
"life"
|
||||||
"donator_status"
|
|
||||||
],
|
],
|
||||||
"properties": {
|
"properties": {
|
||||||
"id": {
|
"id": {
|
||||||
|
|
@ -15331,16 +15316,6 @@
|
||||||
"title": {
|
"title": {
|
||||||
"$ref": "#/components/schemas/UserTitleEnum"
|
"$ref": "#/components/schemas/UserTitleEnum"
|
||||||
},
|
},
|
||||||
"donator_status": {
|
|
||||||
"oneOf": [
|
|
||||||
{
|
|
||||||
"$ref": "#/components/schemas/UserDonatorStatusEnum"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "null"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"age": {
|
"age": {
|
||||||
"description": "Age in days.",
|
"description": "Age in days.",
|
||||||
"type": "integer",
|
"type": "integer",
|
||||||
|
|
@ -17586,25 +17561,6 @@
|
||||||
},
|
},
|
||||||
"type": "object"
|
"type": "object"
|
||||||
},
|
},
|
||||||
"UserOrganizedCrimeError": {
|
|
||||||
"required": [
|
|
||||||
"code",
|
|
||||||
"error"
|
|
||||||
],
|
|
||||||
"properties": {
|
|
||||||
"code": {
|
|
||||||
"type": "integer",
|
|
||||||
"format": "int32",
|
|
||||||
"enum": [
|
|
||||||
27
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"error": {
|
|
||||||
"type": "string"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"type": "object"
|
|
||||||
},
|
|
||||||
"UserOrganizedCrimeResponse": {
|
"UserOrganizedCrimeResponse": {
|
||||||
"required": [
|
"required": [
|
||||||
"organizedCrime"
|
"organizedCrime"
|
||||||
|
|
@ -17615,9 +17571,6 @@
|
||||||
{
|
{
|
||||||
"$ref": "#/components/schemas/FactionCrime"
|
"$ref": "#/components/schemas/FactionCrime"
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"$ref": "#/components/schemas/UserOrganizedCrimeError"
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"type": "null"
|
"type": "null"
|
||||||
}
|
}
|
||||||
|
|
@ -22216,8 +22169,7 @@
|
||||||
"description",
|
"description",
|
||||||
"details",
|
"details",
|
||||||
"state",
|
"state",
|
||||||
"until",
|
"until"
|
||||||
"color"
|
|
||||||
],
|
],
|
||||||
"properties": {
|
"properties": {
|
||||||
"description": {
|
"description": {
|
||||||
|
|
@ -22236,9 +22188,6 @@
|
||||||
"state": {
|
"state": {
|
||||||
"type": "string"
|
"type": "string"
|
||||||
},
|
},
|
||||||
"color": {
|
|
||||||
"type": "string"
|
|
||||||
},
|
|
||||||
"until": {
|
"until": {
|
||||||
"oneOf": [
|
"oneOf": [
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue