From 4eab2372b7e2a047516093db1c66c986b4ba399f Mon Sep 17 00:00:00 2001 From: legonzaur Date: Tue, 4 Apr 2023 19:00:20 +0200 Subject: [PATCH] change documentation to redocly --- docs/README.md | 1 - docs/index.html | 444 +++++++++++++++++++++++++++++++++-- docs/{OpenAPI.yml => v1.yml} | 0 package.json | 2 +- 4 files changed, 430 insertions(+), 17 deletions(-) delete mode 100644 docs/README.md rename docs/{OpenAPI.yml => v1.yml} (100%) diff --git a/docs/README.md b/docs/README.md deleted file mode 100644 index 1320e70..0000000 --- a/docs/README.md +++ /dev/null @@ -1 +0,0 @@ -[Check the documentation](https://legonzaur.github.io/ToneAPI_backend/openapi) diff --git a/docs/index.html b/docs/index.html index b2976fb..ddc1b80 100644 --- a/docs/index.html +++ b/docs/index.html @@ -1,17 +1,431 @@ - + + - - - -ToneAPI v1 -
- - \ No newline at end of file + + ToneAPI + + + + + + + + + +

ToneAPI (1.0)

Download OpenAPI specification:Download

Stats tracking API for Titanfall 2 Northstar

+

List of servers

An array containing the list of servers as objects

+

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Statistics for all weapons

A JSON Object with weapon IDs as key and weapon data as value

+
query Parameters
server
number
Example: server=2

Fetch data for specific server

+
player
number
Example: player=1005930844007

Fetch data for specific player

+

Responses

Response samples

Content type
application/json
{
  • "hemlock": {
    },
  • "lstar": {
    }
}

Statistics for a single weapon

Data for a specific weapon

+
path Parameters
weaponId
required
string
Example: epg

ID of a weapon

+
query Parameters
server
number
Example: server=2

Fetch data for specific server

+
player
number
Example: player=1005930844007

Fetch data for specific player

+

Responses

Response samples

Content type
application/json
{
  • "max_kill_distance": 0,
  • "avg_kill_distance": 0,
  • "kills": 0
}

Statistics for all players

A JSON Object with player IDs as key and player data as value

+
query Parameters
weapon
string
Example: weapon=epg

Fetch data for specific weapon

+
server
number
Example: server=2

Fetch data for specific server

+

Responses

Response samples

Content type
application/json
{
  • "2250125460": {
    }
}

Statistics for a single player

Data for a specific player

+
path Parameters
playerId
required
string

ID of a player

+
query Parameters
server
number
Example: server=2

Fetch data for specific server

+
weapon
string
Example: weapon=epg

Fetch data for specific weapon

+

Responses

Response samples

Content type
application/json
{
  • "name": "Legonzaur",
  • "deaths": 0,
  • "kills": 0,
  • "max_kill_distance": 0,
  • "avg_kill_distance": 0
}

post-servers-serverId

Used to test auth

+
Authorizations:
Auth_Token
path Parameters
serverId
required
string
Example: 2

ID of the server

+

Responses

Post kills

Allows a Northstar server to record kills on the database

+
Authorizations:
Auth_Token
path Parameters
serverId
required
string
Example: 2

ID of the server

+
Request Body schema: application/json
tone_version
string
match_id
string
game_mode
string
map
string
game_time
string <time>
player_count
integer
attacker_name
string
attacker_id
integer
attacker_current_weapon
string
attacker_current_weapon_mods
integer
attacker_weapon_1
string
attacker_weapon_1_mods
integer
attacker_weapon_2
string
attacker_weapon_2_mods
integer
attacker_weapon_3
string
attacker_weapon_3_mods
integer
attacker_offhand_weapon_1
integer
attacker_offhand_weapon_2
integer
victim_name
string
victim_id
integer
victim_current_weapon
string
victim_current_weapon_mods
integer
victim_weapon_1
string
victim_weapon_1_mods
integer
victim_weapon_2
string
victim_weapon_2_mods
integer
victim_weapon_3
string
victim_weapon_3_mods
integer
victim_offhand_weapon_1
integer
victim_offhand_weapon_2
integer
cause_of_death
required
string
distance
number

Responses

Request samples

Content type
application/json
{
  • "tone_version": "string",
  • "match_id": "string",
  • "game_mode": "string",
  • "map": "string",
  • "game_time": "14:15:22Z",
  • "player_count": 0,
  • "attacker_name": "string",
  • "attacker_id": 0,
  • "attacker_current_weapon": "string",
  • "attacker_current_weapon_mods": 0,
  • "attacker_weapon_1": "string",
  • "attacker_weapon_1_mods": 0,
  • "attacker_weapon_2": "string",
  • "attacker_weapon_2_mods": 0,
  • "attacker_weapon_3": "string",
  • "attacker_weapon_3_mods": 0,
  • "attacker_offhand_weapon_1": 0,
  • "attacker_offhand_weapon_2": 0,
  • "victim_name": "string",
  • "victim_id": 0,
  • "victim_current_weapon": "string",
  • "victim_current_weapon_mods": 0,
  • "victim_weapon_1": "string",
  • "victim_weapon_1_mods": 0,
  • "victim_weapon_2": "string",
  • "victim_weapon_2_mods": 0,
  • "victim_weapon_3": "string",
  • "victim_weapon_3_mods": 0,
  • "victim_offhand_weapon_1": 0,
  • "victim_offhand_weapon_2": 0,
  • "cause_of_death": "string",
  • "distance": 0
}
+ + + + diff --git a/docs/OpenAPI.yml b/docs/v1.yml similarity index 100% rename from docs/OpenAPI.yml rename to docs/v1.yml diff --git a/package.json b/package.json index faddf34..8295458 100644 --- a/package.json +++ b/package.json @@ -33,7 +33,7 @@ "startServer": "node out/serverMain.js", "startClient": "node out/clientMain.js", "startProcess": "node out/processMain.js", - "documentation": "widdershins reference/OpenAPI.yml -o docs/openapi.md --language_tabs javascript:JavaScript:request.", + "documentation": "redocly build-docs .\\docs\\v1.yml --output=docs\\index.html", "test": "jest" } } \ No newline at end of file