@adonis-agora/media-dashboard 0.1.0
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 +8 -0
- package/LICENSE +21 -0
- package/README.md +63 -0
- package/dist/define_config.d.ts +33 -0
- package/dist/define_config.d.ts.map +1 -0
- package/dist/define_config.js +5 -0
- package/dist/define_config.js.map +1 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +4 -0
- package/dist/index.js.map +1 -0
- package/dist/provider/media_dashboard_provider.d.ts +23 -0
- package/dist/provider/media_dashboard_provider.d.ts.map +1 -0
- package/dist/provider/media_dashboard_provider.js +238 -0
- package/dist/provider/media_dashboard_provider.js.map +1 -0
- package/dist/provider/serve.d.ts +23 -0
- package/dist/provider/serve.d.ts.map +1 -0
- package/dist/provider/serve.js +41 -0
- package/dist/provider/serve.js.map +1 -0
- package/dist/server/service.d.ts +94 -0
- package/dist/server/service.d.ts.map +1 -0
- package/dist/server/service.js +212 -0
- package/dist/server/service.js.map +1 -0
- package/dist/spa/assets/index-BaYNF8Yc.css +1 -0
- package/dist/spa/assets/index-Cl9VmS5k.js +50 -0
- package/dist/spa/assets/index-Cl9VmS5k.js.map +1 -0
- package/dist/spa/index.html +14 -0
- package/dist/types.d.ts +121 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +10 -0
- package/dist/types.js.map +1 -0
- package/package.json +81 -0
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
<!doctype html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="UTF-8" />
|
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
6
|
+
<meta name="robots" content="noindex" />
|
|
7
|
+
<title>Media · Agora</title>
|
|
8
|
+
<script type="module" crossorigin src="/__MEDIA_DASHBOARD__/assets/index-Cl9VmS5k.js"></script>
|
|
9
|
+
<link rel="stylesheet" crossorigin href="/__MEDIA_DASHBOARD__/assets/index-BaYNF8Yc.css">
|
|
10
|
+
</head>
|
|
11
|
+
<body>
|
|
12
|
+
<div id="root"></div>
|
|
13
|
+
</body>
|
|
14
|
+
</html>
|
package/dist/types.d.ts
ADDED
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The JSON API contract shared by the dashboard's browser client and its AdonisJS provider routes.
|
|
3
|
+
*
|
|
4
|
+
* These shapes are framework-free (no DOM, no Node) so the same declarations type both the server
|
|
5
|
+
* responses (`DashboardService`) and the SPA's fetch client. They mirror the real
|
|
6
|
+
* `@adonis-agora/media` surface: disk `list`/`stat`/`copy`/`move`/`deleteMany` and the resumable
|
|
7
|
+
* `UploadSessionStore.list()` — never a bespoke server model.
|
|
8
|
+
*/
|
|
9
|
+
/** Coarse capability descriptor for a disk, mirroring `@adonis-agora/media`'s `DiskCapabilities`. */
|
|
10
|
+
export interface DiskCapabilities {
|
|
11
|
+
presign: boolean;
|
|
12
|
+
multipart: boolean;
|
|
13
|
+
publicUrls: boolean;
|
|
14
|
+
/** Can enumerate keys under a prefix — only such disks are browsable in the console. */
|
|
15
|
+
list: boolean;
|
|
16
|
+
}
|
|
17
|
+
/** One disk (bucket) exposed to the console. */
|
|
18
|
+
export interface DiskInfo {
|
|
19
|
+
name: string;
|
|
20
|
+
/** Whether this is the manager's default disk. */
|
|
21
|
+
default: boolean;
|
|
22
|
+
capabilities: DiskCapabilities;
|
|
23
|
+
}
|
|
24
|
+
export interface DiskListResponse {
|
|
25
|
+
disks: DiskInfo[];
|
|
26
|
+
}
|
|
27
|
+
/** A sub-folder under the browsed prefix (a `CommonPrefix`; `prefix` carries the trailing slash). */
|
|
28
|
+
export interface ObjectFolder {
|
|
29
|
+
name: string;
|
|
30
|
+
prefix: string;
|
|
31
|
+
}
|
|
32
|
+
/** A file entry directly under the browsed prefix. */
|
|
33
|
+
export interface ObjectEntry {
|
|
34
|
+
key: string;
|
|
35
|
+
name: string;
|
|
36
|
+
sizeBytes: number | null;
|
|
37
|
+
/** ISO-8601 string, or null when the backend does not report it. */
|
|
38
|
+
lastModified: string | null;
|
|
39
|
+
}
|
|
40
|
+
/** One page of a bucket listing (cursor-based, from the disk `list`). */
|
|
41
|
+
export interface ObjectListResponse {
|
|
42
|
+
folders: ObjectFolder[];
|
|
43
|
+
files: ObjectEntry[];
|
|
44
|
+
/** Present only when the page is truncated; pass back as `cursor`. */
|
|
45
|
+
cursor?: string;
|
|
46
|
+
}
|
|
47
|
+
/** Object metadata plus a short-lived signed URL for preview/download. */
|
|
48
|
+
export interface ObjectDetailResponse {
|
|
49
|
+
key: string;
|
|
50
|
+
size: number;
|
|
51
|
+
contentType?: string;
|
|
52
|
+
lastModified?: string;
|
|
53
|
+
url: string;
|
|
54
|
+
}
|
|
55
|
+
/** An in-progress resumable upload session, projected from `UploadSession`. */
|
|
56
|
+
export interface UploadInfo {
|
|
57
|
+
id: string;
|
|
58
|
+
disk: string;
|
|
59
|
+
key: string;
|
|
60
|
+
offset: number;
|
|
61
|
+
size: number | null;
|
|
62
|
+
/** 0..100, or null when the total size is unknown. */
|
|
63
|
+
percent: number | null;
|
|
64
|
+
parts: number;
|
|
65
|
+
multipart: boolean;
|
|
66
|
+
createdAt?: string;
|
|
67
|
+
}
|
|
68
|
+
export interface UploadListResponse {
|
|
69
|
+
uploads: UploadInfo[];
|
|
70
|
+
}
|
|
71
|
+
/** A stored media-library record, projected from `@adonis-agora/media`'s `MediaRecord` for the console. */
|
|
72
|
+
export interface MediaEntry {
|
|
73
|
+
id: string;
|
|
74
|
+
ownerType: string;
|
|
75
|
+
ownerId: string;
|
|
76
|
+
collection: string;
|
|
77
|
+
/** Logical display name. */
|
|
78
|
+
name: string;
|
|
79
|
+
fileName: string;
|
|
80
|
+
mimeType: string;
|
|
81
|
+
sizeBytes: number;
|
|
82
|
+
disk: string;
|
|
83
|
+
path: string;
|
|
84
|
+
/** Names of the generated conversions present on the record (e.g. `["thumb"]`). */
|
|
85
|
+
conversions: string[];
|
|
86
|
+
createdAt: string;
|
|
87
|
+
updatedAt: string;
|
|
88
|
+
}
|
|
89
|
+
/** One page of the cross-owner collections listing (cursor-based, from the `MediaStore.list`). */
|
|
90
|
+
export interface CollectionListResponse {
|
|
91
|
+
items: MediaEntry[];
|
|
92
|
+
/** Present (non-null) only when a further page exists; pass back as `cursor`. */
|
|
93
|
+
nextCursor: string | null;
|
|
94
|
+
}
|
|
95
|
+
/** Filters for the collections listing — every field optional and `AND`ed server-side. */
|
|
96
|
+
export interface CollectionFilter {
|
|
97
|
+
collection?: string;
|
|
98
|
+
ownerType?: string;
|
|
99
|
+
ownerId?: string;
|
|
100
|
+
prefix?: string;
|
|
101
|
+
}
|
|
102
|
+
/** Coarse console topology used to enable/disable UI affordances. */
|
|
103
|
+
export interface Topology {
|
|
104
|
+
disks: number;
|
|
105
|
+
hasUploads: boolean;
|
|
106
|
+
/** Whether mutating actions (copy/move/delete) are enabled on this console. */
|
|
107
|
+
actions: boolean;
|
|
108
|
+
}
|
|
109
|
+
/** Body for the copy/move actions — `toDisk` defaults to the source disk (same-bucket). */
|
|
110
|
+
export interface CopyMoveBody {
|
|
111
|
+
disk: string;
|
|
112
|
+
from: string;
|
|
113
|
+
to: string;
|
|
114
|
+
toDisk?: string;
|
|
115
|
+
}
|
|
116
|
+
/** Body for the batched delete action. */
|
|
117
|
+
export interface DeleteBody {
|
|
118
|
+
disk: string;
|
|
119
|
+
keys: string[];
|
|
120
|
+
}
|
|
121
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,qGAAqG;AACrG,MAAM,WAAW,gBAAgB;IAC/B,OAAO,EAAE,OAAO,CAAC;IACjB,SAAS,EAAE,OAAO,CAAC;IACnB,UAAU,EAAE,OAAO,CAAC;IACpB,wFAAwF;IACxF,IAAI,EAAE,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,0CAA0C;AAC1C,MAAM,WAAW,UAAU;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,EAAE,CAAC;CAChB"}
|
package/dist/types.js
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The JSON API contract shared by the dashboard's browser client and its AdonisJS provider routes.
|
|
3
|
+
*
|
|
4
|
+
* These shapes are framework-free (no DOM, no Node) so the same declarations type both the server
|
|
5
|
+
* responses (`DashboardService`) and the SPA's fetch client. They mirror the real
|
|
6
|
+
* `@adonis-agora/media` surface: disk `list`/`stat`/`copy`/`move`/`deleteMany` and the resumable
|
|
7
|
+
* `UploadSessionStore.list()` — never a bespoke server model.
|
|
8
|
+
*/
|
|
9
|
+
export {};
|
|
10
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG"}
|
package/package.json
ADDED
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@adonis-agora/media-dashboard",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Media-management dashboard for @adonis-agora/media — browse buckets, watch resumable uploads in progress, upload, and copy/move/delete objects across buckets. A React SPA served by a thin AdonisJS provider, themed to Agora design tokens. Part of the Agora ecosystem.",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"repository": {
|
|
7
|
+
"type": "git",
|
|
8
|
+
"url": "git+https://github.com/DavideCarvalho/adonis-media.git",
|
|
9
|
+
"directory": "packages/dashboard"
|
|
10
|
+
},
|
|
11
|
+
"author": "Davi Carvalho <davi@goflip.ai>",
|
|
12
|
+
"type": "module",
|
|
13
|
+
"main": "./dist/index.js",
|
|
14
|
+
"types": "./dist/index.d.ts",
|
|
15
|
+
"exports": {
|
|
16
|
+
".": {
|
|
17
|
+
"types": "./dist/index.d.ts",
|
|
18
|
+
"import": "./dist/index.js",
|
|
19
|
+
"default": "./dist/index.js"
|
|
20
|
+
},
|
|
21
|
+
"./media_dashboard_provider": {
|
|
22
|
+
"types": "./dist/provider/media_dashboard_provider.d.ts",
|
|
23
|
+
"import": "./dist/provider/media_dashboard_provider.js",
|
|
24
|
+
"default": "./dist/provider/media_dashboard_provider.js"
|
|
25
|
+
},
|
|
26
|
+
"./types": {
|
|
27
|
+
"types": "./dist/types.d.ts",
|
|
28
|
+
"import": "./dist/types.js",
|
|
29
|
+
"default": "./dist/types.js"
|
|
30
|
+
}
|
|
31
|
+
},
|
|
32
|
+
"files": [
|
|
33
|
+
"dist/",
|
|
34
|
+
"README.md",
|
|
35
|
+
"CHANGELOG.md"
|
|
36
|
+
],
|
|
37
|
+
"sideEffects": false,
|
|
38
|
+
"peerDependencies": {
|
|
39
|
+
"@adonis-agora/media": "^0.3.0",
|
|
40
|
+
"@adonisjs/core": "^7.3.0"
|
|
41
|
+
},
|
|
42
|
+
"devDependencies": {
|
|
43
|
+
"@adonisjs/core": "^7.3.0",
|
|
44
|
+
"@tanstack/react-query": "^5.62.0",
|
|
45
|
+
"@testing-library/react": "^16.1.0",
|
|
46
|
+
"@types/node": "^20.0.0",
|
|
47
|
+
"@types/react": "^19.0.0",
|
|
48
|
+
"@types/react-dom": "^19.0.0",
|
|
49
|
+
"@vitejs/plugin-react": "^4.3.4",
|
|
50
|
+
"jsdom": "^25.0.1",
|
|
51
|
+
"react": "^19.0.0",
|
|
52
|
+
"react-dom": "^19.0.0",
|
|
53
|
+
"typescript": "^5.4.0",
|
|
54
|
+
"vite": "^6.0.0",
|
|
55
|
+
"vitest": "^3.0.0",
|
|
56
|
+
"@adonis-agora/media-react": "0.1.0",
|
|
57
|
+
"@adonis-agora/media": "0.3.2"
|
|
58
|
+
},
|
|
59
|
+
"engines": {
|
|
60
|
+
"node": ">=20.6.0"
|
|
61
|
+
},
|
|
62
|
+
"keywords": [
|
|
63
|
+
"adonisjs",
|
|
64
|
+
"adonis",
|
|
65
|
+
"media",
|
|
66
|
+
"dashboard",
|
|
67
|
+
"admin",
|
|
68
|
+
"console",
|
|
69
|
+
"s3",
|
|
70
|
+
"buckets",
|
|
71
|
+
"upload",
|
|
72
|
+
"resumable",
|
|
73
|
+
"agora"
|
|
74
|
+
],
|
|
75
|
+
"scripts": {
|
|
76
|
+
"build": "vite build && tsc -p tsconfig.server.json",
|
|
77
|
+
"test": "vitest run --passWithNoTests",
|
|
78
|
+
"test:watch": "vitest",
|
|
79
|
+
"typecheck": "tsc -p tsconfig.server.json --noEmit && tsc -p tsconfig.spa.json --noEmit"
|
|
80
|
+
}
|
|
81
|
+
}
|