basePath: /api/v1 definitions: handlers.ChapterMapsResponse: properties: chapter: $ref: '#/definitions/models.Chapter' maps: items: $ref: '#/definitions/models.MapSelect' type: array type: object handlers.ChaptersResponse: properties: chapters: items: $ref: '#/definitions/models.Chapter' type: array game: $ref: '#/definitions/models.Game' type: object handlers.CreateMapDiscussionCommentRequest: properties: comment: type: string required: - comment type: object handlers.CreateMapDiscussionRequest: properties: content: type: string title: type: string required: - content - title type: object handlers.CreateMapSummaryRequest: properties: category_id: type: integer description: type: string record_date: type: string score_count: type: integer showcase: type: string user_name: type: string required: - category_id - description - record_date - score_count - user_name type: object handlers.DeleteMapSummaryRequest: properties: route_id: type: integer required: - route_id type: object handlers.EditMapDiscussionRequest: properties: content: type: string title: type: string required: - content - title type: object handlers.EditMapImageRequest: properties: image: type: string required: - image type: object handlers.EditMapSummaryRequest: properties: description: type: string record_date: type: string route_id: type: integer score_count: type: integer showcase: type: string user_name: type: string required: - description - record_date - route_id - score_count - user_name type: object handlers.LoginResponse: properties: token: type: string type: object handlers.LogsResponse: properties: logs: items: $ref: '#/definitions/handlers.LogsResponseDetails' type: array type: object handlers.LogsResponseDetails: properties: date: type: string detail: type: string message: type: string user: $ref: '#/definitions/models.UserShort' type: object handlers.MapDiscussion: properties: comments: items: $ref: '#/definitions/handlers.MapDiscussionComment' type: array content: type: string created_at: description: Upvotes int `json:"upvotes"` type: string creator: $ref: '#/definitions/models.UserShortWithAvatar' id: type: integer title: type: string updated_at: type: string type: object handlers.MapDiscussionComment: properties: comment: type: string date: type: string user: $ref: '#/definitions/models.UserShortWithAvatar' type: object handlers.MapDiscussionResponse: properties: discussion: $ref: '#/definitions/handlers.MapDiscussion' type: object handlers.MapDiscussionsResponse: properties: discussions: items: $ref: '#/definitions/handlers.MapDiscussion' type: array type: object handlers.MapLeaderboardsResponse: properties: map: $ref: '#/definitions/models.Map' pagination: $ref: '#/definitions/models.Pagination' records: {} type: object handlers.MapShortWithGame: properties: chapter: type: string game: type: string id: type: integer map: type: string type: object handlers.MapSummaryResponse: properties: map: $ref: '#/definitions/models.Map' summary: $ref: '#/definitions/models.MapSummary' type: object handlers.ProfileRankings: properties: cooperative: $ref: '#/definitions/handlers.ProfileRankingsDetails' overall: $ref: '#/definitions/handlers.ProfileRankingsDetails' singleplayer: $ref: '#/definitions/handlers.ProfileRankingsDetails' type: object handlers.ProfileRankingsDetails: properties: completion_count: type: integer completion_total: type: integer rank: type: integer type: object handlers.ProfileRecords: properties: category_id: type: integer game_id: type: integer map_id: type: integer map_name: type: string map_wr_count: type: integer placement: type: integer scores: items: $ref: '#/definitions/handlers.ProfileScores' type: array type: object handlers.ProfileResponse: properties: avatar_link: type: string country_code: type: string links: $ref: '#/definitions/models.Links' pagination: $ref: '#/definitions/models.Pagination' profile: type: boolean rankings: $ref: '#/definitions/handlers.ProfileRankings' records: items: $ref: '#/definitions/handlers.ProfileRecords' type: array steam_id: type: string titles: items: $ref: '#/definitions/models.Title' type: array user_name: type: string type: object handlers.ProfileScores: properties: date: type: string demo_id: type: string record_id: type: integer score_count: type: integer score_time: type: integer type: object handlers.RankingsResponse: properties: rankings_multiplayer: items: $ref: '#/definitions/models.UserRanking' type: array rankings_overall: items: $ref: '#/definitions/models.UserRanking' type: array rankings_singleplayer: items: $ref: '#/definitions/models.UserRanking' type: array type: object handlers.RankingsSteamResponse: properties: rankings_multiplayer: items: $ref: '#/definitions/handlers.SteamUserRanking' type: array rankings_overall: items: $ref: '#/definitions/handlers.SteamUserRanking' type: array rankings_singleplayer: items: $ref: '#/definitions/handlers.SteamUserRanking' type: array type: object handlers.RecordResponse: properties: score_count: type: integer score_time: type: integer type: object handlers.ScoreLogsResponse: properties: scores: items: $ref: '#/definitions/handlers.ScoreLogsResponseDetails' type: array type: object handlers.ScoreLogsResponseDetails: properties: date: type: string demo_id: type: string game: $ref: '#/definitions/models.Game' map: $ref: '#/definitions/models.MapShort' score_count: type: integer score_time: type: integer user: $ref: '#/definitions/models.UserShort' type: object handlers.SearchResponse: properties: maps: items: $ref: '#/definitions/handlers.MapShortWithGame' type: array players: items: $ref: '#/definitions/models.UserShortWithAvatar' type: array type: object handlers.SteamUserRanking: properties: avatar_link: type: string mp_rank: type: integer mp_score: type: integer overall_rank: type: integer overall_score: type: integer sp_rank: type: integer sp_score: type: integer steam_id: type: string user_name: type: string type: object models.Category: properties: id: type: integer name: type: string type: object models.CategoryPortal: properties: category: $ref: '#/definitions/models.Category' portal_count: type: integer type: object models.Chapter: properties: id: type: integer image: type: string is_disabled: type: boolean name: type: string type: object models.Game: properties: category_portals: items: $ref: '#/definitions/models.CategoryPortal' type: array id: type: integer image: type: string is_coop: type: boolean name: type: string type: object models.Links: properties: p2sr: type: string steam: type: string twitch: type: string youtube: type: string type: object models.Map: properties: chapter_name: type: string game_name: type: string id: type: integer image: type: string is_coop: type: boolean is_disabled: type: boolean map_name: type: string type: object models.MapHistory: properties: date: type: string runner_name: type: string score_count: type: integer type: object models.MapRoute: properties: category: $ref: '#/definitions/models.Category' completion_count: type: integer description: type: string history: $ref: '#/definitions/models.MapHistory' rating: type: number route_id: type: integer showcase: type: string type: object models.MapSelect: properties: category_portals: items: $ref: '#/definitions/models.CategoryPortal' type: array difficulty: type: integer id: type: integer image: type: string is_disabled: type: boolean name: type: string type: object models.MapShort: properties: difficulty: type: integer id: type: integer image: type: string is_disabled: type: boolean name: type: string portal_count: type: integer type: object models.MapSummary: properties: routes: items: $ref: '#/definitions/models.MapRoute' type: array type: object models.Pagination: properties: current_page: type: integer page_size: type: integer total_pages: type: integer total_records: type: integer type: object models.Response: properties: data: {} message: type: string success: type: boolean type: object models.Title: properties: color: type: string name: type: string type: object models.UserRanking: properties: placement: type: integer total_score: type: integer user: $ref: '#/definitions/models.UserShortWithAvatar' type: object models.UserShort: properties: steam_id: type: string user_name: type: string type: object models.UserShortWithAvatar: properties: avatar_link: type: string steam_id: type: string user_name: type: string type: object host: lp.ardapektezol.com info: contact: {} description: Backend API endpoints for the Least Portals Database. license: name: GNU Affero General Public License, Version 3 url: https://www.gnu.org/licenses/agpl-3.0.html title: Least Portals Database API version: "1.0" paths: /chapters/{chapterid}: get: description: Get maps from the specified chapter id. parameters: - description: Chapter ID in: path name: chapterid required: true type: integer produces: - application/json responses: "200": description: OK schema: allOf: - $ref: '#/definitions/models.Response' - properties: data: $ref: '#/definitions/handlers.ChapterMapsResponse' type: object "400": description: Bad Request schema: $ref: '#/definitions/models.Response' tags: - games & chapters /demos: get: consumes: - application/json description: Get demo with specified demo uuid. parameters: - description: Demo UUID in: query name: uuid required: true type: string produces: - application/octet-stream responses: "200": description: Demo File schema: type: file tags: - demo /games: get: description: Get games from the leaderboards. produces: - application/json responses: "200": description: OK schema: allOf: - $ref: '#/definitions/models.Response' - properties: data: items: $ref: '#/definitions/models.Game' type: array type: object "400": description: Bad Request schema: $ref: '#/definitions/models.Response' tags: - games & chapters /games/{gameid}: get: description: Get chapters from the specified game id. parameters: - description: Game ID in: path name: gameid required: true type: integer produces: - application/json responses: "200": description: OK schema: allOf: - $ref: '#/definitions/models.Response' - properties: data: $ref: '#/definitions/handlers.ChaptersResponse' type: object tags: - games & chapters /games/{gameid}/maps: get: description: Get maps from the specified game id. parameters: - description: Game ID in: path name: gameid required: true type: integer produces: - application/json responses: "200": description: OK schema: allOf: - $ref: '#/definitions/models.Response' - properties: data: $ref: '#/definitions/handlers.ChaptersResponse' type: object tags: - games & chapters /login: get: consumes: - application/json description: Get (redirect) login page for Steam auth. produces: - application/json responses: "200": description: OK schema: allOf: - $ref: '#/definitions/models.Response' - properties: data: $ref: '#/definitions/handlers.LoginResponse' type: object tags: - login /logs/mod: get: description: Get mod logs. parameters: - description: JWT Token in: header name: Authorization required: true type: string produces: - application/json responses: "200": description: OK schema: allOf: - $ref: '#/definitions/models.Response' - properties: data: $ref: '#/definitions/handlers.LogsResponse' type: object tags: - logs /logs/score: get: description: Get score logs of every player. produces: - application/json responses: "200": description: OK schema: allOf: - $ref: '#/definitions/models.Response' - properties: data: $ref: '#/definitions/handlers.ScoreLogsResponse' type: object tags: - logs /maps/{mapid}/discussions: get: description: Get map discussions with specified map id. parameters: - description: Map ID in: path name: mapid required: true type: integer produces: - application/json responses: "200": description: OK schema: allOf: - $ref: '#/definitions/models.Response' - properties: data: $ref: '#/definitions/handlers.MapDiscussionsResponse' type: object tags: - maps / discussions post: description: Create map discussion with specified map id. parameters: - description: JWT Token in: header name: Authorization required: true type: string - description: Map ID in: path name: mapid required: true type: integer - description: Body in: body name: request required: true schema: $ref: '#/definitions/handlers.CreateMapDiscussionRequest' produces: - application/json responses: "200": description: OK schema: allOf: - $ref: '#/definitions/models.Response' - properties: data: $ref: '#/definitions/handlers.CreateMapDiscussionRequest' type: object tags: - maps / discussions /maps/{mapid}/discussions/{discussionid}: delete: description: Delete map discussion with specified map id. parameters: - description: JWT Token in: header name: Authorization required: true type: string - description: Map ID in: path name: mapid required: true type: integer - description: Discussion ID in: path name: discussionid required: true type: integer produces: - application/json responses: "200": description: OK schema: $ref: '#/definitions/models.Response' tags: - maps / discussions get: description: Get map discussion with specified map and discussion id. parameters: - description: Map ID in: path name: mapid required: true type: integer - description: Discussion ID in: path name: discussionid required: true type: integer produces: - application/json responses: "200": description: OK schema: allOf: - $ref: '#/definitions/models.Response' - properties: data: $ref: '#/definitions/handlers.MapDiscussionResponse' type: object tags: - maps / discussions post: description: Create map discussion comment with specified map id. parameters: - description: JWT Token in: header name: Authorization required: true type: string - description: Map ID in: path name: mapid required: true type: integer - description: Discussion ID in: path name: discussionid required: true type: integer - description: Body in: body name: request required: true schema: $ref: '#/definitions/handlers.CreateMapDiscussionCommentRequest' produces: - application/json responses: "200": description: OK schema: allOf: - $ref: '#/definitions/models.Response' - properties: data: $ref: '#/definitions/handlers.CreateMapDiscussionCommentRequest' type: object tags: - maps / discussions put: description: Edit map discussion with specified map id. parameters: - description: JWT Token in: header name: Authorization required: true type: string - description: Map ID in: path name: mapid required: true type: integer - description: Discussion ID in: path name: discussionid required: true type: integer - description: Body in: body name: request required: true schema: $ref: '#/definitions/handlers.EditMapDiscussionRequest' produces: - application/json responses: "200": description: OK schema: allOf: - $ref: '#/definitions/models.Response' - properties: data: $ref: '#/definitions/handlers.EditMapDiscussionRequest' type: object tags: - maps / discussions /maps/{mapid}/image: put: description: Edit map image with specified map id. parameters: - description: JWT Token in: header name: Authorization required: true type: string - description: Map ID in: path name: mapid required: true type: integer - description: Body in: body name: request required: true schema: $ref: '#/definitions/handlers.EditMapImageRequest' produces: - application/json responses: "200": description: OK schema: allOf: - $ref: '#/definitions/models.Response' - properties: data: $ref: '#/definitions/handlers.EditMapImageRequest' type: object tags: - maps / summary /maps/{mapid}/leaderboards: get: description: Get map leaderboards with specified id. parameters: - description: Map ID in: path name: mapid required: true type: integer - description: 'Page Number (default: 1)' in: query name: page type: integer - description: 'Number of Records Per Page (default: 20)' in: query name: pageSize type: integer produces: - application/json responses: "200": description: OK schema: allOf: - $ref: '#/definitions/models.Response' - properties: data: $ref: '#/definitions/handlers.MapLeaderboardsResponse' type: object tags: - maps / leaderboards /maps/{mapid}/record: post: consumes: - multipart/form-data description: Post record with demo of a specific map. parameters: - description: Map ID in: path name: mapid required: true type: integer - description: JWT Token in: header name: Authorization required: true type: string - description: Host Demo in: formData name: host_demo required: true type: file - description: Partner Demo in: formData name: partner_demo type: file - description: Is Partner Orange in: formData name: is_partner_orange type: boolean - description: Partner ID in: formData name: partner_id type: string produces: - application/json responses: "200": description: OK schema: allOf: - $ref: '#/definitions/models.Response' - properties: data: $ref: '#/definitions/handlers.RecordResponse' type: object tags: - maps / leaderboards /maps/{mapid}/record/{recordid}: delete: description: Delete record with specified map and record id. parameters: - description: Map ID in: path name: mapid required: true type: integer - description: Record ID in: path name: recordid required: true type: integer - description: JWT Token in: header name: Authorization required: true type: string produces: - application/json responses: "200": description: OK schema: $ref: '#/definitions/models.Response' tags: - maps / leaderboards /maps/{mapid}/summary: delete: description: Delete map summary with specified map id. parameters: - description: JWT Token in: header name: Authorization required: true type: string - description: Map ID in: path name: mapid required: true type: integer - description: Body in: body name: request required: true schema: $ref: '#/definitions/handlers.DeleteMapSummaryRequest' produces: - application/json responses: "200": description: OK schema: allOf: - $ref: '#/definitions/models.Response' - properties: data: $ref: '#/definitions/handlers.DeleteMapSummaryRequest' type: object tags: - maps / summary get: description: Get map summary with specified id. parameters: - description: Map ID in: path name: mapid required: true type: integer produces: - application/json responses: "200": description: OK schema: allOf: - $ref: '#/definitions/models.Response' - properties: data: $ref: '#/definitions/handlers.MapSummaryResponse' type: object tags: - maps / summary post: description: Create map summary with specified map id. parameters: - description: JWT Token in: header name: Authorization required: true type: string - description: Map ID in: path name: mapid required: true type: integer - description: Body in: body name: request required: true schema: $ref: '#/definitions/handlers.CreateMapSummaryRequest' produces: - application/json responses: "200": description: OK schema: allOf: - $ref: '#/definitions/models.Response' - properties: data: $ref: '#/definitions/handlers.CreateMapSummaryRequest' type: object tags: - maps / summary put: description: Edit map summary with specified map id. parameters: - description: JWT Token in: header name: Authorization required: true type: string - description: Map ID in: path name: mapid required: true type: integer - description: Body in: body name: request required: true schema: $ref: '#/definitions/handlers.EditMapSummaryRequest' produces: - application/json responses: "200": description: OK schema: allOf: - $ref: '#/definitions/models.Response' - properties: data: $ref: '#/definitions/handlers.EditMapSummaryRequest' type: object tags: - maps / summary /profile: get: consumes: - application/json description: Get profile page of session user. parameters: - description: JWT Token in: header name: Authorization required: true type: string produces: - application/json responses: "200": description: OK schema: allOf: - $ref: '#/definitions/models.Response' - properties: data: $ref: '#/definitions/handlers.ProfileResponse' type: object tags: - users post: consumes: - application/json description: Update profile page of session user. parameters: - description: JWT Token in: header name: Authorization required: true type: string produces: - application/json responses: "200": description: OK schema: allOf: - $ref: '#/definitions/models.Response' - properties: data: $ref: '#/definitions/handlers.ProfileResponse' type: object tags: - users put: consumes: - application/json description: Update country code of session user. parameters: - description: JWT Token in: header name: Authorization required: true type: string - description: Country Code [XX] in: query name: country_code required: true type: string produces: - application/json responses: "200": description: OK schema: $ref: '#/definitions/models.Response' tags: - users /rankings/lphub: get: description: Get rankings of every player from LPHUB. produces: - application/json responses: "200": description: OK schema: allOf: - $ref: '#/definitions/models.Response' - properties: data: $ref: '#/definitions/handlers.RankingsResponse' type: object tags: - rankings /rankings/steam: get: description: Get rankings of every player from Steam. produces: - application/json responses: "200": description: OK schema: allOf: - $ref: '#/definitions/models.Response' - properties: data: $ref: '#/definitions/handlers.RankingsSteamResponse' type: object tags: - rankings /search: get: description: Get all user and map data matching to the query. parameters: - description: Search user or map name. in: query name: q type: string produces: - application/json responses: "200": description: OK schema: allOf: - $ref: '#/definitions/models.Response' - properties: data: $ref: '#/definitions/handlers.SearchResponse' type: object tags: - search /token: delete: description: Deletes the token cookie from the user. produces: - application/json responses: "200": description: OK schema: allOf: - $ref: '#/definitions/models.Response' - properties: data: $ref: '#/definitions/handlers.LoginResponse' type: object "404": description: Not Found schema: $ref: '#/definitions/models.Response' tags: - auth get: description: Gets the token cookie value from the user. produces: - application/json responses: "200": description: OK schema: allOf: - $ref: '#/definitions/models.Response' - properties: data: $ref: '#/definitions/handlers.LoginResponse' type: object "404": description: Not Found schema: $ref: '#/definitions/models.Response' tags: - auth /users/{userid}: get: consumes: - application/json description: Get profile page of another user. parameters: - description: User ID in: path name: userid required: true type: integer produces: - application/json responses: "200": description: OK schema: allOf: - $ref: '#/definitions/models.Response' - properties: data: $ref: '#/definitions/handlers.ProfileResponse' type: object tags: - users swagger: "2.0"