517 lines
12 KiB
TypeScript
517 lines
12 KiB
TypeScript
/**
|
|
* This file was auto-generated by openapi-typescript.
|
|
* Do not make direct changes to the file.
|
|
*/
|
|
|
|
export interface paths {
|
|
"/user/": {
|
|
/** Returns an array of all users sorted by the given sort field and ordering */
|
|
get: operations["get_all_users"];
|
|
/** Returns the created user */
|
|
post: operations["add_user"];
|
|
};
|
|
"/user/{id}": {
|
|
/** Returns a single user by id */
|
|
get: operations["get_user"];
|
|
delete: operations["delete_user"];
|
|
};
|
|
"/user/{id}/score": {
|
|
/** Returns the score of a single user by id */
|
|
get: operations["get_score"];
|
|
post: operations["set_score"];
|
|
};
|
|
"/event/": {
|
|
/** Returns all events */
|
|
get: operations["get_all_events"];
|
|
/**
|
|
* If an `id` is supplied, it will be replaced by a randomly generated one.
|
|
*
|
|
* Returns the created event.
|
|
*/
|
|
post: operations["create_event"];
|
|
};
|
|
"/event/{id}/stop": {
|
|
/** This will conclude the event, apply the outcome to the users and return the outcome. */
|
|
post: operations["stop_event"];
|
|
};
|
|
"/event/{id}": {
|
|
/** Returns the event with the given id */
|
|
get: operations["get_event"];
|
|
/** Update the supplied values in the event with the given id. The `id` of an event cannot be changed and `concluded` will always be false. */
|
|
post: operations["update_event"];
|
|
};
|
|
"/event/{id}/outcome": {
|
|
/** Returns the outcome of an event. */
|
|
get: operations["event_outcome"];
|
|
};
|
|
}
|
|
|
|
export interface components {
|
|
schemas: {
|
|
/**
|
|
* User
|
|
* @description A user that represents a person participating in the LAN party
|
|
*/
|
|
User: {
|
|
/** @description Name of the user */
|
|
name: string;
|
|
/**
|
|
* Format: int64
|
|
* @description Score of the user
|
|
*/
|
|
score: number;
|
|
/** @description Unique identifier of the user */
|
|
id: string;
|
|
};
|
|
/**
|
|
* UserSort
|
|
* @description Field used to sort users
|
|
* @enum {string}
|
|
*/
|
|
UserSort: "score" | "name" | "id";
|
|
/**
|
|
* Ordering
|
|
* @description Ordering of data in an array, ascending or descending
|
|
* @enum {string}
|
|
*/
|
|
Ordering: "desc" | "asc";
|
|
/**
|
|
* Event
|
|
* @description An event in which participants can win or lose points
|
|
*/
|
|
Event: {
|
|
/**
|
|
* @description Unique identifier of the event. This will be randomly generated and cannot be modified.
|
|
* @default 6dcf4a26-87fe-4a43-be93-f315527d104a
|
|
*/
|
|
id?: string;
|
|
/**
|
|
* @description Has this event concluded?
|
|
* @default false
|
|
*/
|
|
concluded?: boolean;
|
|
/**
|
|
* @description Name of the event
|
|
* @default
|
|
*/
|
|
name?: string;
|
|
/**
|
|
* @description Description of the event
|
|
* @default
|
|
*/
|
|
description?: string;
|
|
/** @description Event type */
|
|
event_type: components["schemas"]["EventType"];
|
|
};
|
|
/**
|
|
* EventType
|
|
* @description An enumeration of event types
|
|
*/
|
|
EventType:
|
|
| {
|
|
Test: components["schemas"]["Test"];
|
|
}
|
|
| {
|
|
TeamGame: components["schemas"]["TeamGame"];
|
|
}
|
|
| {
|
|
FreeForAllGame: components["schemas"]["FreeForAllGame"];
|
|
};
|
|
Test: {
|
|
/** Format: int64 */
|
|
num_players: number;
|
|
};
|
|
TeamGame: {
|
|
/** @description Map of teams with a name as key and an array of players as value */
|
|
teams: { [key: string]: string[] };
|
|
/** @description Ranking of participants by user id or team name (first element is first place, second element is second place, etc.) */
|
|
ranking?: components["schemas"]["FreeForAllGameRanking"] | null;
|
|
/** @description Array of user ids that participate in the game */
|
|
participants: string[];
|
|
/**
|
|
* @description Rewards for winning the game (first element for first place, second element for second place, etc.)
|
|
* @example [
|
|
* 10,
|
|
* 7,
|
|
* 5,
|
|
* 3,
|
|
* 2,
|
|
* 1
|
|
* ]
|
|
*/
|
|
win_rewards: number[];
|
|
/**
|
|
* @description Rewards for losing the game (first element for last place, second element for second to last place, etc.)
|
|
* @example [
|
|
* -3,
|
|
* -2,
|
|
* -1
|
|
* ]
|
|
*/
|
|
lose_rewards: number[];
|
|
};
|
|
FreeForAllGameRanking:
|
|
| {
|
|
Ranking: string[];
|
|
}
|
|
| {
|
|
Scores: { [key: string]: number };
|
|
};
|
|
FreeForAllGame: {
|
|
/** @description Ranking of participants by user id or team name (first element is first place, second element is second place, etc.) */
|
|
ranking?: components["schemas"]["FreeForAllGameRanking"] | null;
|
|
/** @description Array of user ids that participate in the game */
|
|
participants: string[];
|
|
/**
|
|
* @description Rewards for winning the game (first element for first place, second element for second place, etc.)
|
|
* @example [
|
|
* 10,
|
|
* 7,
|
|
* 5,
|
|
* 3,
|
|
* 2,
|
|
* 1
|
|
* ]
|
|
*/
|
|
win_rewards: number[];
|
|
/**
|
|
* @description Rewards for losing the game (first element for last place, second element for second to last place, etc.)
|
|
* @example [
|
|
* -3,
|
|
* -2,
|
|
* -1
|
|
* ]
|
|
*/
|
|
lose_rewards: number[];
|
|
};
|
|
/**
|
|
* EventSpec
|
|
* @description A specification of an event
|
|
*/
|
|
EventSpec: {
|
|
name: string;
|
|
description: string;
|
|
event_type: components["schemas"]["EventTypeSpec"];
|
|
};
|
|
/**
|
|
* EventTypeSpec
|
|
* @description A specification of an event type
|
|
*/
|
|
EventTypeSpec:
|
|
| {
|
|
Test: components["schemas"]["TestSpec"];
|
|
}
|
|
| {
|
|
TeamGame: components["schemas"]["TeamGameSpec"];
|
|
}
|
|
| {
|
|
FreeForAllGame: components["schemas"]["FreeForAllGameSpec"];
|
|
};
|
|
TestSpec: {
|
|
/** Format: int64 */
|
|
num_players: number;
|
|
};
|
|
TeamGameSpec: {
|
|
/** @description Map of teams with a name as key and an array of players as value */
|
|
teams: { [key: string]: string[] };
|
|
/**
|
|
* @description Rewards for winning the game (first element for first place, second element for second place, etc.)
|
|
* @example [
|
|
* 10,
|
|
* 7,
|
|
* 5,
|
|
* 3,
|
|
* 2,
|
|
* 1
|
|
* ]
|
|
*/
|
|
win_rewards: number[];
|
|
/**
|
|
* @description Rewards for losing the game (first element for last place, second element for second to last place, etc.)
|
|
* @example [
|
|
* -3,
|
|
* -2,
|
|
* -1
|
|
* ]
|
|
*/
|
|
lose_rewards: number[];
|
|
};
|
|
FreeForAllGameSpec: {
|
|
/** @description Array of user ids that participate in the game */
|
|
participants: string[];
|
|
/**
|
|
* @description Rewards for winning the game (first element for first place, second element for second place, etc.)
|
|
* @example [
|
|
* 10,
|
|
* 7,
|
|
* 5,
|
|
* 3,
|
|
* 2,
|
|
* 1
|
|
* ]
|
|
*/
|
|
win_rewards: number[];
|
|
/**
|
|
* @description Rewards for losing the game (first element for last place, second element for second to last place, etc.)
|
|
* @example [
|
|
* -3,
|
|
* -2,
|
|
* -1
|
|
* ]
|
|
*/
|
|
lose_rewards: number[];
|
|
};
|
|
EventOutcome: {
|
|
points: { [key: string]: number };
|
|
};
|
|
/**
|
|
* EventUpdate
|
|
* @description An update that can be applied to an event
|
|
*/
|
|
EventUpdate:
|
|
| {
|
|
Test: components["schemas"]["TestUpdate"];
|
|
}
|
|
| {
|
|
TeamGame: components["schemas"]["TeamGameUpdate"];
|
|
}
|
|
| {
|
|
FreeForAllGame: components["schemas"]["FreeForAllGameUpdate"];
|
|
};
|
|
TestUpdate: {
|
|
win_game: boolean;
|
|
};
|
|
TeamGameUpdate: Partial<components["schemas"]["TeamGameUpdateInner"]> &
|
|
Partial<components["schemas"]["TeamGameFfaInheritedUpdate"]>;
|
|
TeamGameUpdateInner:
|
|
| {
|
|
SetTeam: {
|
|
team: string;
|
|
members: string[];
|
|
};
|
|
}
|
|
| {
|
|
RemoveTeam: string;
|
|
};
|
|
TeamGameFfaInheritedUpdate: Partial<
|
|
components["schemas"]["FreeForAllGameUpdateRanking"]
|
|
> &
|
|
Partial<components["schemas"]["FreeForAllGameUpdateRewards"]>;
|
|
FreeForAllGameUpdateRanking:
|
|
| {
|
|
SetRanking: components["schemas"]["FreeForAllGameRanking"];
|
|
}
|
|
| {
|
|
ScoreDelta: { [key: string]: number };
|
|
};
|
|
FreeForAllGameUpdateRewards:
|
|
| {
|
|
SetWinRewards: number[];
|
|
}
|
|
| {
|
|
SetLoseRewards: number[];
|
|
};
|
|
FreeForAllGameUpdate: Partial<
|
|
components["schemas"]["FreeForAllGameUpdateRanking"]
|
|
> &
|
|
Partial<components["schemas"]["FreeForAllGameUpdateRewards"]> &
|
|
Partial<components["schemas"]["FreeForAllGameUpdateParticipants"]>;
|
|
FreeForAllGameUpdateParticipants:
|
|
| {
|
|
SetParticipants: string[];
|
|
}
|
|
| {
|
|
AddParticipant: string;
|
|
}
|
|
| {
|
|
RemoveParticipant: string;
|
|
};
|
|
};
|
|
}
|
|
|
|
export interface operations {
|
|
/** Returns an array of all users sorted by the given sort field and ordering */
|
|
get_all_users: {
|
|
parameters: {
|
|
query: {
|
|
sort?: components["schemas"]["UserSort"] | null;
|
|
order?: components["schemas"]["Ordering"] | null;
|
|
};
|
|
};
|
|
responses: {
|
|
200: {
|
|
content: {
|
|
"application/json": components["schemas"]["User"][];
|
|
};
|
|
};
|
|
};
|
|
};
|
|
/** Returns the created user */
|
|
add_user: {
|
|
responses: {
|
|
201: {
|
|
content: {
|
|
"application/json": components["schemas"]["User"];
|
|
};
|
|
};
|
|
};
|
|
requestBody: {
|
|
content: {
|
|
"application/json": string;
|
|
};
|
|
};
|
|
};
|
|
/** Returns a single user by id */
|
|
get_user: {
|
|
parameters: {
|
|
path: {
|
|
id: string;
|
|
};
|
|
};
|
|
responses: {
|
|
200: {
|
|
content: {
|
|
"application/json": components["schemas"]["User"];
|
|
};
|
|
};
|
|
};
|
|
};
|
|
delete_user: {
|
|
parameters: {
|
|
path: {
|
|
id: string;
|
|
};
|
|
};
|
|
responses: {
|
|
default: unknown;
|
|
};
|
|
};
|
|
/** Returns the score of a single user by id */
|
|
get_score: {
|
|
parameters: {
|
|
path: {
|
|
id: string;
|
|
};
|
|
};
|
|
responses: {
|
|
200: {
|
|
content: {
|
|
"application/json": number;
|
|
};
|
|
};
|
|
};
|
|
};
|
|
set_score: {
|
|
parameters: {
|
|
path: {
|
|
id: string;
|
|
};
|
|
};
|
|
responses: {
|
|
default: unknown;
|
|
};
|
|
requestBody: {
|
|
content: {
|
|
"application/json": number;
|
|
};
|
|
};
|
|
};
|
|
/** Returns all events */
|
|
get_all_events: {
|
|
parameters: {
|
|
query: {
|
|
concluded?: boolean | null;
|
|
};
|
|
};
|
|
responses: {
|
|
200: {
|
|
content: {
|
|
"application/json": components["schemas"]["Event"][];
|
|
};
|
|
};
|
|
};
|
|
};
|
|
/**
|
|
* If an `id` is supplied, it will be replaced by a randomly generated one.
|
|
*
|
|
* Returns the created event.
|
|
*/
|
|
create_event: {
|
|
responses: {
|
|
200: {
|
|
content: {
|
|
"application/json": components["schemas"]["Event"];
|
|
};
|
|
};
|
|
};
|
|
requestBody: {
|
|
content: {
|
|
"application/json": components["schemas"]["EventSpec"];
|
|
};
|
|
};
|
|
};
|
|
/** This will conclude the event, apply the outcome to the users and return the outcome. */
|
|
stop_event: {
|
|
parameters: {
|
|
path: {
|
|
id: string;
|
|
};
|
|
};
|
|
responses: {
|
|
200: {
|
|
content: {
|
|
"application/json": components["schemas"]["EventOutcome"];
|
|
};
|
|
};
|
|
};
|
|
};
|
|
/** Returns the event with the given id */
|
|
get_event: {
|
|
parameters: {
|
|
path: {
|
|
id: string;
|
|
};
|
|
};
|
|
responses: {
|
|
200: {
|
|
content: {
|
|
"application/json": components["schemas"]["Event"];
|
|
};
|
|
};
|
|
};
|
|
};
|
|
/** Update the supplied values in the event with the given id. The `id` of an event cannot be changed and `concluded` will always be false. */
|
|
update_event: {
|
|
parameters: {
|
|
path: {
|
|
id: string;
|
|
};
|
|
};
|
|
responses: {
|
|
default: unknown;
|
|
};
|
|
requestBody: {
|
|
content: {
|
|
"application/json": components["schemas"]["EventUpdate"];
|
|
};
|
|
};
|
|
};
|
|
/** Returns the outcome of an event. */
|
|
event_outcome: {
|
|
parameters: {
|
|
path: {
|
|
id: string;
|
|
};
|
|
};
|
|
responses: {
|
|
200: {
|
|
content: {
|
|
"application/json": components["schemas"]["EventOutcome"];
|
|
};
|
|
};
|
|
};
|
|
};
|
|
}
|
|
|
|
export interface external {}
|