@adonis-agora/media-dashboard 10.0.0-rc.3 → 10.0.0-rc.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,21 @@
1
1
  # @adonis-agora/media-dashboard
2
2
 
3
+ ## 10.0.0-rc.4
4
+
5
+ ### Major Changes
6
+
7
+ - [#301](https://github.com/DavideCarvalho/adonis-agora-media/pull/301) [`4fdd451`](https://github.com/DavideCarvalho/adonis-agora-media/commit/4fdd4513f77c5d640bafee365ef7bf22afb557cc) Thanks [@DavideCarvalho](https://github.com/DavideCarvalho)! - The console's list routes use the `@adonis-agora/filter` list format.
8
+
9
+ - `GET /objects`: `?disk=&prefix=` → `?filter[disk]=&filter[prefix]=` (`filter[disk]` required). Paging stays `after` / `first` (default and max 1000). The response is `{ data, meta: { nextCursor, prevCursor, hasNext, hasPrev } }`; `data` holds folders, then files, each tagged `type: 'folder' | 'file'` (was `{ folders, files, nextCursor, prevCursor, hasNext, hasPrev }`). `sort` accepts only `key`.
10
+ - `GET /collections`: `?collection=&ownerType=&ownerId=&prefix=` → `?filter[collection]=&filter[ownerType]=&filter[ownerId]=&filter[prefix]=`. Paging stays `after` / `first` (default 50, max 200). The response is `{ data, meta }` (was `{ items, nextCursor, prevCursor, hasNext, hasPrev }`). `sort` accepts only `-createdAt`.
11
+ - `GET /uploads`: `?disk=&prefix=` → `?filter[disk]=&filter[prefix]=`; `sort=createdAt|-createdAt` (default newest first). Response `{ data }` (was `{ uploads }`).
12
+ - `GET /disks` answers `{ data }` (was `{ disks }`); `GET /collections/summary` answers `{ data }` (was `{ collections }`).
13
+ - An unknown filter field, an operator other than equality, a sort outside the route's list, or `before` / `last` is a `400`.
14
+ - `DashboardService`: `objects()` and `collections()` return `CursorPageResponse<T>` (`{ data, meta }`); `disks()`, `uploads()` and `collectionsSummary()` return `{ data }`; `uploads()` takes `order: 'asc' | 'desc'`.
15
+ - Types: `CursorPage` and `CursorPageInfo` are removed; new `CursorPageResponse<T>`, `CursorPageMeta`, `ListResponse<T>`, `ObjectListItem`, `UploadFilter`. `ObjectListResponse`, `CollectionListResponse`, `DiskListResponse`, `UploadListResponse` and `CollectionsSummaryResponse` change shape as above.
16
+ - New `readObjectsQuery`, `readCollectionsQuery` and `readUploadsQuery` in `@adonis-agora/media/dashboard` read these routes' query strings for your own routes.
17
+ - `@adonis-agora/media` now depends on `@adonis-agora/filter`.
18
+
3
19
  ## 10.0.0-rc.3
4
20
 
5
21
  ### Minor Changes
package/README.md CHANGED
@@ -65,13 +65,14 @@ Registered under `apiBasePath` (default `<basePath>/api`), behind `authorize` an
65
65
  | --- | --- | --- |
66
66
  | `GET` | `/topology` | capability probe |
67
67
  | `GET` | `/disks` | `StorageManager` + `DiskCapabilities` |
68
- | `GET` | `/objects?disk&prefix&after&first` | disk `list` |
68
+ | `GET` | `/objects?filter[disk]&filter[prefix]&after&first` | disk `list` |
69
69
  | `GET` | `/object?disk&key` | disk `stat` + signed URL |
70
- | `GET` | `/uploads?disk&prefix` | `ResumableUploadManager.list()` |
70
+ | `GET` | `/uploads?filter[disk]&filter[prefix]&sort` | `ResumableUploadManager.list()` |
71
+ | `GET` | `/collections?filter[collection]&filter[ownerType]&filter[ownerId]&filter[prefix]&after&first` | `MediaStore.list` |
71
72
  | `POST` | `/copy` · `/move` | disk `copy`/`move` (streamed for cross-disk) |
72
73
  | `POST` | `/delete` | disk `deleteMany` |
73
74
 
74
- Listings page through the ecosystem's **cursor** interface — `?after=<previous nextCursor>&first=<page size>` in, `{ …payload, nextCursor, prevCursor, hasNext, hasPrev }` out — mirroring `@adonis-agora/filter`'s `CursorParams` / `CursorPage`. The backend (S3's `ListObjectsV2` continuation token) is **forward-only**, so `before` / `last` are not accepted and `prevCursor` / `hasPrev` are always `null` / `false`.
75
+ List routes speak the `@adonis-agora/filter` list format: filters as `filter[field]=value`, `sort` against a per-route allow-list, an unknown field or sort answered with `400`. `/objects` and `/collections` page with `?after=<meta.nextCursor>&first=<size>` and answer `{ data, meta: { nextCursor, prevCursor, hasNext, hasPrev } }`; the other lists answer `{ data }`. Paging is forward only: `before` / `last` are a `400`, and `prevCursor` / `hasPrev` are always `null` / `false`.
75
76
 
76
77
  Uploads use the core `@adonis-agora/media` TUS/direct routes via `@adonis-agora/media-react`.
77
78
 
package/dist/index.d.ts CHANGED
@@ -3,5 +3,5 @@
3
3
  * itself (provider, `defineConfig`, `DashboardService`, `authorize`) ships in `@adonis-agora/media`
4
4
  * under `./dashboard_provider` and `./dashboard`; this package is the SPA's build-time source.
5
5
  */
6
- export type { CollectionFilter, CollectionListResponse, CollectionSummary, CollectionsSummaryResponse, CopyMoveBody, CursorPage, CursorPageInfo, CursorParams, DeleteBody, DiskCapabilities, DiskInfo, DiskListResponse, FolderBody, MediaDetailResponse, MediaEntry, MediaVariant, ObjectDetailResponse, ObjectEntry, ObjectFolder, ObjectInsight, ObjectInsightFact, ObjectInsightLink, ObjectInsightsResponse, ObjectListResponse, Topology, UploadDetailResponse, UploadInfo, UploadListResponse, UploadPart, } from './types.js';
6
+ export type { CollectionFilter, CollectionListResponse, CollectionSummary, CollectionsSummaryResponse, CopyMoveBody, CursorPageMeta, CursorPageResponse, CursorParams, DeleteBody, DiskCapabilities, DiskInfo, DiskListResponse, FolderBody, ListResponse, MediaDetailResponse, MediaEntry, MediaVariant, ObjectDetailResponse, ObjectEntry, ObjectFolder, ObjectInsight, ObjectInsightFact, ObjectInsightLink, ObjectInsightsResponse, ObjectListItem, ObjectListResponse, Topology, UploadDetailResponse, UploadFilter, UploadInfo, UploadListResponse, UploadPart, } from './types.js';
7
7
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,YAAY,EACV,gBAAgB,EAChB,sBAAsB,EACtB,iBAAiB,EACjB,0BAA0B,EAC1B,YAAY,EACZ,UAAU,EACV,cAAc,EACd,YAAY,EACZ,UAAU,EACV,gBAAgB,EAChB,QAAQ,EACR,gBAAgB,EAChB,UAAU,EACV,mBAAmB,EACnB,UAAU,EACV,YAAY,EACZ,oBAAoB,EACpB,WAAW,EACX,YAAY,EACZ,aAAa,EACb,iBAAiB,EACjB,iBAAiB,EACjB,sBAAsB,EACtB,kBAAkB,EAClB,QAAQ,EACR,oBAAoB,EACpB,UAAU,EACV,kBAAkB,EAClB,UAAU,GACX,MAAM,YAAY,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,YAAY,EACV,gBAAgB,EAChB,sBAAsB,EACtB,iBAAiB,EACjB,0BAA0B,EAC1B,YAAY,EACZ,cAAc,EACd,kBAAkB,EAClB,YAAY,EACZ,UAAU,EACV,gBAAgB,EAChB,QAAQ,EACR,gBAAgB,EAChB,UAAU,EACV,YAAY,EACZ,mBAAmB,EACnB,UAAU,EACV,YAAY,EACZ,oBAAoB,EACpB,WAAW,EACX,YAAY,EACZ,aAAa,EACb,iBAAiB,EACjB,iBAAiB,EACjB,sBAAsB,EACtB,cAAc,EACd,kBAAkB,EAClB,QAAQ,EACR,oBAAoB,EACpB,YAAY,EACZ,UAAU,EACV,kBAAkB,EAClB,UAAU,GACX,MAAM,YAAY,CAAC"}