# Trash

## Список видалених профілів

`GET /trash`

```json
{
  "tags": [
    "Trash"
  ],
  "summary": "Список видалених профілів",
  "description": "Повертає профілі, заархівовані `DELETE /profiles/{id}`, спочатку найновіші, із часом їх відновлення. Прострочені записи видаляються під час запуску програми запуску.",
  "responses": {
    "200": {
      "description": "Вміст «Кошика».",
      "content": {
        "application/json": {
          "schema": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/TrashEntry"
            }
          }
        }
      }
    },
    "401": {
      "$ref": "#/components/responses/Unauthorized"
    }
  }
}
```

## Відновити видалений профіль

`POST /trash/{id}/restore`

```json
{
  "tags": [
    "Trash"
  ],
  "summary": "Відновити видалений профіль",
  "description": "Відновлює профіль під його **власним ідентифікатором**, тому скрипт, папка закладок або прив’язка проксі, що посилаються на нього, продовжать працювати. Архів видаляється після відновлення.\n\nВідновлюються облікові дані, cookies, логіни, вебдані, налаштування, історія, закладки, Local Storage та IndexedDB. Кеш не архівується і створюється знову під час наступного запуску.",
  "parameters": [
    {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
        "type": "string",
        "format": "uuid"
      }
    }
  ],
  "responses": {
    "200": {
      "description": "Відновлений профіль.",
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/ProfileMeta"
          }
        }
      }
    },
    "401": {
      "$ref": "#/components/responses/Unauthorized"
    },
    "404": {
      "description": "Немає видалених профілів із цим ідентифікатором.",
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/Error"
          }
        }
      }
    }
  }
}
```

## Назавжди видалити викинутий профіль

`DELETE /trash/{id}`

```json
{
  "tags": [
    "Trash"
  ],
  "summary": "Назавжди видалити викинутий профіль",
  "description": "Цю дію не можна скасувати: архів є єдиною копією, що залишилася.",
  "parameters": [
    {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
        "type": "string",
        "format": "uuid"
      }
    }
  ],
  "responses": {
    "200": {
      "description": "Очищений.",
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "properties": {
              "purged": {
                "type": "boolean",
                "example": true
              },
              "id": {
                "type": "string",
                "format": "uuid"
              }
            }
          }
        }
      }
    },
    "401": {
      "$ref": "#/components/responses/Unauthorized"
    }
  }
}
```
