@adonis-agora/media-dashboard 6.1.0 → 8.0.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.
Files changed (40) hide show
  1. package/CHANGELOG.md +24 -0
  2. package/README.md +38 -5
  3. package/dist/index.d.ts +12 -8
  4. package/dist/index.d.ts.map +1 -1
  5. package/dist/index.js +12 -4
  6. package/dist/index.js.map +1 -1
  7. package/dist/provider/media_dashboard_provider.d.ts +26 -7
  8. package/dist/provider/media_dashboard_provider.d.ts.map +1 -1
  9. package/dist/provider/media_dashboard_provider.js +37 -492
  10. package/dist/provider/media_dashboard_provider.js.map +1 -1
  11. package/dist/spa/assets/index-Bo658_9z.js +83 -0
  12. package/dist/spa/assets/index-Bo658_9z.js.map +1 -0
  13. package/dist/spa/index.html +1 -1
  14. package/package.json +6 -6
  15. package/dist/define_config.d.ts +0 -49
  16. package/dist/define_config.d.ts.map +0 -1
  17. package/dist/define_config.js +0 -5
  18. package/dist/define_config.js.map +0 -1
  19. package/dist/provider/serve.d.ts +0 -23
  20. package/dist/provider/serve.d.ts.map +0 -1
  21. package/dist/provider/serve.js +0 -41
  22. package/dist/provider/serve.js.map +0 -1
  23. package/dist/server/auth.d.ts +0 -76
  24. package/dist/server/auth.d.ts.map +0 -1
  25. package/dist/server/auth.js +0 -134
  26. package/dist/server/auth.js.map +0 -1
  27. package/dist/server/cookie.d.ts +0 -20
  28. package/dist/server/cookie.d.ts.map +0 -1
  29. package/dist/server/cookie.js +0 -44
  30. package/dist/server/cookie.js.map +0 -1
  31. package/dist/server/object_insights.d.ts +0 -42
  32. package/dist/server/object_insights.d.ts.map +0 -1
  33. package/dist/server/object_insights.js +0 -42
  34. package/dist/server/object_insights.js.map +0 -1
  35. package/dist/server/service.d.ts +0 -212
  36. package/dist/server/service.d.ts.map +0 -1
  37. package/dist/server/service.js +0 -470
  38. package/dist/server/service.js.map +0 -1
  39. package/dist/spa/assets/index-BtCClrPE.js +0 -83
  40. package/dist/spa/assets/index-BtCClrPE.js.map +0 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,29 @@
1
1
  # @adonis-agora/media-dashboard
2
2
 
3
+ ## 8.0.0
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [[`e2baf99`](https://github.com/DavideCarvalho/adonis-agora-media/commit/e2baf993dae1a7d3574128085abe1cf48087a023)]:
8
+ - @adonis-agora/media@0.12.0
9
+
10
+ ## 7.0.0
11
+
12
+ ### Major Changes
13
+
14
+ - [`ad61387`](https://github.com/DavideCarvalho/adonis-agora-media/commit/ad61387aba714ba85ce6a6cf810b97259db46a93) Thanks [@DavideCarvalho](https://github.com/DavideCarvalho)! - **Breaking:** the console's server-side logic (`defineConfig`/`MediaDashboardConfig`, `DashboardService`/`DashboardError`, the session-auth helpers, `ObjectInsightProvider`/`sanitizeInsight`) has moved to `@adonis-agora/media`'s new `@adonis-agora/media/dashboard` subpath, now that the console ships embedded there (see `@adonis-agora/media`'s changeset). Update any import of these from `@adonis-agora/media-dashboard` (or this package's root `.`) to `@adonis-agora/media/dashboard`.
15
+
16
+ `@adonis-agora/media-dashboard/media_dashboard_provider` is unaffected in behavior and still works exactly as before — it is now a thin delegate to `@adonis-agora/media`'s embedded `dashboard_provider` (dynamically imported at boot, to avoid a monorepo build-time cycle between the two packages) rather than owning the routing/auth/service logic itself, so a fix to the console applies to both entry points identically. `config/media_dashboard.ts` is read from the same `media_dashboard` config key either way; author it against `@adonis-agora/media/dashboard`'s `defineConfig` regardless of which provider you register.
17
+
18
+ This package's own remaining public surface (`.`) is now just the provider re-export plus the dashboard's wire-format API types (`DiskInfo`, `ObjectListResponse`, `MediaEntry`, ... — kept as this package's own copy so the SPA needs no dependency on `@adonis-agora/media`'s types).
19
+
20
+ If you don't import from this package directly (most hosts only register its provider in `adonisrc.ts`), nothing changes for you — consider switching to `@adonis-agora/media/dashboard_provider` directly, since this package is no longer required.
21
+
22
+ ### Patch Changes
23
+
24
+ - Updated dependencies [[`ad61387`](https://github.com/DavideCarvalho/adonis-agora-media/commit/ad61387aba714ba85ce6a6cf810b97259db46a93)]:
25
+ - @adonis-agora/media@0.11.0
26
+
3
27
  ## 6.1.0
4
28
 
5
29
  ### Minor Changes
package/README.md CHANGED
@@ -8,13 +8,45 @@ The console consumes the **real** media surface — disk `list`/`stat`/`copy`/`m
8
8
  the resumable `UploadSessionStore.list()` — through provider-registered routes. Nothing about storage
9
9
  is reimplemented; the upload UI reuses [`@adonis-agora/media-react`](../react).
10
10
 
11
- ## Install
11
+ ## The console ships embedded in `@adonis-agora/media` — install that instead
12
+
13
+ As of `7.0.0`, this package's install/provider story is **secondary**. The console (this same React
14
+ SPA, and all of its server-side auth/service logic) is bundled straight into
15
+ [`@adonis-agora/media`](../adonis) at build time; `node ace configure @adonis-agora/media` registers
16
+ its `dashboard_provider` for you, with no separate package to add:
12
17
 
13
18
  ```sh
14
- pnpm add @adonis-agora/media-dashboard
19
+ npm i @adonis-agora/media
20
+ node ace configure @adonis-agora/media
15
21
  ```
16
22
 
17
- Register the provider **after** the media provider in `adonisrc.ts`:
23
+ ```ts
24
+ // adonisrc.ts
25
+ providers: [
26
+ () => import('@adonis-agora/media/media_provider'),
27
+ () => import('@adonis-agora/media/dashboard_provider'),
28
+ ]
29
+ ```
30
+
31
+ ```ts
32
+ // config/media_dashboard.ts
33
+ import { defineConfig } from '@adonis-agora/media/dashboard'
34
+ ```
35
+
36
+ See [`@adonis-agora/media`'s Dashboard section](../adonis#dashboard) for the full config reference —
37
+ `defineConfig`, `DashboardService`, the session-auth helpers and `ObjectInsightProvider` all live under
38
+ `@adonis-agora/media/dashboard` now.
39
+
40
+ ## This package, standalone (advanced / legacy)
41
+
42
+ This package — and its own `media_dashboard_provider` entry point — is still published and still
43
+ works, for hosts that already register it directly, or that prefer keeping the dashboard as an
44
+ explicit, separately-versioned install. Its provider is a thin delegate to the embedded one above (no
45
+ logic of its own), so both entry points stay identical in behavior. **Register only one of the two.**
46
+
47
+ ```sh
48
+ pnpm add @adonis-agora/media-dashboard
49
+ ```
18
50
 
19
51
  ```ts
20
52
  providers: [
@@ -23,10 +55,11 @@ providers: [
23
55
  ]
24
56
  ```
25
57
 
26
- ## Configure — `config/media_dashboard.ts`
58
+ `config/media_dashboard.ts` is read from the SAME config key (`media_dashboard`) regardless of which
59
+ provider you register, authored against `@adonis-agora/media/dashboard`'s `defineConfig` either way:
27
60
 
28
61
  ```ts
29
- import { defineConfig } from '@adonis-agora/media-dashboard'
62
+ import { defineConfig } from '@adonis-agora/media/dashboard'
30
63
  import { middleware } from '#start/kernel'
31
64
 
32
65
  export default defineConfig({
package/dist/index.d.ts CHANGED
@@ -1,11 +1,15 @@
1
- export { defineConfig } from './define_config.js';
2
- export type { MediaDashboardConfig, DashboardMiddleware } from './define_config.js';
1
+ /**
2
+ * `@adonis-agora/media-dashboard`'s public surface, shrunk as of `7.0.0`: `defineConfig`,
3
+ * `DashboardService`/`DashboardError`, the session-auth helpers and `ObjectInsightProvider` all moved
4
+ * to `@adonis-agora/media`'s own `./dashboard` subpath — the console is now embedded there, and this
5
+ * package's provider (still exported below) is a thin delegate to it. Author `config/media_dashboard.ts`
6
+ * against `@adonis-agora/media/dashboard`'s `defineConfig` regardless of which provider you register;
7
+ * both read the SAME `media_dashboard` config key.
8
+ *
9
+ * What's left here: the standalone provider entry point, and the wire-format API types (kept as this
10
+ * package's own copy — the SPA needs them and importing `@adonis-agora/media`'s copy would reintroduce
11
+ * the workspace cycle the provider's delegation deliberately avoids; see that file's doc comment).
12
+ */
3
13
  export { default as MediaDashboardProvider } from './provider/media_dashboard_provider.js';
4
- export { DashboardService, DashboardError } from './server/service.js';
5
- export type { MediaManagerLike, DashboardServiceOptions } from './server/service.js';
6
- export { resolveConsoleAuth, signSessionCookie, verifySessionCookie, } from './server/auth.js';
7
- export type { ConsoleAuthOptions, ConsoleSession, ConsoleSessionUser, ResolvedConsoleAuth, AuthMode, SessionHook, LoginHook, RevalidateHook, } from './server/auth.js';
8
- export { sanitizeInsight } from './server/object_insights.js';
9
- export type { ObjectInsightProvider, ObjectInsightContext } from './server/object_insights.js';
10
14
  export type { DiskInfo, DiskListResponse, DiskCapabilities, ObjectFolder, ObjectEntry, ObjectListResponse, ObjectDetailResponse, MediaEntry, MediaVariant, MediaDetailResponse, CollectionListResponse, CollectionFilter, CollectionSummary, CollectionsSummaryResponse, UploadInfo, UploadPart, UploadListResponse, UploadDetailResponse, Topology, CopyMoveBody, DeleteBody, ObjectInsight, ObjectInsightFact, ObjectInsightLink, ObjectInsightsResponse, ConsoleSessionUserInfo, MeResponse, LoginBody, } from './types.js';
11
15
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,YAAY,EAAE,oBAAoB,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AACpF,OAAO,EAAE,OAAO,IAAI,sBAAsB,EAAE,MAAM,wCAAwC,CAAC;AAC3F,OAAO,EAAE,gBAAgB,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACvE,YAAY,EAAE,gBAAgB,EAAE,uBAAuB,EAAE,MAAM,qBAAqB,CAAC;AACrF,OAAO,EACL,kBAAkB,EAClB,iBAAiB,EACjB,mBAAmB,GACpB,MAAM,kBAAkB,CAAC;AAC1B,YAAY,EACV,kBAAkB,EAClB,cAAc,EACd,kBAAkB,EAClB,mBAAmB,EACnB,QAAQ,EACR,WAAW,EACX,SAAS,EACT,cAAc,GACf,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAC9D,YAAY,EAAE,qBAAqB,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAC;AAC/F,YAAY,EACV,QAAQ,EACR,gBAAgB,EAChB,gBAAgB,EAChB,YAAY,EACZ,WAAW,EACX,kBAAkB,EAClB,oBAAoB,EACpB,UAAU,EACV,YAAY,EACZ,mBAAmB,EACnB,sBAAsB,EACtB,gBAAgB,EAChB,iBAAiB,EACjB,0BAA0B,EAC1B,UAAU,EACV,UAAU,EACV,kBAAkB,EAClB,oBAAoB,EACpB,QAAQ,EACR,YAAY,EACZ,UAAU,EACV,aAAa,EACb,iBAAiB,EACjB,iBAAiB,EACjB,sBAAsB,EACtB,sBAAsB,EACtB,UAAU,EACV,SAAS,GACV,MAAM,YAAY,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,OAAO,EAAE,OAAO,IAAI,sBAAsB,EAAE,MAAM,wCAAwC,CAAC;AAC3F,YAAY,EACV,QAAQ,EACR,gBAAgB,EAChB,gBAAgB,EAChB,YAAY,EACZ,WAAW,EACX,kBAAkB,EAClB,oBAAoB,EACpB,UAAU,EACV,YAAY,EACZ,mBAAmB,EACnB,sBAAsB,EACtB,gBAAgB,EAChB,iBAAiB,EACjB,0BAA0B,EAC1B,UAAU,EACV,UAAU,EACV,kBAAkB,EAClB,oBAAoB,EACpB,QAAQ,EACR,YAAY,EACZ,UAAU,EACV,aAAa,EACb,iBAAiB,EACjB,iBAAiB,EACjB,sBAAsB,EACtB,sBAAsB,EACtB,UAAU,EACV,SAAS,GACV,MAAM,YAAY,CAAC"}
package/dist/index.js CHANGED
@@ -1,6 +1,14 @@
1
- export { defineConfig } from './define_config.js';
1
+ /**
2
+ * `@adonis-agora/media-dashboard`'s public surface, shrunk as of `7.0.0`: `defineConfig`,
3
+ * `DashboardService`/`DashboardError`, the session-auth helpers and `ObjectInsightProvider` all moved
4
+ * to `@adonis-agora/media`'s own `./dashboard` subpath — the console is now embedded there, and this
5
+ * package's provider (still exported below) is a thin delegate to it. Author `config/media_dashboard.ts`
6
+ * against `@adonis-agora/media/dashboard`'s `defineConfig` regardless of which provider you register;
7
+ * both read the SAME `media_dashboard` config key.
8
+ *
9
+ * What's left here: the standalone provider entry point, and the wire-format API types (kept as this
10
+ * package's own copy — the SPA needs them and importing `@adonis-agora/media`'s copy would reintroduce
11
+ * the workspace cycle the provider's delegation deliberately avoids; see that file's doc comment).
12
+ */
2
13
  export { default as MediaDashboardProvider } from './provider/media_dashboard_provider.js';
3
- export { DashboardService, DashboardError } from './server/service.js';
4
- export { resolveConsoleAuth, signSessionCookie, verifySessionCookie, } from './server/auth.js';
5
- export { sanitizeInsight } from './server/object_insights.js';
6
14
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAElD,OAAO,EAAE,OAAO,IAAI,sBAAsB,EAAE,MAAM,wCAAwC,CAAC;AAC3F,OAAO,EAAE,gBAAgB,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAEvE,OAAO,EACL,kBAAkB,EAClB,iBAAiB,EACjB,mBAAmB,GACpB,MAAM,kBAAkB,CAAC;AAW1B,OAAO,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,OAAO,EAAE,OAAO,IAAI,sBAAsB,EAAE,MAAM,wCAAwC,CAAC"}
@@ -1,12 +1,31 @@
1
1
  import type { ApplicationService } from '@adonisjs/core/types';
2
2
  /**
3
- * Mounts the media-management console: a React SPA plus a JSON API, both under a configurable path and
4
- * an optional host auth guard. The API delegates to the already-bound {@link MediaManager} singleton
5
- * (bound by `@adonis-agora/media`'s provider) via a pure {@link DashboardService} — disk
6
- * `list`/`stat`/`copy`/`move`/`deleteMany` and the resumable session store. Nothing about storage is
7
- * reimplemented here.
3
+ * Standalone entry point for the media-management console — kept for hosts that prefer registering
4
+ * `@adonis-agora/media-dashboard` explicitly (or already do). As of this package's `7.0.0`, the
5
+ * console ships EMBEDDED in `@adonis-agora/media` itself (`node ace configure @adonis-agora/media`
6
+ * wires it up for free, no separate install), and this provider is now a thin delegate to that
7
+ * embedded one — it carries no logic of its own, so a fix to the console applies to both entry points
8
+ * with nothing to keep in sync by hand.
9
+ *
10
+ * Delegating via a runtime `import()` of the bare specifier — rather than a static
11
+ * `import ... from '@adonis-agora/media/dashboard_provider'` — is deliberate, not a style choice:
12
+ * `@adonis-agora/media` is a required PEER of this package (real consumers always have it installed),
13
+ * and it must NOT become a workspace dependency here, because that would close a build cycle
14
+ * (`@adonis-agora/media` depends on `@adonis-agora/media-dashboard` at build time, to copy this
15
+ * package's built SPA into its own `dist`). The specifier is therefore resolved at runtime, out of
16
+ * the consumer's own `node_modules`.
17
+ *
18
+ * For TYPES this package pins an exact PUBLISHED `@adonis-agora/media` as a devDependency — the floor
19
+ * of the peer range, resolved from the registry rather than from the workspace, so it adds no
20
+ * workspace-graph edge and no build-cycle risk. It is written as an `npm:` alias
21
+ * (`npm:@adonis-agora/media@<floor>`) because a plain version would be rewritten by changesets, on
22
+ * every release, to the version being published — which is not on the registry yet when the version
23
+ * PR runs its install. That pin is what makes this import resolve, and it
24
+ * makes it resolve deterministically: before it existed, whether this file compiled depended on
25
+ * which published version pnpm's `auto-install-peers` happened to materialise, and the build passed
26
+ * only because the lockfile pinned a version OLD enough to predate the `./dashboard_provider`
27
+ * export. Refreshing the lockfile was enough to break it.
8
28
  *
9
- * Add to `adonisrc.ts` after the media provider, and (optionally) a `config/media_dashboard.ts`:
10
29
  * ```ts
11
30
  * providers: [
12
31
  * () => import('@adonis-agora/media/media_provider'),
@@ -18,6 +37,6 @@ export default class MediaDashboardProvider {
18
37
  #private;
19
38
  protected app: ApplicationService;
20
39
  constructor(app: ApplicationService);
21
- boot(): void;
40
+ boot(): Promise<void>;
22
41
  }
23
42
  //# sourceMappingURL=media_dashboard_provider.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"media_dashboard_provider.d.ts","sourceRoot":"","sources":["../../src/provider/media_dashboard_provider.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AA8B/D;;;;;;;;;;;;;;GAcG;AACH,MAAM,CAAC,OAAO,OAAO,sBAAsB;;IAC7B,SAAS,CAAC,GAAG,EAAE,kBAAkB;gBAAvB,GAAG,EAAE,kBAAkB;IAE7C,IAAI;CAsaL"}
1
+ {"version":3,"file":"media_dashboard_provider.d.ts","sourceRoot":"","sources":["../../src/provider/media_dashboard_provider.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAE/D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,MAAM,CAAC,OAAO,OAAO,sBAAsB;;IAG7B,SAAS,CAAC,GAAG,EAAE,kBAAkB;gBAAvB,GAAG,EAAE,kBAAkB;IAgBvC,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;CAI5B"}