///
import ClientError from "./error";
import FakeServer from "./fakeServer";
import File from "./file";
import FileSystemElement from "./fileSystemElement";
import Folder from "./folder";
import RequestResponseLogEntry from "./requestResponseLogEntry";
import Server from "./server";
import Share, { ICreateShare, SharePermission } from "./share";
import Tag from "./tag";
export { Client, ClientError, Folder, File, FileSystemElement, ICreateShare, Tag, FakeServer, Server, SharePermission, RequestResponseLogEntry, };
export interface ISysInfoNextcloudSystem {
"version": string;
}
export interface ISysInfoNextcloudClient {
"version": string;
}
export interface ISysInfoNextcloud {
"system": ISysInfoNextcloudSystem;
}
export interface ISystemInfo {
"nextcloud": ISysInfoNextcloud;
"nextcloudClient": ISysInfoNextcloudClient;
}
export interface IQuota {
used: number;
available: number | string;
}
/**
* The nextcloud client is the root object to access the remote api of the nextcloud server.
*/
export default class Client {
static webDavUrlPath: string;
private nextcloudOrigin;
private nextcloudAuthHeader;
private nextcloudRequestToken;
private webDAVUrl;
private proxy?;
private fakeServer?;
private logRequestResponse;
private httpClient?;
/**
* Creates a new instance of a nextcloud client.
* Use the server to provide server connectivity information to the client.
* (The FakeServer is only used for testing and code coverage)
* If the server is not provided the client tries to find the connectivity information
* in the environment.
* If a VCAP_SERVICES environment variable is available, the client tries to find
* a service with the name "nextcloud" in the user-provides-services section.
* If no VCAP_SERVICES are available, the client uses the following variables
* from the envirnonment for the connectivity:
*
* - NEXTCLOUD_URL - the WebDAV url of the nextcloud server
* - NEXTCLOUD_USERNAME - the user name
* - NEXTCLOUD_PASSWORD - the application password
*
* @param server optional server information to connection to a nextcloud server
* @constructor
*/
constructor(server?: Server | FakeServer);
/**
* returns the used and free quota of the nextcloud account
*/
getQuota(): Promise;
/**
* 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