Update DTOs and add spatie/laravel-data package to manage them

This commit is contained in:
DariusIII
2026-04-28 12:17:24 +02:00
parent e90ce311b3
commit fe50781a8e
51 changed files with 2248 additions and 1232 deletions
+29 -11
View File
@@ -62,17 +62,35 @@ Sorting examples:
JSON sorting response snippet (`sort=size_desc`):
```json
{
"Total": 2,
"Results": [
{ "title": "Ubuntu ISO x64", "size": 734003200 },
{ "title": "Ubuntu ISO x86", "size": 367001600 }
]
}
```http
HTTP/1.1 200 OK
Content-Type: application/json
X-Total-Count: 2
X-Api-Current: 0
X-Api-Max: 100
X-Grab-Current: 0
X-Grab-Max: 100
X-Api-Oldest-Time:
```
Releases are ordered largest-to-smallest because `sort=size_desc`.
> **Breaking change (April 2026):** the legacy `Results` (capital R) JSON
> envelope — previously produced by `spatie/laravel-fractal` — has been
> removed entirely. Search endpoints now return a bare top-level JSON array of
> `App\Data\Api\ReleaseData` payloads. Pagination total and per-user API/grab
`Results` are ordered largest-to-smallest because `sort=size_desc`.
> quotas have moved to response headers (`X-Total-Count`, `X-Api-Current`,
> `X-Api-Max`, `X-Grab-Current`, `X-Grab-Max`, `X-Api-Oldest-Time`,
> `X-Grab-Oldest-Time`). Movie/TV-only fields (`tvdbid`, `imdbid`, `season`, …)
> are omitted from each release object when not applicable to its category,
> instead of being emitted as `null`. TypeScript definitions are auto-generated
> to `resources/js/types/generated.d.ts`.
## Endpoints
## 1) Capabilities
- `GET /capabilities`
- Auth: none
Returns:
@@ -100,7 +118,7 @@ Behavior:
- `GET /tv`
- Auth: required
- Includes API usage counters in response (`apiCurrent`, `apiMax`, `grabCurrent`, `grabMax`, `apiOldestTime`, `grabOldestTime`).
Identifiers:
- `vid`, `tvdbid`, `traktid`, `rid`, `tvmazeid`, `imdbid`, `tmdbid`
@@ -185,7 +203,7 @@ Selectors:
### Details Object (`/details`)
"Results": []
Returns a single release object (not envelope). Download field name is `link` (not `url`).
## Error Response Conventions