UNPKG

@directus/api

Version:

Directus is a real-time API and App dashboard for managing SQL database content

35 lines (34 loc) 1.2 kB
import type { AbstractServiceOptions, Accountability, Range, SchemaOverview, Stat, TransformationSet } from '@directus/types'; import archiver from 'archiver'; import type { Knex } from 'knex'; import type { Readable } from 'node:stream'; import { FilesService } from './files.js'; export declare class AssetsService { knex: Knex; accountability: Accountability | null; schema: SchemaOverview; sudoFilesService: FilesService; constructor(options: AbstractServiceOptions); private zip; zipFiles(files: string[]): Promise<{ archive: archiver.Archiver; complete: () => Promise<void>; }>; zipFolder(root: string): Promise<{ archive: archiver.Archiver; complete: () => Promise<void>; metadata: { name: string | undefined; }; }>; getAsset(id: string, transformation?: TransformationSet, range?: Range, deferStream?: false): Promise<{ stream: Readable; file: any; stat: Stat; }>; getAsset(id: string, transformation?: TransformationSet, range?: Range, deferStream?: true): Promise<{ stream: () => Promise<Readable>; file: any; stat: Stat; }>; }