{"openapi": "3.1.0", "info": {"title": "TL Workshop — API сборок и каталога", "version": "1.0.0", "description": "AccountKey выдаётся пользователем в браузере на 24 часа. Один активный ключ на аккаунт; выпуск нового отзывает предыдущий. Ключ даёт чтение/сохранение своих сборок, но не администрирование, удаление, публикацию ссылок или выпуск ключей. Не передавайте его в URL, публичный каталог или экспорт. Документация: https://tlbuild.nepopus.ru/api-guide"}, "servers": [{"url": "https://tlbuild.nepopus.ru"}], "paths": {"/api/me": {"get": {"summary": "Проверить ключ и узнать аккаунт", "security": [{"AccountKey": []}], "responses": {"200": {"description": "Успешно", "content": {"application/json": {"schema": {"type": "object"}}}}, "401": {"description": "Нет ключа, ключ истёк или отозван", "content": {"application/json": {"schema": {"type": "object"}}}}, "403": {"description": "Ключ не даёт такого доступа", "content": {"application/json": {"schema": {"type": "object"}}}}, "400": {"description": "Некорректный запрос", "content": {"application/json": {"schema": {"type": "object"}}}}}}}, "/api/builds": {"get": {"summary": "Список только собственных сохранённых сборок", "security": [{"AccountKey": []}], "responses": {"200": {"description": "Список собственных сборок", "content": {"application/json": {"schema": {"type": "array", "items": {"type": "object", "required": ["id", "name", "updated", "shared"], "properties": {"id": {"type": "string"}, "name": {"type": "string"}, "updated": {"type": "number", "description": "Unix timestamp seconds"}, "shared": {"type": "boolean"}}}}}}}, "401": {"description": "Нет ключа, ключ истёк или отозван", "content": {"application/json": {"schema": {"type": "object"}}}}, "403": {"description": "Ключ не даёт такого доступа", "content": {"application/json": {"schema": {"type": "object"}}}}, "400": {"description": "Некорректный запрос", "content": {"application/json": {"schema": {"type": "object"}}}}}}}, "/api/builds/{build_id}": {"get": {"summary": "Прочитать собственную сборку", "security": [{"AccountKey": []}], "responses": {"200": {"description": "Сохранённая сборка", "content": {"application/json": {"schema": {"allOf": [{"$ref": "#/components/schemas/Build"}, {"type": "object", "required": ["id"], "properties": {"id": {"type": "string"}}}]}}}}, "401": {"description": "Нет ключа, ключ истёк или отозван", "content": {"application/json": {"schema": {"type": "object"}}}}, "403": {"description": "Ключ не даёт такого доступа", "content": {"application/json": {"schema": {"type": "object"}}}}, "400": {"description": "Некорректный запрос", "content": {"application/json": {"schema": {"type": "object"}}}}}, "parameters": [{"name": "build_id", "in": "path", "required": true, "schema": {"type": "string"}}]}}, "/api/builds/{build_id}/export": {"get": {"summary": "Экспорт выбранной экипировки с фильтрами поиска замен", "security": [{"AccountKey": []}], "responses": {"200": {"description": "Текущий выбор и ссылки на каталог", "content": {"application/json": {"schema": {"type": "object", "required": ["schema", "equipment", "catalog_context", "solution_template", "current_totals"], "properties": {"schema": {"type": "string", "const": "tl-gear-selection/v2"}, "equipment": {"type": "array", "items": {"type": "object", "description": "Только выбранная вещь и selected — текущие настройки, без невыбранных уровней"}}, "catalog_context": {"type": "object", "description": "filters, html/json с фильтрами поиска замен, guide"}, "solution_template": {"$ref": "#/components/schemas/Build"}, "current_totals": {"type": "object", "required": ["stats", "warnings", "effects", "complete"], "properties": {"stats": {"type": "object", "additionalProperties": {"type": "number"}}, "warnings": {"type": "array", "items": {"type": "string"}}, "effects": {"type": "array", "items": {"type": "object"}}, "complete": {"type": "boolean"}}}, "source_build_id": {"type": "string"}}}}}}, "401": {"description": "Нет ключа, ключ истёк или отозван", "content": {"application/json": {"schema": {"type": "object"}}}}, "403": {"description": "Ключ не даёт такого доступа", "content": {"application/json": {"schema": {"type": "object"}}}}, "400": {"description": "Некорректный запрос", "content": {"application/json": {"schema": {"type": "object"}}}}}, "parameters": [{"name": "build_id", "in": "path", "required": true, "schema": {"type": "string"}}, {"name": "tag", "in": "query", "schema": {"type": "array", "items": {"type": "string"}}, "style": "form", "explode": true}, {"name": "tag_mode", "in": "query", "schema": {"type": "string", "enum": ["all", "any"], "default": "all"}}, {"name": "kind", "in": "query", "schema": {"type": "string"}}, {"name": "q", "in": "query", "schema": {"type": "string", "maxLength": 200}}, {"name": "limit", "in": "query", "schema": {"type": "integer", "minimum": 1, "maximum": 100, "default": 25}}, {"name": "offset", "in": "query", "schema": {"type": "integer", "minimum": 0, "default": 0}}]}}, "/api/import/preview": {"post": {"summary": "Проверить импорт, ничего не сохранять", "security": [{"AccountKey": []}], "responses": {"200": {"description": "Проверено, ничего не сохранено", "content": {"application/json": {"schema": {"type": "object", "required": ["build", "evaluation"], "properties": {"build": {"$ref": "#/components/schemas/Build"}, "evaluation": {"type": "object", "required": ["stats", "warnings", "effects", "complete"], "properties": {"stats": {"type": "object", "additionalProperties": {"type": "number"}}, "warnings": {"type": "array", "items": {"type": "string"}}, "effects": {"type": "array", "items": {"type": "object"}}, "complete": {"type": "boolean"}}}}}}}}, "401": {"description": "Нет ключа, ключ истёк или отозван", "content": {"application/json": {"schema": {"type": "object"}}}}, "403": {"description": "Ключ не даёт такого доступа", "content": {"application/json": {"schema": {"type": "object"}}}}, "400": {"description": "Некорректный запрос", "content": {"application/json": {"schema": {"type": "object"}}}}}, "requestBody": {"required": true, "content": {"application/json": {"schema": {"anyOf": [{"$ref": "#/components/schemas/Build"}, {"type": "object", "required": ["build"], "properties": {"build": {"$ref": "#/components/schemas/Build"}, "target_id": {"type": "string", "description": "Опционально: ID своей существующей сборки для полной замены. Без него создаётся копия."}}}, {"type": "object", "required": ["solution_template"], "properties": {"solution_template": {"$ref": "#/components/schemas/Build"}, "target_id": {"type": "string"}}}]}}}}}}, "/api/import": {"post": {"summary": "Сохранить импорт: новая копия или полная замена по target_id", "security": [{"AccountKey": []}], "responses": {"201": {"description": "Создана новая копия", "content": {"application/json": {"schema": {"type": "object", "required": ["id", "created", "build", "evaluation"], "properties": {"id": {"type": "string"}, "created": {"type": "boolean"}, "build": {"allOf": [{"$ref": "#/components/schemas/Build"}, {"type": "object", "required": ["id"], "properties": {"id": {"type": "string"}}}]}, "evaluation": {"type": "object", "required": ["stats", "warnings", "effects", "complete"], "properties": {"stats": {"type": "object", "additionalProperties": {"type": "number"}}, "warnings": {"type": "array", "items": {"type": "string"}}, "effects": {"type": "array", "items": {"type": "object"}}, "complete": {"type": "boolean"}}}}}}}}, "200": {"description": "Обновлено", "content": {"application/json": {"schema": {"type": "object", "required": ["id", "created", "build", "evaluation"], "properties": {"id": {"type": "string"}, "created": {"type": "boolean"}, "build": {"allOf": [{"$ref": "#/components/schemas/Build"}, {"type": "object", "required": ["id"], "properties": {"id": {"type": "string"}}}]}, "evaluation": {"type": "object", "required": ["stats", "warnings", "effects", "complete"], "properties": {"stats": {"type": "object", "additionalProperties": {"type": "number"}}, "warnings": {"type": "array", "items": {"type": "string"}}, "effects": {"type": "array", "items": {"type": "object"}}, "complete": {"type": "boolean"}}}}}}}}, "400": {"description": "Невалидные настройки; ничего не сохранено", "content": {"application/json": {"schema": {"type": "object"}}}}, "401": {"description": "Неверный, истёкший или отозванный ключ", "content": {"application/json": {"schema": {"type": "object"}}}}, "404": {"description": "target_id не найден у этого аккаунта", "content": {"application/json": {"schema": {"type": "object"}}}}}, "requestBody": {"required": true, "content": {"application/json": {"schema": {"anyOf": [{"$ref": "#/components/schemas/Build"}, {"type": "object", "required": ["build"], "properties": {"build": {"$ref": "#/components/schemas/Build"}, "target_id": {"type": "string", "description": "Опционально: ID своей существующей сборки для полной замены. Без него создаётся копия."}}}, {"type": "object", "required": ["solution_template"], "properties": {"solution_template": {"$ref": "#/components/schemas/Build"}, "target_id": {"type": "string"}}}]}}}}}}, "/api/evaluate": {"post": {"summary": "Посчитать черновик без сохранения", "security": [{"AccountKey": []}], "responses": {"200": {"description": "Постоянные характеристики и предупреждения", "content": {"application/json": {"schema": {"type": "object", "required": ["stats", "warnings", "effects", "complete"], "properties": {"stats": {"type": "object", "additionalProperties": {"type": "number"}}, "warnings": {"type": "array", "items": {"type": "string"}}, "effects": {"type": "array", "items": {"type": "object"}}, "complete": {"type": "boolean"}}}}}}, "401": {"description": "Нет ключа, ключ истёк или отозван", "content": {"application/json": {"schema": {"type": "object"}}}}, "403": {"description": "Ключ не даёт такого доступа", "content": {"application/json": {"schema": {"type": "object"}}}}, "400": {"description": "Некорректный запрос", "content": {"application/json": {"schema": {"type": "object"}}}}}, "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Build"}}}}}}, "/api/export": {"post": {"summary": "Выгрузить переданный черновик без сохранения", "security": [{"AccountKey": []}], "responses": {"200": {"description": "Экспорт черновика", "content": {"application/json": {"schema": {"type": "object", "required": ["schema", "equipment", "catalog_context", "solution_template", "current_totals"], "properties": {"schema": {"type": "string", "const": "tl-gear-selection/v2"}, "equipment": {"type": "array", "items": {"type": "object", "description": "Только выбранная вещь и selected — текущие настройки, без невыбранных уровней"}}, "catalog_context": {"type": "object", "description": "filters, html/json с фильтрами поиска замен, guide"}, "solution_template": {"$ref": "#/components/schemas/Build"}, "current_totals": {"type": "object", "required": ["stats", "warnings", "effects", "complete"], "properties": {"stats": {"type": "object", "additionalProperties": {"type": "number"}}, "warnings": {"type": "array", "items": {"type": "string"}}, "effects": {"type": "array", "items": {"type": "object"}}, "complete": {"type": "boolean"}}}, "source_build_id": {"type": "string"}}}}}}, "401": {"description": "Нет ключа, ключ истёк или отозван", "content": {"application/json": {"schema": {"type": "object"}}}}, "403": {"description": "Ключ не даёт такого доступа", "content": {"application/json": {"schema": {"type": "object"}}}}, "400": {"description": "Некорректный запрос", "content": {"application/json": {"schema": {"type": "object"}}}}}, "requestBody": {"required": true, "content": {"application/json": {"schema": {"type": "object", "required": ["build"], "properties": {"build": {"$ref": "#/components/schemas/Build"}, "catalog_filters": {"type": "object", "description": "query-map: {tag:[\"t2\"],tag_mode:[\"all\"]}"}}}}}}}}, "/api/import-template": {"get": {"summary": "Шаблон и правила импорта", "security": [], "responses": {"200": {"description": "Успешно", "content": {"application/json": {"schema": {"type": "object"}}}}, "401": {"description": "Нет ключа, ключ истёк или отозван", "content": {"application/json": {"schema": {"type": "object"}}}}, "403": {"description": "Ключ не даёт такого доступа", "content": {"application/json": {"schema": {"type": "object"}}}}, "400": {"description": "Некорректный запрос", "content": {"application/json": {"schema": {"type": "object"}}}}}}}, "/api/public/catalog": {"get": {"summary": "Публичные вещи со всеми настройками", "security": [], "responses": {"200": {"description": "Успешно", "content": {"application/json": {"schema": {"type": "object"}}}}, "401": {"description": "Нет ключа, ключ истёк или отозван", "content": {"application/json": {"schema": {"type": "object"}}}}, "403": {"description": "Ключ не даёт такого доступа", "content": {"application/json": {"schema": {"type": "object"}}}}, "400": {"description": "Некорректный запрос", "content": {"application/json": {"schema": {"type": "object"}}}}}, "parameters": [{"name": "tag", "in": "query", "schema": {"type": "array", "items": {"type": "string"}}, "style": "form", "explode": true}, {"name": "tag_mode", "in": "query", "schema": {"type": "string", "enum": ["all", "any"], "default": "all"}}, {"name": "kind", "in": "query", "schema": {"type": "string"}}, {"name": "q", "in": "query", "schema": {"type": "string", "maxLength": 200}}, {"name": "limit", "in": "query", "schema": {"type": "integer", "minimum": 1, "maximum": 100, "default": 25}}, {"name": "offset", "in": "query", "schema": {"type": "integer", "minimum": 0, "default": 0}}]}}, "/api/public/tags": {"get": {"summary": "Публичные теги", "security": [], "responses": {"200": {"description": "Успешно", "content": {"application/json": {"schema": {"type": "object"}}}}, "401": {"description": "Нет ключа, ключ истёк или отозван", "content": {"application/json": {"schema": {"type": "object"}}}}, "403": {"description": "Ключ не даёт такого доступа", "content": {"application/json": {"schema": {"type": "object"}}}}, "400": {"description": "Некорректный запрос", "content": {"application/json": {"schema": {"type": "object"}}}}}}}, "/api/public/items/{item_id}": {"get": {"summary": "Полное определение версии вещи", "security": [], "responses": {"200": {"description": "Успешно", "content": {"application/json": {"schema": {"type": "object"}}}}, "401": {"description": "Нет ключа, ключ истёк или отозван", "content": {"application/json": {"schema": {"type": "object"}}}}, "403": {"description": "Ключ не даёт такого доступа", "content": {"application/json": {"schema": {"type": "object"}}}}, "400": {"description": "Некорректный запрос", "content": {"application/json": {"schema": {"type": "object"}}}}}, "parameters": [{"name": "item_id", "in": "path", "required": true, "schema": {"type": "string"}}]}}}, "components": {"securitySchemes": {"AccountKey": {"type": "http", "scheme": "bearer", "bearerFormat": "opaque tlw_ token"}}, "schemas": {"Build": {"type": "object", "required": ["name", "equipment"], "properties": {"name": {"type": "string", "minLength": 1, "maxLength": 120}, "goal": {"type": "string", "maxLength": 4000}, "equipment": {"type": "object", "additionalProperties": false, "properties": {"weapon_main": {"type": "object", "required": ["item_id"], "properties": {"item_id": {"type": "string", "minLength": 1}, "selections": {"type": "object", "additionalProperties": {"type": "array", "maxItems": 10, "items": {"type": "object", "required": ["position", "option_id", "level"], "properties": {"position": {"type": "integer", "minimum": 0, "maximum": 9}, "option_id": {"type": "string", "minLength": 1}, "level": {"type": "integer", "minimum": 1, "maximum": 10000}}}}}}}, "weapon_off": {"type": "object", "required": ["item_id"], "properties": {"item_id": {"type": "string", "minLength": 1}, "selections": {"type": "object", "additionalProperties": {"type": "array", "maxItems": 10, "items": {"type": "object", "required": ["position", "option_id", "level"], "properties": {"position": {"type": "integer", "minimum": 0, "maximum": 9}, "option_id": {"type": "string", "minLength": 1}, "level": {"type": "integer", "minimum": 1, "maximum": 10000}}}}}}}, "head": {"type": "object", "required": ["item_id"], "properties": {"item_id": {"type": "string", "minLength": 1}, "selections": {"type": "object", "additionalProperties": {"type": "array", "maxItems": 10, "items": {"type": "object", "required": ["position", "option_id", "level"], "properties": {"position": {"type": "integer", "minimum": 0, "maximum": 9}, "option_id": {"type": "string", "minLength": 1}, "level": {"type": "integer", "minimum": 1, "maximum": 10000}}}}}}}, "cloak": {"type": "object", "required": ["item_id"], "properties": {"item_id": {"type": "string", "minLength": 1}, "selections": {"type": "object", "additionalProperties": {"type": "array", "maxItems": 10, "items": {"type": "object", "required": ["position", "option_id", "level"], "properties": {"position": {"type": "integer", "minimum": 0, "maximum": 9}, "option_id": {"type": "string", "minLength": 1}, "level": {"type": "integer", "minimum": 1, "maximum": 10000}}}}}}}, "chest": {"type": "object", "required": ["item_id"], "properties": {"item_id": {"type": "string", "minLength": 1}, "selections": {"type": "object", "additionalProperties": {"type": "array", "maxItems": 10, "items": {"type": "object", "required": ["position", "option_id", "level"], "properties": {"position": {"type": "integer", "minimum": 0, "maximum": 9}, "option_id": {"type": "string", "minLength": 1}, "level": {"type": "integer", "minimum": 1, "maximum": 10000}}}}}}}, "hands": {"type": "object", "required": ["item_id"], "properties": {"item_id": {"type": "string", "minLength": 1}, "selections": {"type": "object", "additionalProperties": {"type": "array", "maxItems": 10, "items": {"type": "object", "required": ["position", "option_id", "level"], "properties": {"position": {"type": "integer", "minimum": 0, "maximum": 9}, "option_id": {"type": "string", "minLength": 1}, "level": {"type": "integer", "minimum": 1, "maximum": 10000}}}}}}}, "legs": {"type": "object", "required": ["item_id"], "properties": {"item_id": {"type": "string", "minLength": 1}, "selections": {"type": "object", "additionalProperties": {"type": "array", "maxItems": 10, "items": {"type": "object", "required": ["position", "option_id", "level"], "properties": {"position": {"type": "integer", "minimum": 0, "maximum": 9}, "option_id": {"type": "string", "minLength": 1}, "level": {"type": "integer", "minimum": 1, "maximum": 10000}}}}}}}, "feet": {"type": "object", "required": ["item_id"], "properties": {"item_id": {"type": "string", "minLength": 1}, "selections": {"type": "object", "additionalProperties": {"type": "array", "maxItems": 10, "items": {"type": "object", "required": ["position", "option_id", "level"], "properties": {"position": {"type": "integer", "minimum": 0, "maximum": 9}, "option_id": {"type": "string", "minLength": 1}, "level": {"type": "integer", "minimum": 1, "maximum": 10000}}}}}}}, "neck": {"type": "object", "required": ["item_id"], "properties": {"item_id": {"type": "string", "minLength": 1}, "selections": {"type": "object", "additionalProperties": {"type": "array", "maxItems": 10, "items": {"type": "object", "required": ["position", "option_id", "level"], "properties": {"position": {"type": "integer", "minimum": 0, "maximum": 9}, "option_id": {"type": "string", "minLength": 1}, "level": {"type": "integer", "minimum": 1, "maximum": 10000}}}}}}}, "bracelet": {"type": "object", "required": ["item_id"], "properties": {"item_id": {"type": "string", "minLength": 1}, "selections": {"type": "object", "additionalProperties": {"type": "array", "maxItems": 10, "items": {"type": "object", "required": ["position", "option_id", "level"], "properties": {"position": {"type": "integer", "minimum": 0, "maximum": 9}, "option_id": {"type": "string", "minLength": 1}, "level": {"type": "integer", "minimum": 1, "maximum": 10000}}}}}}}, "ring_1": {"type": "object", "required": ["item_id"], "properties": {"item_id": {"type": "string", "minLength": 1}, "selections": {"type": "object", "additionalProperties": {"type": "array", "maxItems": 10, "items": {"type": "object", "required": ["position", "option_id", "level"], "properties": {"position": {"type": "integer", "minimum": 0, "maximum": 9}, "option_id": {"type": "string", "minLength": 1}, "level": {"type": "integer", "minimum": 1, "maximum": 10000}}}}}}}, "ring_2": {"type": "object", "required": ["item_id"], "properties": {"item_id": {"type": "string", "minLength": 1}, "selections": {"type": "object", "additionalProperties": {"type": "array", "maxItems": 10, "items": {"type": "object", "required": ["position", "option_id", "level"], "properties": {"position": {"type": "integer", "minimum": 0, "maximum": 9}, "option_id": {"type": "string", "minLength": 1}, "level": {"type": "integer", "minimum": 1, "maximum": 10000}}}}}}}, "belt": {"type": "object", "required": ["item_id"], "properties": {"item_id": {"type": "string", "minLength": 1}, "selections": {"type": "object", "additionalProperties": {"type": "array", "maxItems": 10, "items": {"type": "object", "required": ["position", "option_id", "level"], "properties": {"position": {"type": "integer", "minimum": 0, "maximum": 9}, "option_id": {"type": "string", "minLength": 1}, "level": {"type": "integer", "minimum": 1, "maximum": 10000}}}}}}}}}}}, "BuildImport": {"anyOf": [{"$ref": "#/components/schemas/Build"}, {"type": "object", "required": ["build"], "properties": {"build": {"$ref": "#/components/schemas/Build"}, "target_id": {"type": "string", "description": "Опционально: ID своей существующей сборки для полной замены. Без него создаётся копия."}}}, {"type": "object", "required": ["solution_template"], "properties": {"solution_template": {"$ref": "#/components/schemas/Build"}, "target_id": {"type": "string"}}}]}}}}