Files
ToneAPI_backend/reference/OpenAPI.yml
T
2023-03-13 12:55:54 +01:00

770 lines
21 KiB
YAML

openapi: 3.0.2
x-stoplight:
id: gr7tm5a03g740
info:
title: OpenAPI
version: '1.0'
servers:
- url: 'http://127.0.0.1:3001/v1'
tags:
- name: player
description: Everything about players
- name: server
description: Everything about servers
- name: weapon
description: Everything about weapons
- name: map
description: Everything about maps
paths:
/weapons/:
get:
summary: List Weapons
tags:
- weapon
responses:
'200':
description: OK
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/Weapon'
operationId: get-weapon-list
description: ''
/maps/:
get:
summary: List Maps
tags:
- map
responses:
'200':
description: OK
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/Map'
operationId: get-map-list
/client/servers/:
get:
summary: Get Server list
tags:
- server
responses:
'200':
description: OK
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/Server'
operationId: get-server-list
parameters: []
'/client/server/{serverId}/players':
get:
summary: List Players for Server
tags:
- server
- player
responses:
'200':
description: OK
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/TopPlayers'
operationId: get-player-list-for-server
parameters:
- name: serverId
in: path
required: true
schema:
type: string
'/client/servers/{serverId}/weapons':
get:
summary: Get Weapon report for server
tags:
- server
- weapon
responses:
'200':
description: OK
content:
application/json:
schema:
type: object
properties:
doubletake:
type: string
arc_launcher:
type: string
mastiff:
type: string
softball:
type: string
wingman:
type: string
invalid:
type: string
grenade_sonar:
type: string
semipistol:
type: string
grenade_electric_smoke:
type: string
sniper:
type: string
shotgun_pistol:
type: string
shotgun:
type: string
frag_grenade:
type: string
smr:
type: string
fall:
type: string
epg:
type: string
human_execution:
type: string
pilot_emptyhanded:
type: string
defender:
type: string
thermite_grenade:
type: string
satchel:
type: string
wingman_n:
type: string
x-examples:
Example 1:
doubletake: '119'
arc_launcher: '1'
mastiff: '359'
softball: '137'
wingman: '87'
invalid: '20'
grenade_sonar: '30'
semipistol: '177'
grenade_electric_smoke: '12'
sniper: '1104'
shotgun_pistol: '94'
shotgun: '66'
frag_grenade: '1'
smr: '27'
fall: '1'
epg: '265'
human_execution: '4'
pilot_emptyhanded: '65'
defender: '62'
thermite_grenade: '150'
satchel: '64'
wingman_n: '620'
examples:
Example 1:
value:
doubletake: '119'
arc_launcher: '1'
mastiff: '359'
softball: '137'
wingman: '87'
invalid: '20'
grenade_sonar: '30'
semipistol: '177'
grenade_electric_smoke: '12'
sniper: '1104'
shotgun_pistol: '94'
shotgun: '66'
frag_grenade: '1'
smr: '27'
fall: '1'
epg: '265'
human_execution: '4'
pilot_emptyhanded: '65'
defender: '62'
thermite_grenade: '150'
satchel: '64'
wingman_n: '620'
operationId: get-weapons-report-for-server
parameters: []
x-internal: false
parameters:
- name: serverId
in: path
required: true
schema:
type: string
'/client/servers/{serverId}/players/{playerId}':
parameters:
- name: playerId
in: path
required: true
schema:
type: integer
- name: serverId
in: path
required: true
schema:
type: integer
get:
summary: Get Player report for Server
tags:
- server
- player
responses:
'200':
$ref: '#/components/responses/Player-server-report'
'404':
description: Not Found
operationId: get-player-on-server
'/servers/{serverId}':
parameters:
- $ref: '#/components/parameters/serverId'
post:
summary: ''
operationId: post-servers-serverId
responses:
'200':
description: OK
'403':
description: Forbidden
description: Used to test auth
security:
- Auth_Token: []
/servers/register:
post:
summary: ''
operationId: post-servers-register
responses:
'201':
description: Created
content:
application/json:
schema:
type: object
properties:
id:
type: integer
token:
type: string
'403':
description: Forbidden
requestBody:
content:
application/json:
schema:
type: object
properties:
name:
type: string
description: The name of your server as it appears on Northstar
description:
type: string
description: The description of your server as it appears on Northstar
auth_port:
type: integer
format: uri
example: 8081
description: 'In most cases, this is the IP address of your server with the TCP port you forwarded'
x-stoplight:
id: r9pi7wq6mp6tm
minimum: 0
maximum: 65535
required:
- name
- description
- auth_port
description: ''
description: |-
Register a server on Tone API.
The server needs to be online on masterserver and reacheable by Tone.
x-internal: true
'/servers/{serverId}/kills':
post:
summary: Post kills
tags:
- server
operationId: post-kills
responses:
'201':
description: Created
'400':
description: Bad Request
'401':
description: Unauthorized
parameters: []
security:
- Auth_Token: []
description: Allows a Northstar server to record kills on the database
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/Kill'
description: ''
parameters:
- $ref: '#/components/parameters/serverId'
components:
schemas:
Player:
title: Player
x-stoplight:
id: be41fcacb2693
type: object
properties:
id:
$ref: '#/components/schemas/PlayerID'
name:
type: string
example: Legonzaur
opt-out:
type: boolean
default: false
description: 'If set to true, kills and deaths about this user won''t be sent to the database'
hide_TOS:
type: boolean
default: false
description: 'If set to true, TOS will be hidden when player joins a server'
required:
- id
Weapon:
title: Weapon
x-stoplight:
id: 7zc6t20eh3pcc
type: object
properties:
id:
$ref: '#/components/schemas/WeaponID'
name:
type: string
example: Kraber
description:
type: string
image:
type: string
format: uri
example: 'https://static.wikia.nocookie.net/titanfall_gamepedia/images/8/8b/Icon_kraber.png'
required:
- id
Map:
title: Map
x-stoplight:
id: hoh2m6pr6gli7
type: object
properties:
id:
$ref: '#/components/schemas/MapID'
name:
type: string
example: Angel City
description:
type: string
image:
type: string
format: uri
example: 'https://media.contentapi.ea.com/content/dam/eacom/en-us/common/articles-tf2-welcome-header.jpg.adapt.320w.jpg'
required:
- id
Server:
title: Server
x-stoplight:
id: hjfwmi2ae419o
type: object
properties:
id:
type: integer
example: 1
name:
type: string
example: fvnknoots 7v7
description:
type: string
Kill:
title: Kill
x-stoplight:
id: a9q2tvsts3z32
type: object
x-examples:
Example 1:
id: 0
server: string
tone_version: ks_3.0.0
match_id: 1cde15ee
game_mode: tdm
map: string
game_time: 385.417
player_count: 1
attacker_name: Legonzaur
attacker_id: 0
attacker_current_weapon: rspn101
attacker_current_weapon_mods: 0
attacker_weapon_1: rspn101
attacker_weapon_1_mods: 0
attacker_weapon_2: autopistol
attacker_weapon_2_mods: 0
attacker_weapon_3: defender
attacker_weapon_3_mods: 0
attacker_offhand_weapon_1: 0
attacker_offhand_weapon_2: 8
victim_name: Legonzaur
victim_id: 0
victim_current_weapon: rspn101
victim_current_weapon_mods: 0
victim_weapon_1: rspn101
victim_weapon_1_mods: 0
victim_weapon_2: autopistol
victim_weapon_2_mods: 0
victim_weapon_3: defender
victim_weapon_3_mods: 0
victim_offhand_weapon_1: 0
victim_offhand_weapon_2: 8
cause_of_death: frag_grenade
distance: 0
properties:
id:
type: integer
readOnly: true
server:
type: string
readOnly: true
tone_version:
type: string
match_id:
type: string
game_mode:
type: string
map:
type: string
game_time:
type: string
format: time
player_count:
type: integer
attacker_name:
type: string
attacker_id:
type: integer
attacker_current_weapon:
type: string
attacker_current_weapon_mods:
type: integer
attacker_weapon_1:
type: string
attacker_weapon_1_mods:
type: integer
attacker_weapon_2:
type: string
attacker_weapon_2_mods:
type: integer
attacker_weapon_3:
type: string
attacker_weapon_3_mods:
type: integer
attacker_offhand_weapon_1:
type: integer
attacker_offhand_weapon_2:
type: integer
victim_name:
type: string
victim_id:
type: integer
victim_current_weapon:
type: string
victim_current_weapon_mods:
type: integer
victim_weapon_1:
type: string
victim_weapon_1_mods:
type: integer
victim_weapon_2:
type: string
victim_weapon_2_mods:
type: integer
victim_weapon_3:
type: string
victim_weapon_3_mods:
type: integer
victim_offhand_weapon_1:
type: integer
victim_offhand_weapon_2:
type: integer
cause_of_death:
type: string
distance:
type: number
required:
- cause_of_death
PlayerID:
title: PlayerId
x-stoplight:
id: 9icavmq5bgsqp
type: integer
WeaponID:
title: WeaponID
x-stoplight:
id: p92aomkxku2po
type: string
maxLength: 50
MapID:
title: MapID
x-stoplight:
id: zoazw8eoi7qwr
type: string
maxLength: 50
PrefferredServer:
title: PrefferredServer
x-stoplight:
id: xok1i1668gx6o
type: object
properties:
server:
$ref: '#/components/schemas/Server'
killCount:
type: integer
example: 4988
deathCount:
type: integer
example: 4671
PrefferedWeapon:
title: PrefferedWeapon
x-stoplight:
id: b52mxxdsbv1wx
type: object
properties:
weapon:
$ref: '#/components/schemas/Weapon'
killCount:
type: integer
deathCount:
type: integer
PrefferedMap:
title: PrefferedMap
x-stoplight:
id: 17kjfi5wu6f4h
type: object
properties:
map:
$ref: '#/components/schemas/Map'
killCount:
type: integer
deathCount:
type: integer
TopPlayers:
title: TopPlayers
x-stoplight:
id: rsl4jqpvwunah
type: object
properties:
player:
$ref: '#/components/schemas/Player'
kill_count:
type: integer
death_count:
type: integer
securitySchemes:
Auth_Token:
type: http
scheme: basic
parameters:
serverId:
name: serverId
in: path
required: true
schema:
type: string
playerId:
name: playerId
in: path
required: true
schema:
type: string
responses:
Server-report:
description: OK
content:
application/json:
schema:
type: object
properties:
server:
$ref: '#/components/schemas/Server'
total_kills:
type: integer
first_record:
type: string
format: date-time
last_record:
type: string
format: date-time
most_used_weapons:
type: array
items:
$ref: '#/components/schemas/PrefferedWeapon'
preffered_maps:
type: array
items:
$ref: '#/components/schemas/PrefferedMap'
top_players:
type: array
maxItems: 5
items:
$ref: '#/components/schemas/TopPlayers'
Player-server-report:
description: OK
content:
application/json:
schema:
type: object
properties:
player:
$ref: '#/components/schemas/Player'
server:
$ref: '#/components/schemas/Server'
total_kills:
type: integer
description: Number of kills of the user in this server
total_deaths:
type: integer
description: Number of deaths of the user in this server
first_record:
type: string
format: date-time
last_record:
type: string
format: date-time
most_used_weapons:
type: array
maxItems: 5
items:
$ref: '#/components/schemas/PrefferedWeapon'
preferred_maps:
type: array
maxItems: 5
items:
$ref: '#/components/schemas/PrefferedMap'
furthest_kill_distance:
type: number
average_kill_distance:
type: number
examples:
Example 1:
value:
player:
id: 0
name: Legonzaur
opt-out: false
hide_TOS: false
server:
id: '1'
name: fvnknoots 7v7
total_kills: 9865
total_deaths: 9954
first_record: '2019-08-24T14:15:22Z'
last_record: '2019-08-24T14:15:22Z'
most_used_weapons:
- weapon:
id: 0
internal: mp_weapon_sniper
name: Kraber
description: string
image: 'https://static.wikia.nocookie.net/titanfall_gamepedia/images/8/8b/Icon_kraber.png'
killCount: 0
deathCount: 0
preferred_maps:
- map:
id: 0
internal: mp_angel_city
name: Angel City
description: string
image: 'https://media.contentapi.ea.com/content/dam/eacom/en-us/common/articles-tf2-welcome-header.jpg.adapt.320w.jpg'
killCount: 0
deathCount: 0
furthest_kill_distance: 0
average_kill_distance: 0
Player-report:
description: OK
content:
application/json:
schema:
type: object
properties:
player:
$ref: '#/components/schemas/Player'
preferred_servers:
type: array
maxItems: 5
items:
$ref: '#/components/schemas/PrefferredServer'
total_kills:
type: integer
description: Number of kills of the user in the entire database
total_deaths:
type: integer
description: Number of kills of the user in the entire database
first_record:
type: string
format: date-time
last_record:
type: string
format: date-time
most_used_weapons:
type: array
maxItems: 5
items:
$ref: '#/components/schemas/PrefferedWeapon'
preferred_maps:
type: array
maxItems: 5
items:
$ref: '#/components/schemas/PrefferedMap'
furthest_kill_distance:
type: number
average_kill_distance:
type: number
examples:
Example 1:
value:
player:
id: 0
name: Legonzaur
opt-out: false
hide_TOS: false
preferred_servers:
- server:
id: '1'
name: fvnknoots 7v7
killCount: 4988
deathCount: 4671
total_kills: 0
total_deaths: 0
first_record: '2019-08-24T14:15:22Z'
last_record: '2019-08-24T14:15:22Z'
most_used_weapons:
- weapon:
id: 0
internal: mp_weapon_sniper
name: Kraber
description: string
image: 'https://static.wikia.nocookie.net/titanfall_gamepedia/images/8/8b/Icon_kraber.png'
killCount: 0
deathCount: 0
preferred_maps:
- map:
id: 0
internal: mp_angel_city
name: Angel City
description: string
image: 'https://media.contentapi.ea.com/content/dam/eacom/en-us/common/articles-tf2-welcome-header.jpg.adapt.320w.jpg'
killCount: 0
deathCount: 0
furthest_kill_distance: 0
average_kill_distance: 0
examples: {}