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.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 models.DeleteMapSummaryRequest: properties: route_id: type: integer required: - route_id type: object models.EditMapImageRequest: properties: image: type: string required: - image type: object models.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 models.Game: properties: id: type: integer is_coop: type: boolean 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 is_coop: 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.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.RecordResponse: properties: score_count: type: integer score_time: type: integer 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: description: Get maps from the specified chapter id. 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' 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 "400": description: Bad Request schema: $ref: '#/definitions/models.Response' 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/{id}: get: description: Get chapters from the specified game id. 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' 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/models.LoginResponse' type: object "400": description: Bad Request schema: $ref: '#/definitions/models.Response' tags: - login /maps/{id}/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: id required: true type: integer - description: Body in: body name: request required: true schema: $ref: '#/definitions/models.EditMapImageRequest' produces: - application/json responses: "200": description: OK schema: allOf: - $ref: '#/definitions/models.Response' - properties: data: $ref: '#/definitions/models.EditMapImageRequest' type: object "400": description: Bad Request schema: $ref: '#/definitions/models.Response' tags: - maps /maps/{id}/leaderboards: get: description: Get map leaderboards with specified id. 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' tags: - maps /maps/{id}/record: post: consumes: - multipart/form-data description: Post record with demo of a specific map. parameters: - description: Map ID in: path name: id 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/models.RecordResponse' type: object "400": description: Bad Request schema: $ref: '#/definitions/models.Response' "401": description: Unauthorized schema: $ref: '#/definitions/models.Response' tags: - maps /maps/{id}/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: id required: true type: integer - description: Body in: body name: request required: true schema: $ref: '#/definitions/models.DeleteMapSummaryRequest' produces: - application/json responses: "200": description: OK schema: allOf: - $ref: '#/definitions/models.Response' - properties: data: $ref: '#/definitions/models.DeleteMapSummaryRequest' type: object "400": description: Bad Request schema: $ref: '#/definitions/models.Response' tags: - maps get: description: Get map summary with specified id. 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' tags: - maps 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: id required: true type: integer - description: Body in: body name: request required: true schema: $ref: '#/definitions/models.CreateMapSummaryRequest' produces: - application/json responses: "200": description: OK schema: allOf: - $ref: '#/definitions/models.Response' - properties: data: $ref: '#/definitions/models.CreateMapSummaryRequest' type: object "400": description: Bad Request schema: $ref: '#/definitions/models.Response' tags: - maps 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: 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' tags: - maps /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/models.ProfileResponse' type: object "400": description: Bad Request schema: $ref: '#/definitions/models.Response' "401": description: Unauthorized schema: $ref: '#/definitions/models.Response' 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/models.ProfileResponse' type: object "400": description: Bad Request schema: $ref: '#/definitions/models.Response' "401": description: Unauthorized schema: $ref: '#/definitions/models.Response' 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' "400": description: Bad Request schema: $ref: '#/definitions/models.Response' "401": description: Unauthorized schema: $ref: '#/definitions/models.Response' tags: - users /rankings: get: description: Get rankings of every player. 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' 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/models.SearchResponse' type: object "400": description: Bad Request schema: $ref: '#/definitions/models.Response' 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/models.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/models.LoginResponse' type: object "404": description: Not Found schema: $ref: '#/definitions/models.Response' tags: - auth /users/{id}: get: consumes: - application/json description: Get profile page of another user. 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' tags: - users swagger: "2.0"