///
import { RequestInit, Response } from "node-fetch";
import NCError from "./ncError";
import NCFile from "./ncFile";
import NCFolder from "./ncFolder";
import { IProxy, IRequestContext } from "./ncHttpClient";
import NCTag from "./ncTag";
import RequestResponseLogEntry from "./requestResponseLogEntry";
export { NCClient, NCError, NCFolder, NCFile, NCTag, };
export interface IBasicAuth {
"username": string;
"password": string;
}
export declare class FakeServer {
fakeResponses: RequestResponseLogEntry[];
constructor(fakeResponses: RequestResponseLogEntry[]);
getFakeHttpResponse(url: string, requestInit: RequestInit, expectedHttpStatusCode: number[], context: IRequestContext): Promise;
}
export declare class NextcloudServer {
url: string;
basicAuth: IBasicAuth;
proxy?: IProxy;
logRequestResponse: boolean;
constructor(url: string, basicAuth: IBasicAuth, proxy?: IProxy, logRequestResponse?: boolean);
}
export default class NCClient {
static webDavUrlPath: string;
/**
* returns the nextcloud credentials that is defined in the
* "user-provided" service section of the VCAP_SERVICES environment
* @param instanceName the name of the nextcloud user provided service instance
* @returns credentials from the VCAP_SERVICES environment (user provided service)
*/
static getCredentialsFromEnv(): NextcloudServer;
/**
* returns the nextcloud credentials that is defined in the
* "user-provided" service section of the VCAP_SERVICES environment
* @param instanceName the name of the nextcloud user provided service instance
* @returns credentials from the VCAP_SERVICES environment (user provided service)
*/
static getCredentialsFromVcapServicesEnv(instanceName: string): NextcloudServer;
private nextcloudOrigin;
private nextcloudAuthHeader;
private nextcloudRequestToken;
private webDAVUrl;
private proxy?;
private fakeServer?;
private logRequestResponse;
private httpClient?;
constructor(server: NextcloudServer | FakeServer);
/**
* returns the used and free quota of the nextcloud account
*/
getQuota(): Promise<{
used: number;
available: string | number;
}>;
/**
* creates a new tag, if not already existing
* this function will fail with http 403 if the user does not have admin privileges
* @param tagName the name of the tag
* @returns tagId
*/
createTag(tagName: string): Promise;
/**
* returns a tag identified by the name or null if not found
* @param tagName the name of the tag
* @returns tag or null
*/
getTagByName(tagName: string): Promise;
/**
* returns a tag identified by the id or null if not found
* @param tagId the id of the tag
* @returns tag or null
*/
getTagById(tagId: number): Promise;
/**
* deletes the tag by id
* this function will fail with http 403 if the user does not have admin privileges
* @param tagId the id of the tag like "/remote.php/dav/systemtags/234"
*/
deleteTag(tagId: number): Promise;
/**
* deletes all visible assignable tags
* @throws Error
*/
deleteAllTags(): Promise;
/**
* returns a list of tags
* @returns array of tags
*/
getTags(): Promise;
/**
* returns the list of tag names and the tag ids
* @param fileId the id of the file
*/
getTagsOfFile(fileId: number): Promise