UNPKG

@adonis-agora/media

Version:

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, a

33 lines • 1.98 kB
import { type TenantScope } from './agora/tenancy.js'; import type { MediaStore } from './media_store.js'; import type { UploadSessionStore } from './resumable_upload.js'; /** What {@link tenantScopedStore} needs besides the store. */ export interface TenantScopedStoreOptions { /** The scope reads are confined to right now (`undefined`: unfiltered). Read on every call. */ scope: () => TenantScope | undefined; /** Collections every tenant may read (`access.read: 'public'`): never filtered. */ isShared?: (collection: string) => boolean; } /** * A {@link MediaStore} view confined to a tenant scope: a record outside it reads as missing * (`find` → `null`, never "forbidden"), listings and totals only see the scope. Writes go through * unchanged; the library stamps new records itself. A record of a shared (public) collection stays * readable from every scope by id (`find`) and in its owner's list (`listByOwner`), which is how an * app serves and renders it; the cross-owner management reads (`list`, totals, paged owner lists) * stay confined to the scope. */ export declare function tenantScopedStore(store: MediaStore, options: TenantScopedStoreOptions): MediaStore; /** What {@link tenantScopedSessionStore} needs besides the store. */ export interface TenantScopedSessionStoreOptions { /** The scope reads are confined to right now (`undefined`: unfiltered). */ scope: () => TenantScope | undefined; /** The tenant a new session is stamped with (`null`: none). */ stamp: () => string | null; } /** * An {@link UploadSessionStore} view confined to a tenant scope: new sessions are stamped with the * current tenant, and a session of another tenant reads as missing (its upload cannot be resumed, * completed or aborted from there). */ export declare function tenantScopedSessionStore(store: UploadSessionStore, options: TenantScopedSessionStoreOptions): UploadSessionStore; //# sourceMappingURL=tenant_scoped_store.d.ts.map