diff --git a/.eslintignore b/.eslintignore index 243b715..dde047a 100644 --- a/.eslintignore +++ b/.eslintignore @@ -5,3 +5,4 @@ k8s .prettierrc.js commitlint.config.js postbuild.js +src/lib/twhelpv2 diff --git a/.prettierrc.js b/.prettierrc.js deleted file mode 100644 index e340799..0000000 --- a/.prettierrc.js +++ /dev/null @@ -1,3 +0,0 @@ -module.exports = { - singleQuote: true, -}; diff --git a/.prettierrc.json b/.prettierrc.json new file mode 100644 index 0000000..c1a6f66 --- /dev/null +++ b/.prettierrc.json @@ -0,0 +1,4 @@ +{ + "singleQuote": true, + "trailingComma": "es5" +} diff --git a/package.json b/package.json index c9c18d3..664a8fa 100644 --- a/package.json +++ b/package.json @@ -4,7 +4,8 @@ "license": "MIT", "scripts": { "prepare": "husky install", - "build": "rm -rf dist && parcel build ./src/*.user.ts ./src/*.quickbar.ts", + "generate-client": "openapi --input ./src/lib/twhelpv2/openapi3.json --output ./src/lib/twhelpv2 --name TWHelpV2 --useOptions --client axios", + "build": "rm -rf dist && yarn generate-client && parcel build ./src/*.user.ts ./src/*.quickbar.ts", "postbuild": "PUBLIC_URL=https://scripts.tribalwarshelp.com node postbuild.js", "lint": "eslint src/**/*.ts" }, @@ -36,6 +37,7 @@ "eslint": "^7.32.0", "eslint-config-prettier": "^9.0.0", "husky": "^8.0.3", + "openapi-typescript-codegen": "^0.28.0", "parcel": "^2.9.1", "prettier": "^3.0.0", "typescript": "^5.0.0" diff --git a/src/lib/twhelpv2/.gitignore b/src/lib/twhelpv2/.gitignore new file mode 100644 index 0000000..4026c08 --- /dev/null +++ b/src/lib/twhelpv2/.gitignore @@ -0,0 +1,3 @@ +* +!.gitignore +!openapi3.json diff --git a/src/lib/twhelpv2/openapi3.json b/src/lib/twhelpv2/openapi3.json new file mode 100644 index 0000000..a4b0613 --- /dev/null +++ b/src/lib/twhelpv2/openapi3.json @@ -0,0 +1 @@ +{"components":{"parameters":{"BeforeQueryParam":{"description":"only items created before the provided time are returned, this is a timestamp in RFC 3339 format","in":"query","name":"before","schema":{"format":"date-time","type":"string"}},"CursorQueryParam":{"in":"query","name":"cursor","schema":{"$ref":"#/components/schemas/CursorString"}},"EnnoblementSortQueryParam":{"description":"Order matters!","in":"query","name":"sort","schema":{"default":["createdAt:ASC"],"items":{"enum":["createdAt:ASC","createdAt:DESC"],"maxItems":1,"type":"string"},"type":"array"}},"LimitQueryParam":{"in":"query","name":"limit","schema":{"default":500,"maximum":500,"minimum":1,"type":"integer"}},"PlayerDeletedQueryParam":{"description":"true=only deleted players, false=only existing players, by default both existing and deleted players are returned","in":"query","name":"deleted","schema":{"type":"boolean"}},"PlayerIdPathParam":{"in":"path","name":"playerId","required":true,"schema":{"$ref":"#/components/schemas/IntId"}},"PlayerIdQueryParam":{"in":"query","name":"id","schema":{"items":{"$ref":"#/components/schemas/IntId"},"type":"array"}},"PlayerNameQueryParam":{"in":"query","name":"name","schema":{"items":{"maxLength":150,"minLength":1,"type":"string"},"maxItems":100,"type":"array"}},"PlayerSnapshotSortQueryParam":{"description":"Order matters!","in":"query","name":"sort","schema":{"default":["date:ASC"],"items":{"enum":["date:ASC","date:DESC"],"maxItems":1,"type":"string"},"type":"array"}},"PlayerSortQueryParam":{"description":"Order matters!","in":"query","name":"sort","schema":{"items":{"enum":["odScoreAtt:ASC","odScoreAtt:DESC","odScoreDef:ASC","odScoreDef:DESC","odScoreSup:ASC","odScoreSup:DESC","odScoreTotal:ASC","odScoreTotal:DESC","points:ASC","points:DESC","deletedAt:ASC","deletedAt:DESC"],"maxItems":2,"type":"string"},"type":"array"}},"ServerKeyPathParam":{"in":"path","name":"serverKey","required":true,"schema":{"$ref":"#/components/schemas/ServerKey"}},"ServerOpenQueryParam":{"description":"true=only open servers, false=only closed servers, by default both open and closed servers are returned","in":"query","name":"open","schema":{"type":"boolean"}},"SinceQueryParam":{"description":"only items created since the provided time are returned, this is a timestamp in RFC 3339 format","in":"query","name":"since","schema":{"format":"date-time","type":"string"}},"TribeChangeSortQueryParam":{"description":"Order matters!","in":"query","name":"sort","schema":{"default":["createdAt:ASC"],"items":{"enum":["createdAt:ASC","createdAt:DESC"],"maxItems":1,"type":"string"},"type":"array"}},"TribeDeletedQueryParam":{"description":"true=only deleted tribes, false=only existing tribes, by default both existing and deleted tribes are returned","in":"query","name":"deleted","schema":{"type":"boolean"}},"TribeIdPathParam":{"in":"path","name":"tribeId","required":true,"schema":{"$ref":"#/components/schemas/IntId"}},"TribeSnapshotSortQueryParam":{"description":"Order matters!","in":"query","name":"sort","schema":{"default":["date:ASC"],"items":{"enum":["date:ASC","date:DESC"],"maxItems":1,"type":"string"},"type":"array"}},"TribeSortQueryParam":{"description":"Order matters!","in":"query","name":"sort","schema":{"items":{"enum":["odScoreAtt:ASC","odScoreAtt:DESC","odScoreDef:ASC","odScoreDef:DESC","odScoreTotal:ASC","odScoreTotal:DESC","points:ASC","points:DESC","dominance:ASC","dominance:DESC","deletedAt:ASC","deletedAt:DESC"],"maxItems":2,"type":"string"},"type":"array"}},"TribeTagQueryParam":{"in":"query","name":"tag","schema":{"items":{"type":"string"},"maxItems":100,"type":"array"}},"VersionCodePathParam":{"in":"path","name":"versionCode","required":true,"schema":{"$ref":"#/components/schemas/VersionCode"}},"VillageCoordsQueryParam":{"in":"query","name":"coords","schema":{"items":{"example":"500|500","type":"string"},"maxItems":200,"type":"array"}},"VillageIdPathParam":{"in":"path","name":"villageId","required":true,"schema":{"$ref":"#/components/schemas/IntId"}}},"responses":{"ErrorResponse":{"content":{"application/json":{"schema":{"additionalProperties":false,"properties":{"errors":{"items":{"$ref":"#/components/schemas/Error"},"type":"array"}},"required":["errors"],"type":"object"}}},"description":"Default error response."},"GetBuildingInfoResponse":{"content":{"application/json":{"schema":{"properties":{"data":{"$ref":"#/components/schemas/BuildingInfo"}},"required":["data"],"type":"object"}}},"description":""},"GetPlayerResponse":{"content":{"application/json":{"schema":{"properties":{"data":{"$ref":"#/components/schemas/Player"}},"required":["data"],"type":"object"}}},"description":""},"GetServerConfigResponse":{"content":{"application/json":{"schema":{"properties":{"data":{"$ref":"#/components/schemas/ServerConfig"}},"required":["data"],"type":"object"}}},"description":""},"GetServerResponse":{"content":{"application/json":{"schema":{"properties":{"data":{"$ref":"#/components/schemas/Server"}},"required":["data"],"type":"object"}}},"description":""},"GetTribeResponse":{"content":{"application/json":{"schema":{"properties":{"data":{"$ref":"#/components/schemas/Tribe"}},"required":["data"],"type":"object"}}},"description":""},"GetUnitInfoResponse":{"content":{"application/json":{"schema":{"properties":{"data":{"$ref":"#/components/schemas/UnitInfo"}},"required":["data"],"type":"object"}}},"description":""},"GetVersionResponse":{"content":{"application/json":{"schema":{"properties":{"data":{"$ref":"#/components/schemas/Version"}},"required":["data"],"type":"object"}}},"description":""},"GetVillageResponse":{"content":{"application/json":{"schema":{"properties":{"data":{"$ref":"#/components/schemas/Village"}},"required":["data"],"type":"object"}}},"description":""},"ListEnnoblementsResponse":{"content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/PaginationResponse"},{"properties":{"data":{"items":{"$ref":"#/components/schemas/Ennoblement"},"type":"array"}},"required":["data"],"type":"object"}]}}},"description":""},"ListPlayerSnapshotsResponse":{"content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/PaginationResponse"},{"properties":{"data":{"items":{"$ref":"#/components/schemas/PlayerSnapshot"},"type":"array"}},"required":["data"],"type":"object"}]}}},"description":""},"ListPlayersResponse":{"content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/PaginationResponse"},{"properties":{"data":{"items":{"$ref":"#/components/schemas/Player"},"type":"array"}},"required":["data"],"type":"object"}]}}},"description":""},"ListPlayersWithServersResponse":{"content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/PaginationResponse"},{"properties":{"data":{"items":{"$ref":"#/components/schemas/PlayerWithServer"},"type":"array"}},"required":["data"],"type":"object"}]}}},"description":""},"ListServersResponse":{"content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/PaginationResponse"},{"properties":{"data":{"items":{"$ref":"#/components/schemas/Server"},"type":"array"}},"required":["data"],"type":"object"}]}}},"description":""},"ListTribeChangesResponse":{"content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/PaginationResponse"},{"properties":{"data":{"items":{"$ref":"#/components/schemas/TribeChange"},"type":"array"}},"required":["data"],"type":"object"}]}}},"description":""},"ListTribeSnapshotsResponse":{"content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/PaginationResponse"},{"properties":{"data":{"items":{"$ref":"#/components/schemas/TribeSnapshot"},"type":"array"}},"required":["data"],"type":"object"}]}}},"description":""},"ListTribesResponse":{"content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/PaginationResponse"},{"properties":{"data":{"items":{"$ref":"#/components/schemas/Tribe"},"type":"array"}},"required":["data"],"type":"object"}]}}},"description":""},"ListVersionsResponse":{"content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/PaginationResponse"},{"properties":{"data":{"items":{"$ref":"#/components/schemas/Version"},"type":"array"}},"required":["data"],"type":"object"}]}}},"description":""},"ListVillagesResponse":{"content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/PaginationResponse"},{"properties":{"data":{"items":{"$ref":"#/components/schemas/Village"},"type":"array"}},"required":["data"],"type":"object"}]}}},"description":""}},"schemas":{"Building":{"properties":{"buildTime":{"format":"double","type":"number"},"buildTimeFactor":{"format":"double","type":"number"},"iron":{"type":"integer"},"ironFactor":{"format":"double","type":"number"},"maxLevel":{"type":"integer"},"minLevel":{"type":"integer"},"pop":{"type":"integer"},"popFactor":{"format":"double","type":"number"},"stone":{"type":"integer"},"stoneFactor":{"format":"double","type":"number"},"wood":{"type":"integer"},"woodFactor":{"format":"double","type":"number"}},"required":["buildTime","buildTimeFactor","iron","ironFactor","maxLevel","minLevel","pop","popFactor","stone","stoneFactor","wood","woodFactor"],"type":"object"},"BuildingInfo":{"properties":{"barracks":{"$ref":"#/components/schemas/Building"},"farm":{"$ref":"#/components/schemas/Building"},"garage":{"$ref":"#/components/schemas/Building"},"hide":{"$ref":"#/components/schemas/Building"},"iron":{"$ref":"#/components/schemas/Building"},"main":{"$ref":"#/components/schemas/Building"},"market":{"$ref":"#/components/schemas/Building"},"place":{"$ref":"#/components/schemas/Building"},"smith":{"$ref":"#/components/schemas/Building"},"snob":{"$ref":"#/components/schemas/Building"},"stable":{"$ref":"#/components/schemas/Building"},"statue":{"$ref":"#/components/schemas/Building"},"stone":{"$ref":"#/components/schemas/Building"},"storage":{"$ref":"#/components/schemas/Building"},"wall":{"$ref":"#/components/schemas/Building"},"watchtower":{"$ref":"#/components/schemas/Building"},"wood":{"$ref":"#/components/schemas/Building"}},"required":["barracks","farm","garage","hide","iron","main","market","place","smith","snob","stable","statue","stone","storage","wall","watchtower","wood"],"type":"object"},"Cursor":{"properties":{"next":{"allOf":[{"$ref":"#/components/schemas/CursorString"}],"description":"Cursor pointing to the next page.","x-go-type-skip-optional-pointer":true},"self":{"allOf":[{"$ref":"#/components/schemas/CursorString"}],"description":"Cursor pointing to the current page.","x-go-type-skip-optional-pointer":true}},"type":"object","x-go-type-skip-optional-pointer":true},"CursorString":{"example":"aWQ9NTU3LHNlcnZlcktleT1wbDE5Mw==","maxLength":1000,"minLength":1,"type":"string"},"DomainErrorCode":{"description":"* `invalid-cursor` - This error code is returned when a cursor can't be decoded (e.g. is malformed).\n* `nil` - This error code is returned when a value can't be nil.\n* `required` - This error code is returned when a value can't be blank.","enum":["invalid-cursor","max-less-equal","nil","player-not-found","sort-conflict","village-not-found","invalid-url","min-greater-equal","tribe-not-found","length-out-of-range","required","server-not-found","unsupported-sort-string","version-not-found"],"type":"string"},"Ennoblement":{"properties":{"createdAt":{"format":"date-time","type":"string"},"id":{"$ref":"#/components/schemas/IntId"},"newOwner":{"$ref":"#/components/schemas/PlayerMeta"},"points":{"type":"integer"},"village":{"$ref":"#/components/schemas/VillageMeta"}},"required":["id","points","newOwner","village","createdAt"],"type":"object"},"Error":{"additionalProperties":false,"properties":{"code":{"allOf":[{"$ref":"#/components/schemas/DomainErrorCode"},{"enum":["method-not-allowed","route-not-found","internal-server-error","invalid-param-format"],"type":"string"}],"example":"invalid-param-format"},"message":{"type":"string"},"params":{"additionalProperties":true,"description":"Additional data related to the error. Can be used for i18n.","type":"object","x-go-type-skip-optional-pointer":true},"path":{"description":"References field where an error occurred.","items":{"type":"string"},"type":"array","x-go-type-skip-optional-pointer":true}},"required":["code","message"],"type":"object"},"IntId":{"minimum":1,"type":"integer"},"NullPlayerMeta":{"allOf":[{"$ref":"#/components/schemas/PlayerMeta"}],"example":{"id":"1,","name":"string,","profileUrl":"https://en138.tribalwars.net/game.php?screen=info_player\u0026id=11518097,","tribe":{"id":"1,","name":"string,","profileUrl":"https://en138.tribalwars.net/game.php?screen=info_ally\u0026id=13,","tag":"string"}},"nullable":true},"NullTribeMeta":{"allOf":[{"$ref":"#/components/schemas/TribeMeta"}],"example":{"id":1,"name":"string","profileUrl":"https://en138.tribalwars.net/game.php?screen=info_ally\u0026id=13","tag":"string"},"nullable":true},"PaginationResponse":{"properties":{"cursor":{"$ref":"#/components/schemas/Cursor"}},"type":"object"},"Player":{"properties":{"bestRank":{"type":"integer"},"bestRankAt":{"format":"date-time","type":"string"},"createdAt":{"format":"date-time","type":"string"},"deletedAt":{"format":"date-time","type":"string"},"id":{"$ref":"#/components/schemas/IntId"},"lastActivityAt":{"format":"date-time","type":"string"},"mostPoints":{"type":"integer"},"mostPointsAt":{"format":"date-time","type":"string"},"mostVillages":{"type":"integer"},"mostVillagesAt":{"format":"date-time","type":"string"},"name":{"type":"string"},"numVillages":{"type":"integer"},"opponentsDefeated":{"$ref":"#/components/schemas/PlayerOpponentsDefeated"},"points":{"type":"integer"},"profileUrl":{"example":"https://en138.tribalwars.net/game.php?screen=info_player\u0026id=11518097","format":"uri","type":"string"},"rank":{"type":"integer"},"tribe":{"$ref":"#/components/schemas/NullTribeMeta"}},"required":["id","name","rank","points","numVillages","profileUrl","tribe","lastActivityAt","bestRank","bestRankAt","mostPoints","mostPointsAt","mostVillages","mostVillagesAt","opponentsDefeated","createdAt"],"type":"object"},"PlayerMeta":{"properties":{"id":{"$ref":"#/components/schemas/IntId"},"name":{"type":"string"},"profileUrl":{"example":"https://en138.tribalwars.net/game.php?screen=info_player\u0026id=11518097","format":"uri","type":"string"},"tribe":{"$ref":"#/components/schemas/NullTribeMeta"}},"required":["id","name","profileUrl","tribe"],"type":"object"},"PlayerOpponentsDefeated":{"allOf":[{"$ref":"#/components/schemas/TribeOpponentsDefeated"},{"properties":{"rankSup":{"type":"integer"},"scoreSup":{"type":"integer"}},"required":["rankSup","scoreSup"],"type":"object"}],"example":{"rankAtt":"0,","rankDef":"0,","rankSup":0,"rankTotal":"0,","scoreAtt":"0,","scoreDef":"0,","scoreSup":0,"scoreTotal":0}},"PlayerSnapshot":{"properties":{"date":{"format":"date","type":"string"},"id":{"$ref":"#/components/schemas/IntId"},"numVillages":{"type":"integer"},"opponentsDefeated":{"$ref":"#/components/schemas/PlayerOpponentsDefeated"},"player":{"$ref":"#/components/schemas/PlayerMeta"},"points":{"type":"integer"},"rank":{"type":"integer"}},"required":["id","numVillages","points","rank","date","opponentsDefeated","player"],"type":"object"},"PlayerWithServer":{"allOf":[{"$ref":"#/components/schemas/Player"},{"properties":{"server":{"$ref":"#/components/schemas/ServerMeta"}},"required":["server"],"type":"object"}]},"Server":{"properties":{"createdAt":{"format":"date-time","type":"string"},"ennoblementDataSyncedAt":{"format":"date-time","type":"string"},"key":{"$ref":"#/components/schemas/ServerKey"},"numBarbarianVillages":{"type":"integer"},"numBonusVillages":{"type":"integer"},"numPlayerVillages":{"type":"integer"},"numPlayers":{"type":"integer"},"numTribes":{"type":"integer"},"numVillages":{"type":"integer"},"open":{"type":"boolean"},"playerDataSyncedAt":{"format":"date-time","type":"string"},"tribeDataSyncedAt":{"format":"date-time","type":"string"},"url":{"example":"https://en138.tribalwars.net","format":"uri","type":"string"},"villageDataSyncedAt":{"format":"date-time","type":"string"}},"required":["key","open","url","numPlayers","numTribes","numVillages","numBarbarianVillages","numBonusVillages","numPlayerVillages","createdAt"],"type":"object"},"ServerConfig":{"properties":{"ally":{"$ref":"#/components/schemas/ServerConfigAlly"},"build":{"$ref":"#/components/schemas/ServerConfigBuild"},"buildings":{"$ref":"#/components/schemas/ServerConfigBuildings"},"commands":{"$ref":"#/components/schemas/ServerConfigCommands"},"coord":{"$ref":"#/components/schemas/ServerConfigCoord"},"game":{"$ref":"#/components/schemas/ServerConfigGame"},"misc":{"$ref":"#/components/schemas/ServerConfigMisc"},"moral":{"type":"integer"},"newbie":{"$ref":"#/components/schemas/ServerConfigNewbie"},"night":{"$ref":"#/components/schemas/ServerConfigNight"},"sitter":{"$ref":"#/components/schemas/ServerConfigSitter"},"sleep":{"$ref":"#/components/schemas/ServerConfigSleep"},"snob":{"$ref":"#/components/schemas/ServerConfigSnob"},"speed":{"format":"double","type":"number"},"unitSpeed":{"format":"double","type":"number"},"win":{"$ref":"#/components/schemas/ServerConfigWin"}},"required":["ally","build","buildings","commands","coord","game","misc","moral","newbie","night","sitter","sleep","snob","speed","unitSpeed","win"],"type":"object"},"ServerConfigAlly":{"properties":{"allytimeSupport":{"type":"integer"},"fixedAllies":{"type":"integer"},"levels":{"type":"integer"},"limit":{"type":"integer"},"noHarm":{"type":"integer"},"noJoin":{"type":"integer"},"noLeave":{"type":"integer"},"noOtherSupport":{"type":"integer"},"noOtherSupportType":{"type":"integer"},"pointsMemberCount":{"type":"integer"},"warsAutoacceptDays":{"type":"integer"},"warsMemberRequirement":{"type":"integer"},"warsPointsRequirement":{"type":"integer"},"xpRequirements":{"type":"string"}},"required":["allytimeSupport","fixedAllies","levels","limit","noHarm","noJoin","noLeave","noOtherSupport","noOtherSupportType","pointsMemberCount","warsAutoacceptDays","warsMemberRequirement","warsPointsRequirement","xpRequirements"],"type":"object"},"ServerConfigBuild":{"properties":{"destroy":{"type":"integer"}},"required":["destroy"],"type":"object"},"ServerConfigBuildings":{"properties":{"customBarracks":{"type":"integer"},"customChurch":{"type":"integer"},"customFarm":{"type":"integer"},"customGarage":{"type":"integer"},"customHide":{"type":"integer"},"customIron":{"type":"integer"},"customMain":{"type":"integer"},"customMarket":{"type":"integer"},"customPlace":{"type":"integer"},"customSmith":{"type":"integer"},"customSnob":{"type":"integer"},"customStable":{"type":"integer"},"customStatue":{"type":"integer"},"customStone":{"type":"integer"},"customStorage":{"type":"integer"},"customWall":{"type":"integer"},"customWatchtower":{"type":"integer"},"customWood":{"type":"integer"}},"required":["customBarracks","customChurch","customFarm","customGarage","customHide","customIron","customMain","customMarket","customPlace","customSmith","customSnob","customStable","customStatue","customStone","customStorage","customWall","customWatchtower","customWood"],"type":"object"},"ServerConfigCommands":{"properties":{"commandCancelTime":{"type":"integer"},"millisArrival":{"type":"integer"}},"required":["commandCancelTime","millisArrival"],"type":"object"},"ServerConfigCoord":{"properties":{"bonusNew":{"type":"integer"},"bonusVillages":{"type":"integer"},"emptyVillages":{"type":"integer"},"func":{"type":"integer"},"inner":{"type":"integer"},"mapSize":{"type":"integer"},"nobleRestart":{"type":"integer"},"selectStart":{"type":"integer"},"startVillages":{"type":"integer"},"villageMoveWait":{"type":"integer"}},"required":["bonusNew","bonusVillages","emptyVillages","func","inner","mapSize","nobleRestart","selectStart","startVillages","villageMoveWait"],"type":"object"},"ServerConfigGame":{"properties":{"archer":{"type":"integer"},"barbarianMaxPoints":{"type":"integer"},"barbarianRise":{"format":"double","type":"number"},"barbarianShrink":{"type":"integer"},"baseProduction":{"type":"integer"},"buildtimeFormula":{"type":"integer"},"church":{"type":"integer"},"event":{"type":"integer"},"fakeLimit":{"format":"double","type":"number"},"farmLimit":{"type":"integer"},"hauls":{"type":"integer"},"haulsBase":{"type":"integer"},"haulsMax":{"type":"integer"},"knight":{"type":"integer"},"knightNewItems":{"type":"integer"},"scavenging":{"type":"integer"},"stronghold":{"type":"integer"},"suppressEvents":{"type":"integer"},"tech":{"type":"integer"},"watchtower":{"type":"integer"}},"required":["archer","barbarianMaxPoints","barbarianRise","barbarianShrink","baseProduction","buildtimeFormula","church","event","fakeLimit","farmLimit","hauls","haulsBase","haulsMax","knight","knightNewItems","scavenging","stronghold","suppressEvents","tech","watchtower"],"type":"object"},"ServerConfigMisc":{"properties":{"killRanking":{"type":"integer"},"tradeCancelTime":{"type":"integer"},"tutorial":{"type":"integer"}},"required":["killRanking","tradeCancelTime","tutorial"],"type":"object"},"ServerConfigNewbie":{"properties":{"days":{"type":"integer"},"ratio":{"type":"integer"},"ratioDays":{"type":"integer"},"removeNewbieVillages":{"type":"integer"}},"required":["days","ratio","ratioDays","removeNewbieVillages"],"type":"object"},"ServerConfigNight":{"properties":{"active":{"type":"integer"},"defFactor":{"format":"double","type":"number"},"duration":{"type":"integer"},"endHour":{"type":"integer"},"startHour":{"type":"integer"}},"required":["active","defFactor","duration","endHour","startHour"],"type":"object"},"ServerConfigSitter":{"properties":{"allow":{"type":"integer"}},"required":["allow"],"type":"object"},"ServerConfigSleep":{"properties":{"active":{"type":"integer"},"delay":{"type":"integer"},"max":{"type":"integer"},"maxAwake":{"type":"integer"},"min":{"type":"integer"},"minAwake":{"type":"integer"},"warnTime":{"type":"integer"}},"required":["active","delay","max","maxAwake","min","minAwake","warnTime"],"type":"object"},"ServerConfigSnob":{"properties":{"cheapRebuild":{"type":"integer"},"coinIron":{"type":"integer"},"coinStone":{"type":"integer"},"coinWood":{"type":"integer"},"factor":{"format":"double","type":"number"},"gold":{"type":"integer"},"maxDist":{"type":"integer"},"noBarbConquer":{"type":"integer"},"rise":{"type":"integer"}},"required":["cheapRebuild","coinIron","coinStone","coinWood","factor","gold","maxDist","noBarbConquer","rise"],"type":"object"},"ServerConfigWin":{"properties":{"check":{"type":"integer"}},"required":["check"],"type":"object"},"ServerKey":{"example":"en138","maxLength":10,"minLength":1,"type":"string"},"ServerMeta":{"properties":{"key":{"$ref":"#/components/schemas/ServerKey"},"open":{"type":"boolean"},"url":{"example":"https://en138.tribalwars.net","format":"uri","type":"string"}},"required":["key","open","url"],"type":"object"},"Tribe":{"properties":{"allPoints":{"type":"integer"},"bestRank":{"type":"integer"},"bestRankAt":{"format":"date-time","type":"string"},"createdAt":{"format":"date-time","type":"string"},"deletedAt":{"format":"date-time","type":"string"},"dominance":{"format":"double","type":"number"},"id":{"$ref":"#/components/schemas/IntId"},"mostPoints":{"type":"integer"},"mostPointsAt":{"format":"date-time","type":"string"},"mostVillages":{"type":"integer"},"mostVillagesAt":{"format":"date-time","type":"string"},"name":{"type":"string"},"numMembers":{"type":"integer"},"numVillages":{"type":"integer"},"opponentsDefeated":{"$ref":"#/components/schemas/TribeOpponentsDefeated"},"points":{"type":"integer"},"profileUrl":{"example":"https://en138.tribalwars.net/game.php?screen=info_ally\u0026id=13","format":"uri","type":"string"},"rank":{"type":"integer"},"tag":{"type":"string"}},"required":["id","name","tag","profileUrl","points","allPoints","numMembers","numVillages","rank","dominance","opponentsDefeated","bestRank","bestRankAt","mostVillages","mostVillagesAt","mostPoints","mostPointsAt","createdAt"],"type":"object"},"TribeChange":{"properties":{"createdAt":{"format":"date-time","type":"string"},"id":{"$ref":"#/components/schemas/IntId"},"newTribe":{"$ref":"#/components/schemas/NullTribeMeta"},"player":{"$ref":"#/components/schemas/PlayerMeta"}},"required":["id","player","newTribe","createdAt"],"type":"object"},"TribeMeta":{"properties":{"id":{"$ref":"#/components/schemas/IntId"},"name":{"type":"string"},"profileUrl":{"example":"https://en138.tribalwars.net/game.php?screen=info_ally\u0026id=13","format":"uri","type":"string"},"tag":{"type":"string"}},"required":["id","name","tag","profileUrl"],"type":"object"},"TribeOpponentsDefeated":{"properties":{"rankAtt":{"type":"integer"},"rankDef":{"type":"integer"},"rankTotal":{"type":"integer"},"scoreAtt":{"type":"integer"},"scoreDef":{"type":"integer"},"scoreTotal":{"type":"integer"}},"required":["rankAtt","scoreAtt","rankDef","scoreDef","rankTotal","scoreTotal"],"type":"object"},"TribeSnapshot":{"properties":{"allPoints":{"type":"integer"},"date":{"format":"date","type":"string"},"dominance":{"format":"double","type":"number"},"id":{"$ref":"#/components/schemas/IntId"},"numMembers":{"type":"integer"},"numVillages":{"type":"integer"},"opponentsDefeated":{"$ref":"#/components/schemas/TribeOpponentsDefeated"},"points":{"type":"integer"},"rank":{"type":"integer"},"tribe":{"$ref":"#/components/schemas/TribeMeta"}},"required":["id","tribe","allPoints","date","dominance","numMembers","numVillages","points","rank","opponentsDefeated"],"type":"object"},"Unit":{"properties":{"attack":{"type":"integer"},"buildTime":{"format":"double","type":"number"},"carry":{"type":"integer"},"defense":{"type":"integer"},"defenseArcher":{"type":"integer"},"defenseCavalry":{"type":"integer"},"pop":{"type":"integer"},"speed":{"format":"double","type":"number"}},"required":["attack","buildTime","carry","defense","defenseArcher","defenseCavalry","pop","speed"],"type":"object"},"UnitInfo":{"properties":{"archer":{"$ref":"#/components/schemas/Unit"},"axe":{"$ref":"#/components/schemas/Unit"},"catapult":{"$ref":"#/components/schemas/Unit"},"heavy":{"$ref":"#/components/schemas/Unit"},"knight":{"$ref":"#/components/schemas/Unit"},"light":{"$ref":"#/components/schemas/Unit"},"marcher":{"$ref":"#/components/schemas/Unit"},"militia":{"$ref":"#/components/schemas/Unit"},"ram":{"$ref":"#/components/schemas/Unit"},"snob":{"$ref":"#/components/schemas/Unit"},"spear":{"$ref":"#/components/schemas/Unit"},"spy":{"$ref":"#/components/schemas/Unit"},"sword":{"$ref":"#/components/schemas/Unit"}},"required":["archer","axe","catapult","heavy","knight","light","marcher","militia","ram","snob","spear","spy","sword"],"type":"object"},"Version":{"properties":{"code":{"$ref":"#/components/schemas/VersionCode"},"host":{"example":"www.tribalwars.net","format":"hostname","type":"string"},"name":{"example":"International","type":"string"},"timezone":{"example":"Europe/London","type":"string"}},"required":["code","host","name","timezone"],"type":"object"},"VersionCode":{"example":"en","maxLength":2,"minLength":2,"type":"string"},"Village":{"properties":{"bonus":{"description":"Some of the bonuses:\n1 - 100% higher wood production\n2 - 100% higher clay production\n3 - 100% higher iron production\n4 - 10% more population\n5 - 33% faster recruitment in the Barracks\n6 - 33% faster recruitment in the Stable\n7 - 50% faster recruitment in the Workshop\n8 - 30% more resources are produced (all resource types)\n9 - 50% more storage capacity and merchants\n","type":"integer"},"continent":{"example":"K44","type":"string"},"createdAt":{"format":"date-time","type":"string"},"fullName":{"example":"Village (450|450) K44","type":"string"},"id":{"$ref":"#/components/schemas/IntId"},"name":{"example":"Village","type":"string"},"player":{"$ref":"#/components/schemas/NullPlayerMeta"},"points":{"type":"integer"},"profileUrl":{"example":"https://en138.tribalwars.net/game.php?screen=info_village\u0026id=57198","format":"uri","type":"string"},"x":{"example":450,"type":"integer"},"y":{"example":450,"type":"integer"}},"required":["id","name","fullName","x","y","points","profileUrl","continent","bonus","createdAt","player"],"type":"object"},"VillageMeta":{"properties":{"continent":{"example":"K44","type":"string"},"fullName":{"example":"Village (450|450) K44","type":"string"},"id":{"$ref":"#/components/schemas/IntId"},"player":{"$ref":"#/components/schemas/NullPlayerMeta"},"profileUrl":{"example":"https://en138.tribalwars.net/game.php?screen=info_village\u0026id=57198","format":"uri","type":"string"},"x":{"example":450,"type":"integer"},"y":{"example":450,"type":"integer"}},"required":["id","fullName","x","y","profileUrl","continent","player"],"type":"object"},"domain-error-code":{"description":"* `invalid-cursor` - This error code is returned when a cursor can't be decoded (e.g. is malformed).\n* `nil` - This error code is returned when a value can't be nil.\n* `required` - This error code is returned when a value can't be blank.","enum":["invalid-cursor","max-less-equal","nil","player-not-found","sort-conflict","village-not-found","invalid-url","min-greater-equal","tribe-not-found","length-out-of-range","required","server-not-found","unsupported-sort-string","version-not-found"],"type":"string"}}},"info":{"contact":{"email":"contact@dwysokinski.me","name":"Dawid WysokiƄski","url":"https://dwysokinski.me"},"description":"REST API to interact with [TWHelp](https://tribalwarshelp.com).","license":{"name":"MIT"},"title":"TWHelp API","version":"2.0.0"},"openapi":"3.0.0","paths":{"/v2/versions":{"get":{"description":"List versions","operationId":"ListVersions","parameters":[{"$ref":"#/components/parameters/CursorQueryParam"},{"$ref":"#/components/parameters/LimitQueryParam"}],"responses":{"200":{"$ref":"#/components/responses/ListVersionsResponse"},"default":{"$ref":"#/components/responses/ErrorResponse"}},"tags":["versions"]}},"/v2/versions/{versionCode}":{"get":{"description":"Get a version","operationId":"GetVersion","parameters":[{"$ref":"#/components/parameters/VersionCodePathParam"}],"responses":{"200":{"$ref":"#/components/responses/GetVersionResponse"},"default":{"$ref":"#/components/responses/ErrorResponse"}},"tags":["versions"]}},"/v2/versions/{versionCode}/players":{"get":{"description":"List players associated with the given version","operationId":"ListVersionPlayers","parameters":[{"$ref":"#/components/parameters/VersionCodePathParam"},{"$ref":"#/components/parameters/CursorQueryParam"},{"$ref":"#/components/parameters/LimitQueryParam"},{"$ref":"#/components/parameters/PlayerDeletedQueryParam"},{"$ref":"#/components/parameters/PlayerSortQueryParam"},{"$ref":"#/components/parameters/PlayerNameQueryParam"},{"$ref":"#/components/parameters/PlayerIdQueryParam"}],"responses":{"200":{"$ref":"#/components/responses/ListPlayersWithServersResponse"},"default":{"$ref":"#/components/responses/ErrorResponse"}},"tags":["versions","players"]}},"/v2/versions/{versionCode}/servers":{"get":{"description":"List servers associated with the given version","operationId":"ListServers","parameters":[{"$ref":"#/components/parameters/VersionCodePathParam"},{"$ref":"#/components/parameters/CursorQueryParam"},{"$ref":"#/components/parameters/LimitQueryParam"},{"$ref":"#/components/parameters/ServerOpenQueryParam"}],"responses":{"200":{"$ref":"#/components/responses/ListServersResponse"},"default":{"$ref":"#/components/responses/ErrorResponse"}},"tags":["versions","servers"]}},"/v2/versions/{versionCode}/servers/{serverKey}":{"get":{"description":"Get a server","operationId":"GetServer","parameters":[{"$ref":"#/components/parameters/VersionCodePathParam"},{"$ref":"#/components/parameters/ServerKeyPathParam"}],"responses":{"200":{"$ref":"#/components/responses/GetServerResponse"},"default":{"$ref":"#/components/responses/ErrorResponse"}},"tags":["versions","servers"]}},"/v2/versions/{versionCode}/servers/{serverKey}/building-info":{"get":{"description":"Get the given server's building info","operationId":"GetBuildingInfo","parameters":[{"$ref":"#/components/parameters/VersionCodePathParam"},{"$ref":"#/components/parameters/ServerKeyPathParam"}],"responses":{"200":{"$ref":"#/components/responses/GetBuildingInfoResponse"},"default":{"$ref":"#/components/responses/ErrorResponse"}},"tags":["versions","servers"]}},"/v2/versions/{versionCode}/servers/{serverKey}/config":{"get":{"description":"Get the given server's config","operationId":"GetServerConfig","parameters":[{"$ref":"#/components/parameters/VersionCodePathParam"},{"$ref":"#/components/parameters/ServerKeyPathParam"}],"responses":{"200":{"$ref":"#/components/responses/GetServerConfigResponse"},"default":{"$ref":"#/components/responses/ErrorResponse"}},"tags":["versions","servers"]}},"/v2/versions/{versionCode}/servers/{serverKey}/ennoblements":{"get":{"description":"List ennoblements associated with the given server","operationId":"ListEnnoblements","parameters":[{"$ref":"#/components/parameters/VersionCodePathParam"},{"$ref":"#/components/parameters/ServerKeyPathParam"},{"$ref":"#/components/parameters/CursorQueryParam"},{"$ref":"#/components/parameters/LimitQueryParam"},{"$ref":"#/components/parameters/EnnoblementSortQueryParam"},{"$ref":"#/components/parameters/SinceQueryParam"},{"$ref":"#/components/parameters/BeforeQueryParam"}],"responses":{"200":{"$ref":"#/components/responses/ListEnnoblementsResponse"},"default":{"$ref":"#/components/responses/ErrorResponse"}},"tags":["versions","servers","ennoblements"]}},"/v2/versions/{versionCode}/servers/{serverKey}/players":{"get":{"description":"List players associated with the given server","operationId":"ListServerPlayers","parameters":[{"$ref":"#/components/parameters/VersionCodePathParam"},{"$ref":"#/components/parameters/ServerKeyPathParam"},{"$ref":"#/components/parameters/CursorQueryParam"},{"$ref":"#/components/parameters/LimitQueryParam"},{"$ref":"#/components/parameters/PlayerDeletedQueryParam"},{"$ref":"#/components/parameters/PlayerSortQueryParam"},{"$ref":"#/components/parameters/PlayerNameQueryParam"},{"$ref":"#/components/parameters/PlayerIdQueryParam"}],"responses":{"200":{"$ref":"#/components/responses/ListPlayersResponse"},"default":{"$ref":"#/components/responses/ErrorResponse"}},"tags":["versions","servers","players"]}},"/v2/versions/{versionCode}/servers/{serverKey}/players/{playerId}":{"get":{"description":"Get a player","operationId":"GetPlayer","parameters":[{"$ref":"#/components/parameters/VersionCodePathParam"},{"$ref":"#/components/parameters/ServerKeyPathParam"},{"$ref":"#/components/parameters/PlayerIdPathParam"}],"responses":{"200":{"$ref":"#/components/responses/GetPlayerResponse"},"default":{"$ref":"#/components/responses/ErrorResponse"}},"tags":["versions","servers","players"]}},"/v2/versions/{versionCode}/servers/{serverKey}/players/{playerId}/ennoblements":{"get":{"description":"List the given player's ennoblements","operationId":"ListPlayerEnnoblements","parameters":[{"$ref":"#/components/parameters/VersionCodePathParam"},{"$ref":"#/components/parameters/ServerKeyPathParam"},{"$ref":"#/components/parameters/PlayerIdPathParam"},{"$ref":"#/components/parameters/CursorQueryParam"},{"$ref":"#/components/parameters/LimitQueryParam"},{"$ref":"#/components/parameters/EnnoblementSortQueryParam"},{"$ref":"#/components/parameters/SinceQueryParam"},{"$ref":"#/components/parameters/BeforeQueryParam"}],"responses":{"200":{"$ref":"#/components/responses/ListEnnoblementsResponse"},"default":{"$ref":"#/components/responses/ErrorResponse"}},"tags":["versions","servers","players","ennoblements"]}},"/v2/versions/{versionCode}/servers/{serverKey}/players/{playerId}/snapshots":{"get":{"description":"List the given player's snapshots","operationId":"ListPlayerPlayerSnapshots","parameters":[{"$ref":"#/components/parameters/VersionCodePathParam"},{"$ref":"#/components/parameters/ServerKeyPathParam"},{"$ref":"#/components/parameters/PlayerIdPathParam"},{"$ref":"#/components/parameters/CursorQueryParam"},{"$ref":"#/components/parameters/LimitQueryParam"},{"$ref":"#/components/parameters/PlayerSnapshotSortQueryParam"}],"responses":{"200":{"$ref":"#/components/responses/ListPlayerSnapshotsResponse"},"default":{"$ref":"#/components/responses/ErrorResponse"}},"tags":["versions","servers","players","snapshots"]}},"/v2/versions/{versionCode}/servers/{serverKey}/players/{playerId}/tribe-changes":{"get":{"description":"List the given player's tribe changes","operationId":"ListPlayerTribeChanges","parameters":[{"$ref":"#/components/parameters/VersionCodePathParam"},{"$ref":"#/components/parameters/ServerKeyPathParam"},{"$ref":"#/components/parameters/PlayerIdPathParam"},{"$ref":"#/components/parameters/CursorQueryParam"},{"$ref":"#/components/parameters/LimitQueryParam"},{"$ref":"#/components/parameters/TribeChangeSortQueryParam"},{"$ref":"#/components/parameters/SinceQueryParam"},{"$ref":"#/components/parameters/BeforeQueryParam"}],"responses":{"200":{"$ref":"#/components/responses/ListTribeChangesResponse"},"default":{"$ref":"#/components/responses/ErrorResponse"}},"tags":["versions","servers","players","tribe-changes"]}},"/v2/versions/{versionCode}/servers/{serverKey}/players/{playerId}/villages":{"get":{"description":"List the given player's villages","operationId":"ListPlayerVillages","parameters":[{"$ref":"#/components/parameters/VersionCodePathParam"},{"$ref":"#/components/parameters/ServerKeyPathParam"},{"$ref":"#/components/parameters/PlayerIdPathParam"},{"$ref":"#/components/parameters/CursorQueryParam"},{"$ref":"#/components/parameters/LimitQueryParam"}],"responses":{"200":{"$ref":"#/components/responses/ListVillagesResponse"},"default":{"$ref":"#/components/responses/ErrorResponse"}},"tags":["versions","servers","players","villages"]}},"/v2/versions/{versionCode}/servers/{serverKey}/tribes":{"get":{"description":"List tribes associated with the given server","operationId":"ListTribes","parameters":[{"$ref":"#/components/parameters/VersionCodePathParam"},{"$ref":"#/components/parameters/ServerKeyPathParam"},{"$ref":"#/components/parameters/CursorQueryParam"},{"$ref":"#/components/parameters/LimitQueryParam"},{"$ref":"#/components/parameters/TribeDeletedQueryParam"},{"$ref":"#/components/parameters/TribeSortQueryParam"},{"$ref":"#/components/parameters/TribeTagQueryParam"}],"responses":{"200":{"$ref":"#/components/responses/ListTribesResponse"},"default":{"$ref":"#/components/responses/ErrorResponse"}},"tags":["versions","servers","tribes"]}},"/v2/versions/{versionCode}/servers/{serverKey}/tribes/{tribeId}":{"get":{"description":"Get a tribe","operationId":"GetTribe","parameters":[{"$ref":"#/components/parameters/VersionCodePathParam"},{"$ref":"#/components/parameters/ServerKeyPathParam"},{"$ref":"#/components/parameters/TribeIdPathParam"}],"responses":{"200":{"$ref":"#/components/responses/GetTribeResponse"},"default":{"$ref":"#/components/responses/ErrorResponse"}},"tags":["versions","servers","tribes"]}},"/v2/versions/{versionCode}/servers/{serverKey}/tribes/{tribeId}/ennoblements":{"get":{"description":"List the given tribe's ennoblements","operationId":"ListTribeEnnoblements","parameters":[{"$ref":"#/components/parameters/VersionCodePathParam"},{"$ref":"#/components/parameters/ServerKeyPathParam"},{"$ref":"#/components/parameters/TribeIdPathParam"},{"$ref":"#/components/parameters/CursorQueryParam"},{"$ref":"#/components/parameters/LimitQueryParam"},{"$ref":"#/components/parameters/EnnoblementSortQueryParam"},{"$ref":"#/components/parameters/SinceQueryParam"},{"$ref":"#/components/parameters/BeforeQueryParam"}],"responses":{"200":{"$ref":"#/components/responses/ListEnnoblementsResponse"},"default":{"$ref":"#/components/responses/ErrorResponse"}},"tags":["versions","servers","tribes","ennoblements"]}},"/v2/versions/{versionCode}/servers/{serverKey}/tribes/{tribeId}/member-changes":{"get":{"description":"List the given tribe's member changes (who joined, who left, etc.)","operationId":"ListTribeMemberChanges","parameters":[{"$ref":"#/components/parameters/VersionCodePathParam"},{"$ref":"#/components/parameters/ServerKeyPathParam"},{"$ref":"#/components/parameters/TribeIdPathParam"},{"$ref":"#/components/parameters/CursorQueryParam"},{"$ref":"#/components/parameters/LimitQueryParam"},{"$ref":"#/components/parameters/TribeChangeSortQueryParam"},{"$ref":"#/components/parameters/SinceQueryParam"},{"$ref":"#/components/parameters/BeforeQueryParam"}],"responses":{"200":{"$ref":"#/components/responses/ListTribeChangesResponse"},"default":{"$ref":"#/components/responses/ErrorResponse"}},"tags":["versions","servers","tribes","tribe-changes"]}},"/v2/versions/{versionCode}/servers/{serverKey}/tribes/{tribeId}/members":{"get":{"description":"List the given tribe's members","operationId":"ListTribeMembers","parameters":[{"$ref":"#/components/parameters/VersionCodePathParam"},{"$ref":"#/components/parameters/ServerKeyPathParam"},{"$ref":"#/components/parameters/TribeIdPathParam"},{"$ref":"#/components/parameters/CursorQueryParam"},{"$ref":"#/components/parameters/LimitQueryParam"},{"$ref":"#/components/parameters/PlayerSortQueryParam"}],"responses":{"200":{"$ref":"#/components/responses/ListPlayersResponse"},"default":{"$ref":"#/components/responses/ErrorResponse"}},"tags":["versions","servers","tribes","players"]}},"/v2/versions/{versionCode}/servers/{serverKey}/tribes/{tribeId}/snapshots":{"get":{"description":"List the given tribe's snapshots","operationId":"ListTribeTribeSnapshots","parameters":[{"$ref":"#/components/parameters/VersionCodePathParam"},{"$ref":"#/components/parameters/ServerKeyPathParam"},{"$ref":"#/components/parameters/TribeIdPathParam"},{"$ref":"#/components/parameters/CursorQueryParam"},{"$ref":"#/components/parameters/LimitQueryParam"},{"$ref":"#/components/parameters/TribeSnapshotSortQueryParam"}],"responses":{"200":{"$ref":"#/components/responses/ListTribeSnapshotsResponse"},"default":{"$ref":"#/components/responses/ErrorResponse"}},"tags":["versions","servers","tribes","snapshots"]}},"/v2/versions/{versionCode}/servers/{serverKey}/tribes/{tribeId}/villages":{"get":{"description":"List the given tribe's villages","operationId":"ListTribeVillages","parameters":[{"$ref":"#/components/parameters/VersionCodePathParam"},{"$ref":"#/components/parameters/ServerKeyPathParam"},{"$ref":"#/components/parameters/TribeIdPathParam"},{"$ref":"#/components/parameters/CursorQueryParam"},{"$ref":"#/components/parameters/LimitQueryParam"}],"responses":{"200":{"$ref":"#/components/responses/ListVillagesResponse"},"default":{"$ref":"#/components/responses/ErrorResponse"}},"tags":["versions","servers","tribes","villages"]}},"/v2/versions/{versionCode}/servers/{serverKey}/unit-info":{"get":{"description":"Get the given server's unit info","operationId":"GetUnitInfo","parameters":[{"$ref":"#/components/parameters/VersionCodePathParam"},{"$ref":"#/components/parameters/ServerKeyPathParam"}],"responses":{"200":{"$ref":"#/components/responses/GetUnitInfoResponse"},"default":{"$ref":"#/components/responses/ErrorResponse"}},"tags":["versions","servers"]}},"/v2/versions/{versionCode}/servers/{serverKey}/villages":{"get":{"description":"List villages associated with the given server","operationId":"ListVillages","parameters":[{"$ref":"#/components/parameters/VersionCodePathParam"},{"$ref":"#/components/parameters/ServerKeyPathParam"},{"$ref":"#/components/parameters/CursorQueryParam"},{"$ref":"#/components/parameters/LimitQueryParam"},{"$ref":"#/components/parameters/VillageCoordsQueryParam"}],"responses":{"200":{"$ref":"#/components/responses/ListVillagesResponse"},"default":{"$ref":"#/components/responses/ErrorResponse"}},"tags":["versions","servers","villages"]}},"/v2/versions/{versionCode}/servers/{serverKey}/villages/{villageId}":{"get":{"description":"Get a village","operationId":"GetVillage","parameters":[{"$ref":"#/components/parameters/VersionCodePathParam"},{"$ref":"#/components/parameters/ServerKeyPathParam"},{"$ref":"#/components/parameters/VillageIdPathParam"}],"responses":{"200":{"$ref":"#/components/responses/GetVillageResponse"},"default":{"$ref":"#/components/responses/ErrorResponse"}},"tags":["versions","servers","villages"]}},"/v2/versions/{versionCode}/servers/{serverKey}/villages/{villageId}/ennoblements":{"get":{"description":"List the given village's ennoblements","operationId":"ListVillageEnnoblements","parameters":[{"$ref":"#/components/parameters/VersionCodePathParam"},{"$ref":"#/components/parameters/ServerKeyPathParam"},{"$ref":"#/components/parameters/VillageIdPathParam"},{"$ref":"#/components/parameters/CursorQueryParam"},{"$ref":"#/components/parameters/LimitQueryParam"},{"$ref":"#/components/parameters/EnnoblementSortQueryParam"},{"$ref":"#/components/parameters/SinceQueryParam"},{"$ref":"#/components/parameters/BeforeQueryParam"}],"responses":{"200":{"$ref":"#/components/responses/ListEnnoblementsResponse"},"default":{"$ref":"#/components/responses/ErrorResponse"}},"tags":["versions","servers","villages","ennoblements"]}}},"servers":[{"url":"https://twhelp.app/api"},{"url":"https://tribalwarshelp.com/api"}],"tags":[{"description":"Version related endpoints","name":"versions"},{"description":"Server related endpoints","name":"servers"},{"description":"Tribe related endpoints","name":"tribes"},{"description":"Player related endpoints","name":"players"},{"description":"Village related endpoints","name":"villages"},{"description":"Ennoblement (conquer) related endpoints","name":"ennoblements"},{"description":"Tribe change related endpoints","name":"tribe-changes"},{"description":"Snapshot (historical records) related endpoints","name":"snapshots"}]}