# 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": "使用配置文件的**原始 ID**恢复它，因此引用该配置文件的脚本、书签文件夹或代理绑定仍然有效。恢复后会删除归档。\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": "没有使用此 ID 的已删除配置文件。",
      "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"
    }
  }
}
```
