{ "swagger": "2.0", "info": { "description": "Donate auth service docs.", "title": "Donate Auth Documentation", "contact": {}, "version": "3.0" }, "basePath": "/api/widget", "paths": { "/donat-page": { "patch": { "security": [ { "BearerAuth": [] } ], "description": "Update personal streamer donate page.", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "Donate" ], "summary": "Update personal streamer donate page.", "parameters": [ { "description": "Update fields", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/donat-widget_internal_model.UpdateDonatPage" } }, { "type": "file", "description": "Background image", "name": "background", "in": "formData" }, { "type": "file", "description": "Head image", "name": "head-img", "in": "formData" } ], "responses": { "200": { "description": "Donat page updated successfully", "schema": { "type": "string" } }, "400": { "description": "Bad request", "schema": { "$ref": "#/definitions/echo.HTTPError" } }, "401": { "description": "Unauthorized or expired token", "schema": { "$ref": "#/definitions/echo.HTTPError" } }, "422": { "description": "Validation error", "schema": { "$ref": "#/definitions/echo.HTTPError" } } } } }, "/files": { "post": { "security": [ { "BearerAuth": [] } ], "description": "Add new File", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "Files" ], "summary": "Add new File", "parameters": [ { "type": "file", "description": "New file", "name": "new_file", "in": "formData" } ], "responses": { "200": { "description": "GetWidgetDb has been uploaded successfully!", "schema": { "type": "string" } }, "400": { "description": "Bad request", "schema": { "$ref": "#/definitions/echo.HTTPError" } }, "401": { "description": "Unauthorized or expired token", "schema": { "$ref": "#/definitions/echo.HTTPError" } }, "422": { "description": "Validation error", "schema": { "$ref": "#/definitions/echo.HTTPError" } } } } }, "/files/{file_id}": { "get": { "description": "Retrieve a file by its ID", "consumes": [ "application/json" ], "produces": [ "application/octet-stream" ], "tags": [ "Files" ], "summary": "Get a file", "parameters": [ { "type": "string", "description": "File ID", "name": "file_id", "in": "path", "required": true } ], "responses": { "200": { "description": "File content", "schema": { "type": "file" } }, "400": { "description": "Bad request", "schema": { "$ref": "#/definitions/echo.HTTPError" } }, "401": { "description": "Unauthorized or expired token", "schema": { "$ref": "#/definitions/echo.HTTPError" } }, "404": { "description": "File not found", "schema": { "$ref": "#/definitions/echo.HTTPError" } } } } }, "/filters-settings": { "get": { "description": "Get donat filters settings", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "Donate" ], "summary": "Get donat filters settings", "responses": { "200": { "description": "Current filters settings", "schema": { "$ref": "#/definitions/donat-widget_internal_model.FilterSettingResponse" } }, "400": { "description": "Bad request", "schema": { "$ref": "#/definitions/echo.HTTPError" } }, "401": { "description": "Unauthorized or expired token", "schema": { "$ref": "#/definitions/echo.HTTPError" } }, "422": { "description": "Validation error", "schema": { "$ref": "#/definitions/echo.HTTPError" } } } }, "patch": { "description": "Update donat filters settings.", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "Donate" ], "summary": "Update donat filters settings.", "parameters": [ { "description": "Update fields", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/donat-widget_internal_model.UpdateFilterSettings" } }, { "type": "file", "description": "Background image", "name": "background", "in": "formData" } ], "responses": { "200": { "description": "Voice settings updated successfully", "schema": { "type": "string" } }, "400": { "description": "Bad request", "schema": { "$ref": "#/definitions/echo.HTTPError" } }, "401": { "description": "Unauthorized or expired token", "schema": { "$ref": "#/definitions/echo.HTTPError" } }, "422": { "description": "Validation error", "schema": { "$ref": "#/definitions/echo.HTTPError" } } } } }, "/inner-donate-page": { "get": { "security": [ { "BearerAuth": [] } ], "description": "Get inner donate page info", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "Donate" ], "summary": "Get inner donate page info", "responses": { "200": { "description": "Current donate page state", "schema": { "$ref": "#/definitions/donat-widget_internal_model.InnerDonatePageResponse" } }, "400": { "description": "Bad request", "schema": { "$ref": "#/definitions/echo.HTTPError" } }, "401": { "description": "Unauthorized or expired token", "schema": { "$ref": "#/definitions/echo.HTTPError" } }, "422": { "description": "Validation error", "schema": { "$ref": "#/definitions/echo.HTTPError" } } } } }, "/moderation-settings": { "get": { "description": "Get donat moderation settings", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "Donate" ], "summary": "Get donat moderation settings", "responses": { "200": { "description": "Current moderation settings", "schema": { "$ref": "#/definitions/donat-widget_internal_model.ModerationResponse" } }, "400": { "description": "Bad request", "schema": { "$ref": "#/definitions/echo.HTTPError" } }, "401": { "description": "Unauthorized or expired token", "schema": { "$ref": "#/definitions/echo.HTTPError" } }, "422": { "description": "Validation error", "schema": { "$ref": "#/definitions/echo.HTTPError" } } } }, "patch": { "description": "Update donat moderation settings", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "Donate" ], "summary": "Update donat moderation settings", "responses": { "200": { "description": "Update moderation settings", "schema": { "$ref": "#/definitions/donat-widget_internal_model.UpdateModeration" } }, "400": { "description": "Bad request", "schema": { "$ref": "#/definitions/echo.HTTPError" } }, "401": { "description": "Unauthorized or expired token", "schema": { "$ref": "#/definitions/echo.HTTPError" } }, "422": { "description": "Validation error", "schema": { "$ref": "#/definitions/echo.HTTPError" } } } } }, "/outer-donate-page/{streamer-login}": { "get": { "description": "Get outer donate page info", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "Donate" ], "summary": "Get outer donate page info", "parameters": [ { "type": "string", "description": "Login стримера", "name": "streamer-login", "in": "path", "required": true } ], "responses": { "200": { "description": "Current donate page state", "schema": { "$ref": "#/definitions/donat-widget_internal_model.OuterDonatePageResponse" } }, "400": { "description": "Bad request", "schema": { "$ref": "#/definitions/echo.HTTPError" } }, "401": { "description": "Unauthorized or expired token", "schema": { "$ref": "#/definitions/echo.HTTPError" } }, "422": { "description": "Validation error", "schema": { "$ref": "#/definitions/echo.HTTPError" } } } } }, "/voice-settings": { "get": { "description": "Get donat voice settings", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "Donate" ], "summary": "Get donat voice settings", "responses": { "200": { "description": "Current voice settings", "schema": { "$ref": "#/definitions/donat-widget_internal_model.VoiceSettingsResponse" } }, "400": { "description": "Bad request", "schema": { "$ref": "#/definitions/echo.HTTPError" } }, "401": { "description": "Unauthorized or expired token", "schema": { "$ref": "#/definitions/echo.HTTPError" } }, "422": { "description": "Validation error", "schema": { "$ref": "#/definitions/echo.HTTPError" } } } }, "patch": { "description": "Update donat voice settings.", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "Donate" ], "summary": "Update donat voice settings.", "parameters": [ { "description": "Update fields", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/donat-widget_internal_model.UpdateVoiceSettings" } }, { "type": "file", "description": "Background image", "name": "background", "in": "formData" } ], "responses": { "200": { "description": "Voice settings updated successfully", "schema": { "type": "string" } }, "400": { "description": "Bad request", "schema": { "$ref": "#/definitions/echo.HTTPError" } }, "401": { "description": "Unauthorized or expired token", "schema": { "$ref": "#/definitions/echo.HTTPError" } }, "422": { "description": "Validation error", "schema": { "$ref": "#/definitions/echo.HTTPError" } } } } }, "/widgets": { "get": { "security": [ { "BearerAuth": [] } ], "description": "Get all streamer's widgets", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "GetWidgetDb" ], "summary": "Get all streamer's widgets", "responses": { "200": { "description": "GetWidgetDb has been created successfully!", "schema": { "type": "string" } }, "400": { "description": "Bad request", "schema": { "$ref": "#/definitions/echo.HTTPError" } }, "401": { "description": "Unauthorized or expired token", "schema": { "$ref": "#/definitions/echo.HTTPError" } }, "422": { "description": "Validation error", "schema": { "$ref": "#/definitions/echo.HTTPError" } } } }, "post": { "security": [ { "BearerAuth": [] } ], "description": "Create new widget", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "GetWidgetDb" ], "summary": "Create new widget", "parameters": [ { "description": "Create widget", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/donat-widget_internal_model.CreateWidgetBody" } } ], "responses": { "200": { "description": "GetWidgetDb has been created successfully!", "schema": { "type": "string" } }, "400": { "description": "Bad request", "schema": { "$ref": "#/definitions/echo.HTTPError" } }, "401": { "description": "Unauthorized or expired token", "schema": { "$ref": "#/definitions/echo.HTTPError" } }, "422": { "description": "Validation error", "schema": { "$ref": "#/definitions/echo.HTTPError" } } } } } }, "definitions": { "donat-widget_internal_model.CreateWidgetBody": { "type": "object", "required": [ "audio", "duration", "image", "max_amount", "min_amount", "name", "template_id" ], "properties": { "audio": { "type": "string", "format": "uuid", "example": "550e8400-e29b-41d4-a716-446655440001" }, "duration": { "type": "integer", "example": 30 }, "image": { "type": "string", "format": "uuid", "example": "550e8400-e29b-41d4-a716-446655440000" }, "max_amount": { "type": "integer", "example": 100 }, "min_amount": { "type": "integer", "example": 10 }, "name": { "type": "string", "example": "My GetWidgetDb" }, "template_id": { "type": "integer", "example": 1 } } }, "donat-widget_internal_model.FilterSettingResponse": { "type": "object", "properties": { "enable_links": { "type": "boolean" }, "filtered_words": { "type": "array", "items": { "type": "string" } } } }, "donat-widget_internal_model.InnerDonatePageResponse": { "type": "object", "properties": { "avatar": { "type": "string" }, "background_img": { "type": "string" }, "description": { "type": "string" }, "head_img": { "type": "string" }, "text_after_donat": { "type": "string" } } }, "donat-widget_internal_model.ModerationResponse": { "type": "object", "properties": { "duration": { "type": "integer" }, "enable": { "type": "boolean" } } }, "donat-widget_internal_model.OuterDonatePageResponse": { "type": "object", "properties": { "avatar_img": { "type": "string" }, "background_img": { "type": "string" }, "description": { "type": "string" }, "head_img": { "type": "string" }, "login": { "type": "string" }, "online": { "type": "string" } } }, "donat-widget_internal_model.UpdateDonatPage": { "type": "object", "properties": { "description": { "type": "string" }, "page_background": { "type": "string" }, "profile_avatar": { "type": "boolean" }, "text_after_donat": { "type": "string" } } }, "donat-widget_internal_model.UpdateFilterSettings": { "type": "object", "properties": { "add_words": { "type": "array", "items": { "type": "string" } }, "enable_links": { "type": "boolean" }, "remove_words": { "type": "array", "items": { "type": "string" } } } }, "donat-widget_internal_model.UpdateModeration": { "type": "object", "properties": { "duration": { "type": "integer" }, "enable": { "type": "boolean" } } }, "donat-widget_internal_model.UpdateVoiceSettings": { "type": "object", "properties": { "enable": { "type": "boolean" }, "min_price": { "type": "integer" }, "scenery": { "type": "string" }, "voice_sound_percent": { "type": "integer" }, "voice_speed": { "type": "integer" } } }, "donat-widget_internal_model.VoiceSettingsResponse": { "type": "object", "properties": { "min_price": { "type": "integer" }, "scenery": { "type": "string" }, "voice_sound_percent": { "type": "integer" }, "voice_speed": { "type": "integer" } } }, "echo.HTTPError": { "type": "object", "properties": { "message": {} } } }, "securityDefinitions": { "BearerAuth": { "type": "apiKey", "name": "Authorization", "in": "header" } } }