import { AxioDB } from "../../../Services/Indexation.operation"; import { ResponseBuilder } from "../../helper/responseBuilder.helper"; import { AxioHttpRequest, AxioHttpResponse } from "../../../Helper/http/HttpTypes"; export default class DatabaseController { private AxioDBInstance; constructor(AxioDBInstance: AxioDB); getDatabases(): Promise; createDatabase(request: AxioHttpRequest): Promise; deleteDatabase(request: AxioHttpRequest): Promise; /** * Creates a temporary tar.gz of the database directory, streams it to the client, and * deletes the temp file once the stream closes (whether it finished or errored). */ exportDatabase(request: AxioHttpRequest, reply: AxioHttpResponse): Promise; /** * Imports a database from an uploaded .tar.gz. * * Everything is staged outside the data directory and proven to be a genuine AxioDB * export before a single byte is promoted into place. That ordering is what lets a bad * upload be discarded completely: an archive that fails validation never existed as far * as the live data directory is concerned, so there is no partial database to clean up. */ importDatabase(request: AxioHttpRequest, reply: AxioHttpResponse): Promise; }