import { AxiosResponse } from 'axios'; import Archivable, { ArchivedUpdatedEvent } from './shared/archivable'; import Entity from './shared/entity'; import { Event } from './shared/eventstore-client/EventstoreClient'; import { ServiceClientWithEventstore } from './shared/service-client/ServiceClientWithEventstore'; export interface FileInfo extends Entity, Archivable { uri: string; checksum: string; contentType: string; title?: string; altText?: string; folder?: string | Folder; tags?: string[]; } export declare enum Folder { OWNERSHIP_REQUESTS = "OWNERSHIP_REQUESTS" } export declare type UploadFileRequest = Pick & { file: any; folder?: Folder; }; export declare type UpdateFileRequest = Pick; export interface GetAllFilesRequest { continuationToken?: string; limit?: number; allowArchived?: boolean; excludeFolders?: string[]; } export interface GetAllFilesResponse { files: FileInfo[]; continuationToken?: string; } export declare type PERMISSIONS = typeof CREATE | typeof UPDATE | typeof GET_ALL | typeof SET_ARCHIVED | typeof GET_EVENTS_ANY | typeof GET_EVENTS_CREATED | typeof GET_EVENTS_UPDATED; export declare const CREATE = "FILE:CREATE"; export declare const UPDATE = "FILE:UPDATE"; export declare const GET_ALL = "FILE:GET_ALL"; export declare const SET_ARCHIVED = "FILE:SET_ARCHIVED"; export declare const GET_EVENTS_ANY = "FILE:GET_EVENTS:ANY"; export declare const GET_EVENTS_CREATED = "FILE:GET_EVENTS:CREATED"; export declare const GET_EVENTS_UPDATED = "FILE:GET_EVENTS:UPDATED"; export declare const GET_EVENTS_ARCHIVED_UPDATED = "FILE:GET_EVENTS:ARCHIVED_UPDATED"; export declare const PERMISSION_NAMES: { CREATE: string; UPDATE: string; GET_ALL: string; SET_ARCHIVED: string; GET_EVENTS_ANY: string; GET_EVENTS_CREATED: string; GET_EVENTS_UPDATED: string; GET_EVENTS_ARCHIVED_UPDATED: string; }; export interface CreatedEvent extends Event { type: 'CREATED'; data: FileInfo; } export interface UpdatedEvent extends Event { type: 'CREATED'; data: FileInfo; } export declare type FileEvents = CreatedEvent | ArchivedUpdatedEvent | UpdatedEvent; export declare class FileClient extends ServiceClientWithEventstore { upload({ file, title, altText, folder }: UploadFileRequest): Promise>; update(id: string, fileUpdates: UpdateFileRequest): Promise>; getAll(input?: GetAllFilesRequest): Promise>; setArchived(id: string, archived: boolean): Promise>; }