basePath: /v1 definitions: models.Category: properties: id: type: integer name: type: string type: object models.Chapter: properties: id: type: integer name: type: string type: object models.ChapterMapsResponse: properties: chapter: $ref: '#/definitions/models.Chapter' maps: items: $ref: '#/definitions/models.MapShort' type: array type: object models.ChaptersResponse: properties: chapters: items: $ref: '#/definitions/models.Chapter' type: array game: $ref: '#/definitions/models.Game' type: object models.EditMapSummaryRequest: properties: image: type: string routes: items: $ref: '#/definitions/models.EditMapSummaryRequestDetails' type: array required: - image type: object models.EditMapSummaryRequestDetails: 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 - showcase - user_name type: object models.Game: properties: id: type: integer name: type: string type: object models.LoginResponse: properties: token: type: string type: object models.Map: properties: chapter_name: type: string game_name: type: string id: type: integer image: type: string map_name: type: string type: object models.MapHistory: properties: date: type: string runner_name: type: string score_count: type: integer type: object models.MapRecords: properties: records: {} type: object models.MapRoute: properties: category: $ref: '#/definitions/models.Category' description: type: string history: $ref: '#/definitions/models.MapHistory' rating: type: number route_id: type: integer showcase: type: string type: object models.MapShort: properties: id: type: integer name: type: string type: object models.MapSummary: properties: routes: items: $ref: '#/definitions/models.MapRoute' type: array type: object models.MapSummaryResponse: properties: map: $ref: '#/definitions/models.Map' summary: $ref: '#/definitions/models.MapSummary' type: object models.ProfileResponse: properties: avatar_link: type: string country_code: type: string profile: type: boolean scores_mp: items: $ref: '#/definitions/models.ScoreResponse' type: array scores_sp: items: $ref: '#/definitions/models.ScoreResponse' type: array steam_id: type: string user_name: type: string type: object models.RankingsResponse: properties: rankings_mp: items: $ref: '#/definitions/models.UserRanking' type: array rankings_sp: items: $ref: '#/definitions/models.UserRanking' type: array type: object models.Response: properties: data: {} message: type: string success: type: boolean type: object models.ScoreResponse: properties: map_id: type: integer records: {} type: object models.SearchResponse: properties: maps: items: $ref: '#/definitions/models.MapShort' type: array players: items: $ref: '#/definitions/models.UserShort' type: array type: object models.UserRanking: properties: total_score: type: integer user_id: type: string user_name: type: string type: object models.UserShort: properties: steam_id: type: string user_name: type: string type: object host: lp.ardapektezol.com/api info: contact: {} description: Backend API endpoints for the Least Portals Database. license: name: GNU General Public License, Version 2 url: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html title: Least Portals Database API version: "1.0" paths: /chapters/{id}: get: parameters: - description: Chapter ID in: path name: id required: true type: integer produces: - application/json responses: "200": description: OK schema: allOf: - $ref: '#/definitions/models.Response' - properties: data: $ref: '#/definitions/models.ChapterMapsResponse' type: object "400": description: Bad Request schema: $ref: '#/definitions/models.Response' summary: Get maps from the specified chapter id. tags: - games & chapters /demo: get: produces: - application/json responses: "200": description: OK schema: allOf: - $ref: '#/definitions/models.Response' - properties: data: $ref: '#/definitions/models.RankingsResponse' type: object "400": description: Bad Request schema: $ref: '#/definitions/models.Response' summary: Get rankings of every player. tags: - rankings /demos: get: consumes: - application/json parameters: - description: Demo UUID in: query name: uuid required: true type: integer produces: - application/octet-stream responses: "200": description: Demo File schema: type: file "400": description: Bad Request schema: $ref: '#/definitions/models.Response' summary: Get demo with specified demo uuid. tags: - demo /games: get: 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' summary: Get games from the leaderboards. tags: - games & chapters /games/{id}: get: parameters: - description: Game ID in: path name: id required: true type: integer produces: - application/json responses: "200": description: OK schema: allOf: - $ref: '#/definitions/models.Response' - properties: data: $ref: '#/definitions/models.ChaptersResponse' type: object "400": description: Bad Request schema: $ref: '#/definitions/models.Response' summary: Get chapters from the specified game id. tags: - games & chapters /login: get: consumes: - application/json produces: - application/json responses: "200": description: OK schema: allOf: - $ref: '#/definitions/models.Response' - properties: data: $ref: '#/definitions/models.LoginResponse' type: object "400": description: Bad Request schema: $ref: '#/definitions/models.Response' summary: Get (redirect) login page for Steam auth. tags: - login /maps/{id}/leaderboards: get: parameters: - description: Map ID in: path name: id required: true type: integer produces: - application/json responses: "200": description: OK schema: allOf: - $ref: '#/definitions/models.Response' - properties: data: allOf: - $ref: '#/definitions/models.Map' - properties: data: $ref: '#/definitions/models.MapRecords' type: object type: object "400": description: Bad Request schema: $ref: '#/definitions/models.Response' summary: Get map leaderboards with specified id. tags: - maps /maps/{id}/record: post: consumes: - multipart/form-data parameters: - 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 required: true type: file - description: Is Partner Orange in: formData name: is_partner_orange required: true type: boolean - description: Partner ID in: formData name: partner_id required: true type: string produces: - application/json responses: "200": description: OK schema: $ref: '#/definitions/models.Response' "400": description: Bad Request schema: $ref: '#/definitions/models.Response' "401": description: Unauthorized schema: $ref: '#/definitions/models.Response' summary: Post record with demo of a specific map. tags: - maps /maps/{id}/summary: get: parameters: - description: Map ID in: path name: id required: true type: integer produces: - application/json responses: "200": description: OK schema: allOf: - $ref: '#/definitions/models.Response' - properties: data: $ref: '#/definitions/models.MapSummaryResponse' type: object "400": description: Bad Request schema: $ref: '#/definitions/models.Response' summary: Get map summary with specified id. tags: - maps put: parameters: - description: Map ID in: path name: id required: true type: integer - description: Body in: body name: request required: true schema: $ref: '#/definitions/models.EditMapSummaryRequest' produces: - application/json responses: "200": description: OK schema: allOf: - $ref: '#/definitions/models.Response' - properties: data: $ref: '#/definitions/models.EditMapSummaryRequest' type: object "400": description: Bad Request schema: $ref: '#/definitions/models.Response' summary: Edit map summary with specified map id. tags: - maps /profile: get: consumes: - application/json 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/models.ProfileResponse' type: object "400": description: Bad Request schema: $ref: '#/definitions/models.Response' "401": description: Unauthorized schema: $ref: '#/definitions/models.Response' summary: Get profile page of session user. tags: - users post: consumes: - application/json 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/models.ProfileResponse' type: object "400": description: Bad Request schema: $ref: '#/definitions/models.Response' "401": description: Unauthorized schema: $ref: '#/definitions/models.Response' summary: Update profile page of session user. tags: - users put: consumes: - application/json 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' "400": description: Bad Request schema: $ref: '#/definitions/models.Response' "401": description: Unauthorized schema: $ref: '#/definitions/models.Response' summary: Update country code of session user. tags: - users /search: get: 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/models.SearchResponse' type: object "400": description: Bad Request schema: $ref: '#/definitions/models.Response' summary: Get all user and map data matching to the query. tags: - search /token: delete: produces: - application/json responses: "200": description: OK schema: allOf: - $ref: '#/definitions/models.Response' - properties: data: $ref: '#/definitions/models.LoginResponse' type: object "404": description: Not Found schema: $ref: '#/definitions/models.Response' summary: Deletes the token cookie from the user. tags: - auth get: produces: - application/json responses: "200": description: OK schema: allOf: - $ref: '#/definitions/models.Response' - properties: data: $ref: '#/definitions/models.LoginResponse' type: object "404": description: Not Found schema: $ref: '#/definitions/models.Response' summary: Gets the token cookie value from the user. tags: - auth /users/{id}: get: consumes: - application/json parameters: - description: User ID in: path name: id required: true type: integer produces: - application/json responses: "200": description: OK schema: allOf: - $ref: '#/definitions/models.Response' - properties: data: $ref: '#/definitions/models.ProfileResponse' type: object "400": description: Bad Request schema: $ref: '#/definitions/models.Response' "404": description: Not Found schema: $ref: '#/definitions/models.Response' summary: Get profile page of another user. tags: - users swagger: "2.0"