@adonis-agora/media 1.0.0-rc.0 → 1.0.0-rc.2

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.
Files changed (47) hide show
  1. package/CHANGELOG.md +26 -0
  2. package/README.md +3 -2
  3. package/dist/assets/spa/assets/index-DOnygWEb.js +12 -0
  4. package/dist/assets/spa/assets/index-DOnygWEb.js.map +1 -0
  5. package/dist/assets/spa/assets/index-XkvYeRIj.css +2 -0
  6. package/dist/assets/spa/index.html +2 -2
  7. package/dist/providers/dashboard_provider.d.ts.map +1 -1
  8. package/dist/providers/dashboard_provider.js +97 -230
  9. package/dist/providers/dashboard_provider.js.map +1 -1
  10. package/dist/src/dashboard/access_denied_page.d.ts +5 -7
  11. package/dist/src/dashboard/access_denied_page.d.ts.map +1 -1
  12. package/dist/src/dashboard/access_denied_page.js +2 -6
  13. package/dist/src/dashboard/access_denied_page.js.map +1 -1
  14. package/dist/src/dashboard/console_authorize.d.ts +90 -0
  15. package/dist/src/dashboard/console_authorize.d.ts.map +1 -0
  16. package/dist/src/dashboard/console_authorize.js +136 -0
  17. package/dist/src/dashboard/console_authorize.js.map +1 -0
  18. package/dist/src/dashboard/define_config.d.ts +19 -51
  19. package/dist/src/dashboard/define_config.d.ts.map +1 -1
  20. package/dist/src/dashboard/define_config.js.map +1 -1
  21. package/dist/src/dashboard/dev_tools.d.ts +95 -0
  22. package/dist/src/dashboard/dev_tools.d.ts.map +1 -0
  23. package/dist/src/dashboard/dev_tools.js +288 -0
  24. package/dist/src/dashboard/dev_tools.js.map +1 -0
  25. package/dist/src/dashboard/index.d.ts +6 -4
  26. package/dist/src/dashboard/index.d.ts.map +1 -1
  27. package/dist/src/dashboard/index.js +3 -2
  28. package/dist/src/dashboard/index.js.map +1 -1
  29. package/dist/src/dashboard/service.d.ts +5 -1
  30. package/dist/src/dashboard/service.d.ts.map +1 -1
  31. package/dist/src/dashboard/service.js +13 -2
  32. package/dist/src/dashboard/service.js.map +1 -1
  33. package/dist/src/dashboard/types.d.ts +0 -17
  34. package/dist/src/dashboard/types.d.ts.map +1 -1
  35. package/dist/stubs/config/media_dashboard.stub +8 -20
  36. package/package.json +3 -3
  37. package/dist/assets/spa/assets/index-C-7cKQuV.js +0 -12
  38. package/dist/assets/spa/assets/index-C-7cKQuV.js.map +0 -1
  39. package/dist/assets/spa/assets/index-Db6cSeO5.css +0 -2
  40. package/dist/src/dashboard/auth.d.ts +0 -76
  41. package/dist/src/dashboard/auth.d.ts.map +0 -1
  42. package/dist/src/dashboard/auth.js +0 -134
  43. package/dist/src/dashboard/auth.js.map +0 -1
  44. package/dist/src/dashboard/cookie.d.ts +0 -20
  45. package/dist/src/dashboard/cookie.d.ts.map +0 -1
  46. package/dist/src/dashboard/cookie.js +0 -44
  47. package/dist/src/dashboard/cookie.js.map +0 -1
@@ -9,9 +9,12 @@ import { defineConfig } from '@adonis-agora/media/dashboard'
9
9
  * 'configure' above). Storage, uploads and everything else come from the already-configured
10
10
  * @adonis-agora/media manager; this config only places the console and picks which disks are browsable.
11
11
  *
12
- * The console is a READ-ONLY browser by default. Flip 'actions' on to enable copy/move/delete -- gate
13
- * the routes with your own 'middleware' (an auth guard) before you do, and/or configure 'auth' for a
14
- * built-in session-cookie login independent of 'middleware'.
12
+ * 'authorize' decides who may open the console. Until you set it, the console is open outside production
13
+ * and its pages and API answer 403 in production. It takes a function, a class with an
14
+ * 'authorize(ctx)' method, or a lazy import of one: () => import('#policies/console_access').
15
+ * Sign-in is this app's own: return { redirectTo: '/login' } to send a signed-out visitor there.
16
+ *
17
+ * The console is a READ-ONLY browser by default. Flip 'actions' on to enable copy/move/delete.
15
18
  */
16
19
  export default defineConfig({
17
20
  // enabled: true,
@@ -19,7 +22,8 @@ export default defineConfig({
19
22
  // apiBasePath: '/media/dashboard/api',
20
23
  // actions: true,
21
24
  // disks: ['s3', 'backups'], // default: derived from config/media.ts
22
- // middleware: middleware.auth(), // gate the whole console — SPA + API
25
+ // authorize: (ctx) => ctx.auth.user?.isAdmin === true, // who may open it — SPA + API
26
+ // middleware: middleware.auth(), // runs after authorize
23
27
 
24
28
  // Where the 'url' the console reports for an object points: 'auto' signs a URL straight
25
29
  // to the store; 'proxy' routes it through this app's own '<apiBasePath>/object/raw'. Use 'proxy'
@@ -27,20 +31,4 @@ export default defineConfig({
27
31
  // a signed URL for an internal endpoint resolves nowhere in a browser. When unset, the console
28
32
  // follows config/media.ts: 'delivery.mode: proxy' there implies 'proxy' here.
29
33
  // objectUrls: 'proxy',
30
-
31
- // Built-in session-cookie login, independent of (and composable with) 'middleware'. At least one of
32
- // 'login'/'session' is required when 'auth' is set.
33
- // auth: {
34
- // secret: env.get('MEDIA_DASHBOARD_SECRET'),
35
- // ttl: '8h',
36
- // // Mode B — standalone login page (the SPA renders it until a valid cookie exists).
37
- // login: async (username, password) => {
38
- // if (username === 'admin' && password === env.get('MEDIA_DASHBOARD_PASSWORD')) {
39
- // return { id: 'admin', name: 'Admin' }
40
- // }
41
- // return null
42
- // },
43
- // // Mode A — mint a session for an already-authenticated host request.
44
- // // session: async (request) => (request.user?.isAdmin ? { id: request.user.id } : null),
45
- // },
46
34
  })
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adonis-agora/media",
3
- "version": "1.0.0-rc.0",
3
+ "version": "1.0.0-rc.2",
4
4
  "description": "Media-library for AdonisJS — owner collections (MIME whitelist, single-file replace, ordering), image conversions (eager/lazy), pluggable content transformers (HLS video via mediabunny, metadata probe, image blur-up placeholder), and column attachments, all on top of @adonisjs/drive. Pluggable MediaStore (in-memory + Lucid) and ImageProcessor (sharp). Part of the Agora ecosystem.",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -172,8 +172,8 @@
172
172
  }
173
173
  },
174
174
  "devDependencies": {
175
- "@adonis-agora/media-dashboard": "10.0.0-rc.0",
176
- "@adonis-agora/media-react": "1.0.0-rc.0",
175
+ "@adonis-agora/media-dashboard": "10.0.0-rc.1",
176
+ "@adonis-agora/media-react": "1.0.0-rc.1",
177
177
  "@adonisjs/assembler": "8.6.0",
178
178
  "@adonisjs/core": "7.6.0",
179
179
  "@adonisjs/drive": "4.0.0",