@adonis-agora/media-dashboard 6.0.0 → 7.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.
@@ -4,9 +4,15 @@
4
4
  <meta charset="UTF-8" />
5
5
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
6
6
  <meta name="robots" content="noindex" />
7
+ <link rel="preconnect" href="https://fonts.googleapis.com" />
8
+ <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
9
+ <link
10
+ href="https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500;700&family=Space+Grotesk:wght@400;500;600;700&display=swap"
11
+ rel="stylesheet"
12
+ />
7
13
  <title>Media · Agora</title>
8
- <script type="module" crossorigin src="/__MEDIA_DASHBOARD__/assets/index-Dhth080j.js"></script>
9
- <link rel="stylesheet" crossorigin href="/__MEDIA_DASHBOARD__/assets/index-BaYNF8Yc.css">
14
+ <script type="module" crossorigin src="/__MEDIA_DASHBOARD__/assets/index-Dvw2uJpF.js"></script>
15
+ <link rel="stylesheet" crossorigin href="/__MEDIA_DASHBOARD__/assets/index--0MZJr6W.css">
10
16
  </head>
11
17
  <body>
12
18
  <div id="root"></div>
package/dist/types.d.ts CHANGED
@@ -123,4 +123,79 @@ export interface FolderBody {
123
123
  disk: string;
124
124
  prefix: string;
125
125
  }
126
+ /** One resumable part recorded for an in-progress upload session. */
127
+ export interface UploadPart {
128
+ partNumber: number;
129
+ etag: string;
130
+ }
131
+ /** Full detail of one resumable upload session, plus its recorded parts. */
132
+ export interface UploadDetailResponse {
133
+ upload: UploadInfo;
134
+ parts: UploadPart[];
135
+ }
136
+ /** One generated conversion/variant of a stored `MediaRecord`, with a short-lived signed URL. */
137
+ export interface MediaVariant {
138
+ name: string;
139
+ url: string;
140
+ }
141
+ /** Full detail of one stored `MediaRecord`, plus its generated conversions. */
142
+ export interface MediaDetailResponse {
143
+ record: MediaEntry;
144
+ variants: MediaVariant[];
145
+ }
146
+ /** Per-collection rollup (count + total bytes), for the console's collection chips. */
147
+ export interface CollectionSummary {
148
+ key: string;
149
+ count: number;
150
+ sumSize: number;
151
+ }
152
+ export interface CollectionsSummaryResponse {
153
+ collections: CollectionSummary[];
154
+ }
155
+ /** One label/value row of an {@link ObjectInsight}. Rendered verbatim as text — no markup. */
156
+ export interface ObjectInsightFact {
157
+ label: string;
158
+ value: string;
159
+ }
160
+ /** A link out to the host's own screens, rendered as an anchor. */
161
+ export interface ObjectInsightLink {
162
+ label: string;
163
+ href: string;
164
+ }
165
+ /**
166
+ * Host-supplied context about one disk object, rendered in the console preview.
167
+ *
168
+ * The console can describe a file only as storage sees it (key, size, type). This is what the HOST
169
+ * knows about it — which knowledge base indexed it, which work order it belongs to — handed over as
170
+ * data, because the console ships as a prebuilt bundle a host cannot inject components into.
171
+ */
172
+ export interface ObjectInsight {
173
+ /** Section heading, e.g. `Knowledge base`. */
174
+ title: string;
175
+ facts?: ObjectInsightFact[];
176
+ links?: ObjectInsightLink[];
177
+ /** One line of prose under the facts — a caveat, a status explanation. */
178
+ note?: string;
179
+ }
180
+ /** What `GET /object/insights` returns. Empty when the host registered no providers. */
181
+ export interface ObjectInsightsResponse {
182
+ insights: ObjectInsight[];
183
+ }
184
+ /** A signed-in console user, carried by the session cookie and returned by `/me`. */
185
+ export interface ConsoleSessionUserInfo {
186
+ id: string;
187
+ name?: string;
188
+ roles: string[];
189
+ }
190
+ /** Response of `GET /me`: the console SPA renders the login screen or the console from this. */
191
+ export type MeResponse = {
192
+ authRequired: false;
193
+ } | {
194
+ user: ConsoleSessionUserInfo;
195
+ };
196
+ /** Body for `POST /login`. */
197
+ export interface LoginBody {
198
+ username: string;
199
+ password: string;
200
+ }
126
201
  //# sourceMappingURL=types.d.ts.map
@@ -1 +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,OA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F,MAAM,WAAW,iBAAiB;IAChC,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,0BAA0B;IACzC,WAAW,EAAE,iBAAiB,EAAE,CAAC;CAClC;AAED,8FAA8F;AAC9F,MAAM,WAAW,iBAAiB;IAChC,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;CACf;AAED,mEAAmE;AACnE,MAAM,WAAW,iBAAiB;IAChC,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;CACd;AAED;;;;;;GAMG;AACH,MAAM,WAAW,aAAa;IAC5B,8CAA8C;IAC9C,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,iBAAiB,EAAE,CAAC;IAC5B,KAAK,CAAC,EAAE,iBAAiB,EAAE,CAAC;IAC5B,0EAA0E;IAC1E,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,wFAAwF;AACxF,MAAM,WAAW,sBAAsB;IACrC,QAAQ,EAAE,aAAa,EAAE,CAAC;CAC3B;AAED,qFAAqF;AACrF,MAAM,WAAW,sBAAsB;IACrC,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,EAAE,CAAC;CACjB;AAED,gGAAgG;AAChG,MAAM,MAAM,UAAU,GAAG;IAAE,YAAY,EAAE,KAAK,CAAA;CAAE,GAAG;IAAE,IAAI,EAAE,sBAAsB,CAAA;CAAE,CAAC;AAEpF,8BAA8B;AAC9B,MAAM,WAAW,SAAS;IACxB,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;CAClB"}
package/package.json CHANGED
@@ -1,11 +1,11 @@
1
1
  {
2
2
  "name": "@adonis-agora/media-dashboard",
3
- "version": "6.0.0",
3
+ "version": "7.0.0",
4
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
5
  "license": "MIT",
6
6
  "repository": {
7
7
  "type": "git",
8
- "url": "git+https://github.com/DavideCarvalho/adonis-media.git",
8
+ "url": "git+https://github.com/DavideCarvalho/adonis-agora-media.git",
9
9
  "directory": "packages/dashboard"
10
10
  },
11
11
  "author": "Davi Carvalho <davi@goflip.ai>",
@@ -36,25 +36,31 @@
36
36
  ],
37
37
  "sideEffects": false,
38
38
  "peerDependencies": {
39
- "@adonis-agora/media": "^0.10.0",
39
+ "@adonis-agora/media": "^0.10.0 || ^0.11.0",
40
40
  "@adonisjs/core": "^7.3.0"
41
41
  },
42
42
  "devDependencies": {
43
- "@adonisjs/core": "^7.3.0",
44
- "@tanstack/react-query": "^5.62.0",
43
+ "@adonisjs/core": "7.4.0",
44
+ "@base-ui/react": "1.0.0",
45
+ "@tanstack/react-query": "5.101.4",
45
46
  "@testing-library/react": "^16.1.0",
46
47
  "@types/node": "^20.0.0",
47
- "@types/react": "^19.0.0",
48
- "@types/react-dom": "^19.0.0",
48
+ "@types/react": "19.2.18",
49
+ "@types/react-dom": "19.2.4",
49
50
  "@vitejs/plugin-react": "^4.3.4",
51
+ "autoprefixer": "10.5.4",
52
+ "class-variance-authority": "0.7.1",
53
+ "clsx": "2.1.1",
50
54
  "jsdom": "^25.0.1",
51
- "react": "^19.0.0",
52
- "react-dom": "^19.0.0",
55
+ "postcss": "8.5.26",
56
+ "react": "19.2.8",
57
+ "react-dom": "19.2.8",
58
+ "tailwind-merge": "3.6.0",
59
+ "tailwindcss": "3.4.19",
53
60
  "typescript": "^5.4.0",
54
61
  "vite": "^6.0.0",
55
- "vitest": "^3.0.0",
56
- "@adonis-agora/media-react": "0.2.0",
57
- "@adonis-agora/media": "0.10.0"
62
+ "vitest": "3.2.7",
63
+ "@adonis-agora/media-react": "0.3.0"
58
64
  },
59
65
  "engines": {
60
66
  "node": ">=20.6.0"
@@ -1,33 +0,0 @@
1
- import type { HttpContext } from '@adonisjs/core/http';
2
- /** A minimal middleware handler shape (host auth guard) applied to the console routes. */
3
- export type DashboardMiddleware = (ctx: HttpContext, next: () => Promise<void>) => unknown;
4
- /**
5
- * Configuration for `@adonis-agora/media-dashboard`, read by the provider from `config/media_dashboard.ts`.
6
- *
7
- * The console is a read-only browser by default (`actions: false`); flip `actions` on — and gate the
8
- * routes with your own `middleware` (an auth guard) — to enable copy/move/delete. Storage, uploads and
9
- * everything else come from the already-configured `@adonis-agora/media` manager; this config only
10
- * places the SPA + JSON API and picks which disks are browsable.
11
- */
12
- export interface MediaDashboardConfig {
13
- /** Where the SPA is mounted. Default `/media/dashboard`. */
14
- basePath?: string;
15
- /** Where the JSON API is mounted. Default `<basePath>/api`. */
16
- apiBasePath?: string;
17
- /** Enable mutating actions (copy/move/delete). Default `false`. */
18
- actions?: boolean;
19
- /**
20
- * Disk names the console may browse/act on. When omitted, the provider derives them from the media
21
- * config (`disks` keys plus the default disk).
22
- */
23
- disks?: string[];
24
- /** Prefix of the core direct-S3 upload routes, matched to `media.uploads.routes.prefix`. Default `/media/uploads`. */
25
- uploadsPrefix?: string;
26
- /** Prefix of the core TUS routes, matched to `media.uploads.resumable.routes.prefix`. Default `/media/uploads/tus`. */
27
- tusPrefix?: string;
28
- /** Host middleware (auth) applied to the whole console — SPA and API. */
29
- middleware?: DashboardMiddleware | DashboardMiddleware[];
30
- }
31
- /** Identity helper for authoring a typed `config/media_dashboard.ts`. */
32
- export declare function defineConfig(config?: MediaDashboardConfig): MediaDashboardConfig;
33
- //# sourceMappingURL=define_config.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"define_config.d.ts","sourceRoot":"","sources":["../src/define_config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAEvD,0FAA0F;AAC1F,MAAM,MAAM,mBAAmB,GAAG,CAAC,GAAG,EAAE,WAAW,EAAE,IAAI,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,KAAK,OAAO,CAAC;AAE3F;;;;;;;GAOG;AACH,MAAM,WAAW,oBAAoB;IACnC,4DAA4D;IAC5D,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,+DAA+D;IAC/D,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,mEAAmE;IACnE,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;IACjB,sHAAsH;IACtH,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,uHAAuH;IACvH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,yEAAyE;IACzE,UAAU,CAAC,EAAE,mBAAmB,GAAG,mBAAmB,EAAE,CAAC;CAC1D;AAED,yEAAyE;AACzE,wBAAgB,YAAY,CAAC,MAAM,GAAE,oBAAyB,GAAG,oBAAoB,CAEpF"}
@@ -1,5 +0,0 @@
1
- /** Identity helper for authoring a typed `config/media_dashboard.ts`. */
2
- export function defineConfig(config = {}) {
3
- return config;
4
- }
5
- //# sourceMappingURL=define_config.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"define_config.js","sourceRoot":"","sources":["../src/define_config.ts"],"names":[],"mappings":"AAiCA,yEAAyE;AACzE,MAAM,UAAU,YAAY,CAAC,SAA+B,EAAE;IAC5D,OAAO,MAAM,CAAC;AAChB,CAAC"}
@@ -1,23 +0,0 @@
1
- /**
2
- * Pure helpers for mounting/serving the SPA — split out so they're unit-testable without booting
3
- * AdonisJS. The provider is a thin HTTP shell around these.
4
- */
5
- /** Placeholder base Vite bakes into asset URLs; rewritten to the configured `basePath` at serve time. */
6
- export declare const BASE_PLACEHOLDER = "/__MEDIA_DASHBOARD__/";
7
- export declare const CONTENT_TYPES: Record<string, string>;
8
- export interface DashboardBootstrap {
9
- apiBase: string;
10
- uploadsBase: string;
11
- tusBase: string;
12
- actions: boolean;
13
- }
14
- /** Normalise a mount path: leading slash, collapsed slashes, no trailing slash (root stays `/`). */
15
- export declare function normalizePath(path: string): string;
16
- /** Content type for a served asset filename, defaulting to octet-stream. */
17
- export declare function contentTypeFor(file: string): string;
18
- /**
19
- * Rewrite the built `index.html` for serving: point Vite's placeholder base at `basePath` and inject
20
- * the runtime bootstrap the SPA reads from `window.__MEDIA_DASHBOARD__`.
21
- */
22
- export declare function renderIndexHtml(html: string, basePath: string, bootstrap: DashboardBootstrap): string;
23
- //# sourceMappingURL=serve.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"serve.d.ts","sourceRoot":"","sources":["../../src/provider/serve.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,yGAAyG;AACzG,eAAO,MAAM,gBAAgB,0BAA0B,CAAC;AAExD,eAAO,MAAM,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAchD,CAAC;AAEF,MAAM,WAAW,kBAAkB;IACjC,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,OAAO,CAAC;CAClB;AAED,oGAAoG;AACpG,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAGlD;AAED,4EAA4E;AAC5E,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAGnD;AAED;;;GAGG;AACH,wBAAgB,eAAe,CAC7B,IAAI,EAAE,MAAM,EACZ,QAAQ,EAAE,MAAM,EAChB,SAAS,EAAE,kBAAkB,GAC5B,MAAM,CAIR"}
@@ -1,41 +0,0 @@
1
- /**
2
- * Pure helpers for mounting/serving the SPA — split out so they're unit-testable without booting
3
- * AdonisJS. The provider is a thin HTTP shell around these.
4
- */
5
- /** Placeholder base Vite bakes into asset URLs; rewritten to the configured `basePath` at serve time. */
6
- export const BASE_PLACEHOLDER = '/__MEDIA_DASHBOARD__/';
7
- export const CONTENT_TYPES = {
8
- '.js': 'text/javascript; charset=utf-8',
9
- '.mjs': 'text/javascript; charset=utf-8',
10
- '.css': 'text/css; charset=utf-8',
11
- '.map': 'application/json; charset=utf-8',
12
- '.json': 'application/json; charset=utf-8',
13
- '.svg': 'image/svg+xml',
14
- '.png': 'image/png',
15
- '.jpg': 'image/jpeg',
16
- '.jpeg': 'image/jpeg',
17
- '.gif': 'image/gif',
18
- '.ico': 'image/x-icon',
19
- '.woff2': 'font/woff2',
20
- '.woff': 'font/woff',
21
- };
22
- /** Normalise a mount path: leading slash, collapsed slashes, no trailing slash (root stays `/`). */
23
- export function normalizePath(path) {
24
- const trimmed = `/${path}`.replace(/\/+/g, '/').replace(/\/+$/, '');
25
- return trimmed === '' ? '/' : trimmed;
26
- }
27
- /** Content type for a served asset filename, defaulting to octet-stream. */
28
- export function contentTypeFor(file) {
29
- const ext = file.slice(file.lastIndexOf('.'));
30
- return CONTENT_TYPES[ext] ?? 'application/octet-stream';
31
- }
32
- /**
33
- * Rewrite the built `index.html` for serving: point Vite's placeholder base at `basePath` and inject
34
- * the runtime bootstrap the SPA reads from `window.__MEDIA_DASHBOARD__`.
35
- */
36
- export function renderIndexHtml(html, basePath, bootstrap) {
37
- const based = html.split(BASE_PLACEHOLDER).join(`${basePath === '/' ? '' : basePath}/`);
38
- const inject = `<script>window.__MEDIA_DASHBOARD__=${JSON.stringify(bootstrap)}</script>`;
39
- return based.replace('</head>', `${inject}</head>`);
40
- }
41
- //# sourceMappingURL=serve.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"serve.js","sourceRoot":"","sources":["../../src/provider/serve.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,yGAAyG;AACzG,MAAM,CAAC,MAAM,gBAAgB,GAAG,uBAAuB,CAAC;AAExD,MAAM,CAAC,MAAM,aAAa,GAA2B;IACnD,KAAK,EAAE,gCAAgC;IACvC,MAAM,EAAE,gCAAgC;IACxC,MAAM,EAAE,yBAAyB;IACjC,MAAM,EAAE,iCAAiC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type { CollectionFilter, CollectionListResponse, DiskListResponse, ObjectDetailResponse, ObjectListResponse, Topology, UploadListResponse } from '../types.js';
3
- /** TTL of the signed URLs handed to the browser for object preview/download. */
4
- export declare const URL_TTL_SECONDS = 300;
5
- /** Cap on the get→put streaming path used for cross-disk copy/move (drivers can't copy across disks). */
6
- export declare const MAX_TRANSFER_BYTES: number;
7
- /** Page size for the flat sweep that recursive folder delete/copy/move paginates over. */
8
- export declare const FOLDER_SWEEP_LIMIT = 1000;
9
- /** The slice of `MediaManager` the dashboard depends on — kept structural so it's trivial to fake in tests. */
10
- export interface MediaManagerLike {
11
- readonly storage: {
12
- readonly defaultDisk: string;
13
- disk(name?: string): Disk;
14
- };
15
- readonly hasResumable: boolean;
16
- readonly resumable: {
17
- list(filter?: {
18
- disk?: string;
19
- keyPrefix?: string;
20
- }): Promise<UploadSession[]>;
21
- };
22
- /** The persistence SPI — the console reads stored records via the cross-owner `list`. */
23
- readonly store: {
24
- list(options?: MediaListOptions): Promise<MediaListPage>;
25
- };
26
- }
27
- export interface DashboardServiceOptions {
28
- /** Disk names the console may browse/act on. The first entry (or the manager default) is the default. */
29
- diskNames: string[];
30
- /** Whether mutating actions (copy/move/delete) are permitted. */
31
- actions: boolean;
32
- }
33
- /** An error carrying an HTTP status for the provider to surface verbatim. */
34
- export declare class DashboardError extends Error {
35
- readonly status: number;
36
- constructor(message: string, status: number);
37
- }
38
- /**
39
- * All dashboard read/action logic, expressed over a structural {@link MediaManagerLike}. It reads the
40
- * *real* `@adonis-agora/media` surface — disk `list`/`stat`/`getSignedUrl`/`copy`/`move`/`deleteMany`
41
- * and the resumable `UploadSessionStore.list()` — and never invents its own persistence. The provider
42
- * is a thin HTTP shell around this; the logic is pure and unit-tested without booting AdonisJS.
43
- */
44
- export declare class DashboardService {
45
- private readonly manager;
46
- private readonly options;
47
- constructor(manager: MediaManagerLike, options: DashboardServiceOptions);
48
- /** Coarse capability topology for the SPA to enable/disable affordances. */
49
- topology(): Topology;
50
- /** Enumerate the exposed disks with their capabilities (non-extended disks report `list:false`). */
51
- disks(): DiskListResponse;
52
- /** List one page of a bucket under `prefix` (cursor-based, folders rolled up on the `/` delimiter). */
53
- objects(diskName: string, params?: {
54
- prefix?: string;
55
- cursor?: string;
56
- limit?: number;
57
- }): Promise<ObjectListResponse>;
58
- /** Object metadata + a short-lived signed URL for preview/download. */
59
- object(diskName: string, key: string): Promise<ObjectDetailResponse>;
60
- /** In-progress resumable uploads, projected from the session store (empty when unconfigured). */
61
- uploads(filter?: {
62
- disk?: string;
63
- prefix?: string;
64
- }): Promise<UploadListResponse>;
65
- /**
66
- * One cursor-paginated page of stored media-library records across owners/collections, projected to
67
- * the SPA's {@link MediaEntry}. Delegates to the real {@link MediaStore.list} — no bespoke query.
68
- */
69
- collections(params?: CollectionFilter & {
70
- cursor?: string;
71
- limit?: number;
72
- }): Promise<CollectionListResponse>;
73
- /** Server-side copy (same disk) or streamed cross-disk copy. Original is kept. */
74
- copy(body: {
75
- disk: string;
76
- from: string;
77
- to: string;
78
- toDisk?: string;
79
- }): Promise<void>;
80
- /** Server-side move (same disk) or streamed cross-disk move. Source is deleted after transfer. */
81
- move(body: {
82
- disk: string;
83
- from: string;
84
- to: string;
85
- toDisk?: string;
86
- }): Promise<void>;
87
- /** Batched delete of many keys on one disk. */
88
- remove(body: {
89
- disk: string;
90
- keys: string[];
91
- }): Promise<void>;
92
- /**
93
- * Create a "folder" — a zero-byte marker object at `<prefix>/`, which S3-style delimiter listing
94
- * surfaces as a navigable folder. Normalizes to exactly one trailing slash (so the key never
95
- * double-slashes); rejects an empty prefix. Actions-gated.
96
- */
97
- createFolder(body: {
98
- disk: string;
99
- prefix: string;
100
- }): Promise<void>;
101
- /**
102
- * Recursively delete a "folder": every object under `<prefix>/` (nested included) plus the
103
- * zero-byte marker itself. Sweeps with an EMPTY delimiter so the driver lists keys FLAT — the
104
- * default `/` delimiter would roll nested keys up into folder prefixes and the sweep would miss
105
- * them, deleting only direct children. Paginates until the disk reports no more, then deletes the
106
- * marker explicitly (its key equals the sweep prefix, which `list` filters out). Actions-gated.
107
- */
108
- deleteFolder(body: {
109
- disk: string;
110
- prefix: string;
111
- }): Promise<void>;
112
- /** Copy a whole "folder" (every object under `<from>/`, nested included) to `<to>/`, same or cross disk. */
113
- copyFolder(body: {
114
- disk: string;
115
- from: string;
116
- to: string;
117
- toDisk?: string;
118
- }): Promise<void>;
119
- /** Move a whole "folder" (every object under `<from>/`, nested included) to `<to>/`, same or cross disk. */
120
- moveFolder(body: {
121
- disk: string;
122
- from: string;
123
- to: string;
124
- toDisk?: string;
125
- }): Promise<void>;
126
- private transfer;
127
- /**
128
- * Relocate a single object, same disk or across disks. Same-disk uses the driver's native
129
- * `copy`/`move` (server-side, no bytes through the app). Cross-disk has no driver primitive, so the
130
- * object is streamed through the app (get→put, capped at {@link MAX_TRANSFER_BYTES}); a `move` then
131
- * deletes the source. Callers gate actions.
132
- */
133
- private transferKey;
134
- /**
135
- * Shared engine for {@link copyFolder}/{@link moveFolder}. Same flat-listing sweep as
136
- * {@link deleteFolder}; each key is relocated via {@link transferKey} (so cross-disk works
137
- * transparently), preserving its path relative to the source. On the SAME disk, rejects a
138
- * destination inside the source (which would recurse forever); across disks that can't happen. The
139
- * destination folder marker is written, and for a move the source marker removed, so both listings
140
- * stay consistent. Actions-gated.
141
- */
142
- private transferFolder;
143
- private extended;
144
- private assertActions;
145
- }
146
- //# sourceMappingURL=service.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"service.d.ts","sourceRoot":"","sources":["../../src/server/service.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,IAAI,EAEJ,gBAAgB,EAChB,aAAa,EAEb,aAAa,EACd,MAAM,qBAAqB,CAAC;AAC7B,OAAO,KAAK,EACV,gBAAgB,EAChB,sBAAsB,EAEtB,gBAAgB,EAEhB,oBAAoB,EAGpB,kBAAkB,EAClB,QAAQ,EAER,kBAAkB,EACnB,MAAM,aAAa,CAAC;AAErB,gFAAgF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