///
import { Id, MetadataResponse } from "./base";
import { D2ApiResponse, ErrorReport } from "./common";
import { D2ApiGeneric } from "./d2Api";
interface FileHttpResponse {
httpStatus: "OK" | "Conflict" | "Not Found";
httpStatusCode: number;
status: "OK" | "ERROR";
message?: string;
response?: Response;
}
export interface FileUploadParameters {
id?: Id;
name: string;
data: Blob | Buffer;
ignoreDocument?: boolean;
domain?: Domain;
}
declare type Domain = "DATA_VALUE" | "PUSH_ANALYSIS" | "DOCUMENT" | "MESSAGE_ATTACHMENT" | "USER_AVATAR" | "ORG_UNIT";
export interface FileUploadResult {
id: string;
fileResourceId: string;
response: MetadataResponse;
}
declare type FileDeleteResponse = FileHttpResponse<{
responseType: "ObjectReport";
uid: string;
klass: string;
errorReports?: ErrorReport[];
}>;
export declare class Files {
d2Api: D2ApiGeneric;
constructor(d2Api: D2ApiGeneric);
get(id: string): D2ApiResponse;
saveFileResource(params: Omit): D2ApiResponse;
upload(params: FileUploadParameters): D2ApiResponse;
delete(id: string): D2ApiResponse;
}
export {};