forked from greasemonkey/greasemonkey
-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add third-party webdav (perry-mitchell/webdav-client) package
- Loading branch information
1 parent
612a634
commit a571b9f
Showing
40 changed files
with
10,475 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
Extracted from distribution version 4.10.0: | ||
|
||
https://github.com/perry-mitchell/webdav-client/releases/tag/v4.10.0 | ||
|
||
Reused under the terms of the MIT license. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
import { AuthHeader } from "../types"; | ||
export declare function generateBasicAuthHeader(username: string, password: string): AuthHeader; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
import { DigestContext, Response } from "../types"; | ||
export declare function createDigestContext(username: string, password: string): DigestContext; | ||
export declare function generateDigestAuthHeader(options: any, digest: DigestContext): string; | ||
export declare function parseDigestAuth(response: Response, _digest: DigestContext): boolean; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
import { OAuthToken, WebDAVClientContext } from "../types"; | ||
export declare function setupAuth(context: WebDAVClientContext, username: string, password: string, oauthToken: OAuthToken): void; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
import { AuthHeader, OAuthToken } from "../types"; | ||
export declare function generateTokenAuthHeader(token: OAuthToken): AuthHeader; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export declare function isArrayBuffer(value: any): boolean; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export declare function isBuffer(value: any): boolean; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
import HotPatcher from "hot-patcher"; | ||
export declare function getPatcher(): HotPatcher; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
import { WebDAVClient, WebDAVClientOptions } from "./types"; | ||
export declare function createClient(remoteURL: string, options?: WebDAVClientOptions): WebDAVClient; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
export { createClient } from "./factory"; | ||
export { getPatcher } from "./compat/patcher"; | ||
export * from "./types"; | ||
export { parseStat, parseXML } from "./tools/dav"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
import { WebDAVClientContext, WebDAVMethodOptions } from "../types"; | ||
export declare function copyFile(context: WebDAVClientContext, filename: string, destination: string, options?: WebDAVMethodOptions): Promise<void>; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
import { CreateDirectoryOptions, WebDAVClientContext } from "../types"; | ||
export declare function createDirectory(context: WebDAVClientContext, dirPath: string, options?: CreateDirectoryOptions): Promise<void>; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
/// <reference types="node" /> | ||
import Stream from "stream"; | ||
import { CreateReadStreamOptions, CreateWriteStreamCallback, CreateWriteStreamOptions, WebDAVClientContext } from "../types"; | ||
export declare function createReadStream(context: WebDAVClientContext, filePath: string, options?: CreateReadStreamOptions): Stream.Readable; | ||
export declare function createWriteStream(context: WebDAVClientContext, filePath: string, options?: CreateWriteStreamOptions, callback?: CreateWriteStreamCallback): Stream.Writable; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
import { RequestOptionsCustom, Response, WebDAVClientContext } from "../types"; | ||
export declare function customRequest(context: WebDAVClientContext, remotePath: string, requestOptions: RequestOptionsCustom): Promise<Response>; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
import { WebDAVClientContext, WebDAVMethodOptions } from "../types"; | ||
export declare function deleteFile(context: WebDAVClientContext, filename: string, options?: WebDAVMethodOptions): Promise<void>; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
import { FileStat, GetDirectoryContentsOptions, ResponseDataDetailed, WebDAVClientContext } from "../types"; | ||
export declare function getDirectoryContents(context: WebDAVClientContext, remotePath: string, options?: GetDirectoryContentsOptions): Promise<Array<FileStat> | ResponseDataDetailed<Array<FileStat>>>; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
import { WebDAVClientContext, WebDAVMethodOptions } from "../types"; | ||
export declare function exists(context: WebDAVClientContext, remotePath: string, options?: WebDAVMethodOptions): Promise<boolean>; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
import { BufferLike, GetFileContentsOptions, ResponseDataDetailed, WebDAVClientContext } from "../types"; | ||
export declare function getFileContents(context: WebDAVClientContext, filePath: string, options?: GetFileContentsOptions): Promise<BufferLike | string | ResponseDataDetailed<BufferLike | string>>; | ||
export declare function getFileDownloadLink(context: WebDAVClientContext, filePath: string): string; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
import { DiskQuota, GetQuotaOptions, ResponseDataDetailed, WebDAVClientContext } from "../types"; | ||
export declare function getQuota(context: WebDAVClientContext, options?: GetQuotaOptions): Promise<DiskQuota | null | ResponseDataDetailed<DiskQuota | null>>; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
import { LockOptions, LockResponse, WebDAVClientContext, WebDAVMethodOptions } from "../types"; | ||
export declare function lock(context: WebDAVClientContext, path: string, options?: LockOptions): Promise<LockResponse>; | ||
export declare function unlock(context: WebDAVClientContext, path: string, token: string, options?: WebDAVMethodOptions): Promise<void>; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
import { WebDAVClientContext, WebDAVMethodOptions } from "../types"; | ||
export declare function moveFile(context: WebDAVClientContext, filename: string, destination: string, options?: WebDAVMethodOptions): Promise<void>; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
/// <reference types="node" /> | ||
import Stream from "stream"; | ||
import { BufferLike, PutFileContentsOptions, WebDAVClientContext } from "../types"; | ||
export declare function putFileContents(context: WebDAVClientContext, filePath: string, data: string | BufferLike | Stream.Readable, options?: PutFileContentsOptions): Promise<boolean>; | ||
export declare function getFileUploadLink(context: WebDAVClientContext, filePath: string): string; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
import { FileStat, ResponseDataDetailed, StatOptions, WebDAVClientContext } from "../types"; | ||
export declare function getStat(context: WebDAVClientContext, filename: string, options?: StatOptions): Promise<FileStat | ResponseDataDetailed<FileStat>>; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
import { RequestOptionsCustom, RequestOptionsWithState, Response, WebDAVClientContext, WebDAVMethodOptions } from "./types"; | ||
export declare function prepareRequestOptions(requestOptions: RequestOptionsCustom | RequestOptionsWithState, context: WebDAVClientContext, userOptions: WebDAVMethodOptions): RequestOptionsWithState; | ||
export declare function request(requestOptions: RequestOptionsWithState): Promise<Response>; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import { FileStat, Response, ResponseDataDetailed, WebDAVClientContext } from "./types"; | ||
export declare function createErrorFromResponse(response: Response, prefix?: string): Error; | ||
export declare function handleResponseCode(context: WebDAVClientContext, response: Response): Response; | ||
export declare function processGlobFilter(files: Array<FileStat>, glob: string): Array<FileStat>; | ||
export declare function processResponsePayload<T>(response: Response, data: T, isDetailed?: boolean): ResponseDataDetailed<T> | T; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export declare function ha1Compute(algorithm: string, user: string, realm: string, pass: string, nonce: string, cnonce: string): string; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import { DAVResult, DAVResultResponseProps, DiskQuotaAvailable, FileStat } from "../types"; | ||
export declare function parseXML(xml: string): Promise<DAVResult>; | ||
export declare function prepareFileFromProps(props: DAVResultResponseProps, rawFilename: string, isDetailed?: boolean): FileStat; | ||
export declare function parseStat(result: DAVResult, filename: string, isDetailed?: boolean): FileStat; | ||
export declare function translateDiskSpace(value: string | number): DiskQuotaAvailable; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
export declare function decodeHTMLEntities(text: string): string; | ||
export declare function fromBase64(text: string): string; | ||
export declare function toBase64(text: string): string; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
import { Headers } from "../types"; | ||
export declare function mergeHeaders(...headerPayloads: Headers[]): Headers; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
export declare function cloneShallow<T extends Object>(obj: T): T; | ||
export declare function merge(...args: Object[]): any; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
export declare function encodePath(path: any): string; | ||
export declare function getAllDirectories(path: string): Array<string>; | ||
export declare function normalisePath(pathStr: string): string; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
import { DAVResult, DiskQuota } from "../types"; | ||
export declare function parseQuota(result: DAVResult): DiskQuota | null; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
import { BufferLike } from "../types"; | ||
export declare function calculateDataLength(data: string | BufferLike): number; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
export declare function extractURLPath(fullURL: string): string; | ||
export declare function joinURL(...parts: Array<string>): string; | ||
export declare function normaliseHREF(href: string): string; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
export declare function generateLockXML(ownerHREF: string): string; | ||
export declare function parseGenericResponse(xml: string): Object; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,237 @@ | ||
/// <reference types="node" /> | ||
import Stream from "stream"; | ||
export declare type AuthHeader = string; | ||
export declare enum AuthType { | ||
Digest = "digest", | ||
None = "none", | ||
Password = "password", | ||
Token = "token" | ||
} | ||
export declare type BufferLike = Buffer | ArrayBuffer; | ||
export interface CreateDirectoryOptions extends WebDAVMethodOptions { | ||
recursive?: boolean; | ||
} | ||
export interface CreateReadStreamOptions extends WebDAVMethodOptions { | ||
callback?: (response: Response) => void; | ||
range?: { | ||
start: number; | ||
end?: number; | ||
}; | ||
} | ||
export declare type CreateWriteStreamCallback = (response: Response) => void; | ||
export interface CreateWriteStreamOptions extends WebDAVMethodOptions { | ||
overwrite?: boolean; | ||
} | ||
export interface DAVResultResponse { | ||
href: string; | ||
propstat: { | ||
prop: DAVResultResponseProps; | ||
status: string; | ||
}; | ||
} | ||
export interface DAVResultResponseProps { | ||
displayname: string; | ||
resourcetype: { | ||
collection?: boolean; | ||
}; | ||
getlastmodified?: string; | ||
getetag?: string; | ||
getcontentlength?: string; | ||
getcontenttype?: string; | ||
"quota-available-bytes"?: any; | ||
"quota-used-bytes"?: string; | ||
} | ||
export interface DAVResult { | ||
multistatus: { | ||
response: Array<DAVResultResponse>; | ||
}; | ||
} | ||
export interface DAVResultRawMultistatus { | ||
response: DAVResultResponse | [DAVResultResponse]; | ||
} | ||
export interface DAVResultRaw { | ||
multistatus: "" | DAVResultRawMultistatus | [DAVResultRawMultistatus]; | ||
} | ||
export interface DigestContext { | ||
username: string; | ||
password: string; | ||
nc: number; | ||
algorithm: string; | ||
hasDigestAuth: boolean; | ||
cnonce?: string; | ||
nonce?: string; | ||
realm?: string; | ||
qop?: string; | ||
opaque?: string; | ||
} | ||
export interface DiskQuota { | ||
used: number; | ||
available: DiskQuotaAvailable; | ||
} | ||
export declare type DiskQuotaAvailable = "unknown" | "unlimited" | number; | ||
export declare enum ErrorCode { | ||
DataTypeNoLength = "data-type-no-length", | ||
InvalidAuthType = "invalid-auth-type", | ||
InvalidOutputFormat = "invalid-output-format", | ||
LinkUnsupportedAuthType = "link-unsupported-auth" | ||
} | ||
export interface FileStat { | ||
filename: string; | ||
basename: string; | ||
lastmod: string; | ||
size: number; | ||
type: "file" | "directory"; | ||
etag: string | null; | ||
mime?: string; | ||
props?: DAVResultResponseProps; | ||
} | ||
export interface GetDirectoryContentsOptions extends WebDAVMethodOptions { | ||
deep?: boolean; | ||
details?: boolean; | ||
glob?: string; | ||
} | ||
export interface GetFileContentsOptions extends WebDAVMethodOptions { | ||
details?: boolean; | ||
format?: "binary" | "text"; | ||
onDownloadProgress?: ProgressEventCallback; | ||
} | ||
export interface GetQuotaOptions extends WebDAVMethodOptions { | ||
details?: boolean; | ||
path?: string; | ||
} | ||
export interface Headers { | ||
[key: string]: string; | ||
} | ||
export interface LockOptions extends WebDAVMethodOptions { | ||
refreshToken?: string; | ||
timeout?: string; | ||
} | ||
export interface LockResponse { | ||
serverTimeout: string; | ||
token: string; | ||
} | ||
export interface OAuthToken { | ||
access_token: string; | ||
token_type: string; | ||
refresh_token?: string; | ||
} | ||
export interface ProgressEvent { | ||
loaded: number; | ||
total: number; | ||
} | ||
export declare type ProgressEventCallback = (e: ProgressEvent) => void; | ||
export interface PutFileContentsOptions extends WebDAVMethodOptions { | ||
contentLength?: boolean | number; | ||
overwrite?: boolean; | ||
onUploadProgress?: UploadProgressCallback; | ||
} | ||
export declare type RequestDataPayload = string | Buffer | ArrayBuffer | { | ||
[key: string]: any; | ||
}; | ||
interface RequestOptionsBase { | ||
data?: RequestDataPayload; | ||
headers?: Headers; | ||
httpAgent?: any; | ||
httpsAgent?: any; | ||
maxBodyLength?: number; | ||
maxContentLength?: number; | ||
maxRedirects?: number; | ||
method: string; | ||
onDownloadProgress?: ProgressEventCallback; | ||
onUploadProgress?: ProgressEventCallback; | ||
responseType?: string; | ||
transformResponse?: Array<(value: any) => any>; | ||
url?: string; | ||
validateStatus?: (status: number) => boolean; | ||
withCredentials?: boolean; | ||
signal?: AbortSignal; | ||
} | ||
export interface RequestOptionsCustom extends RequestOptionsBase { | ||
} | ||
export interface RequestOptions extends RequestOptionsBase { | ||
url: string; | ||
} | ||
export interface RequestOptionsWithState extends RequestOptions { | ||
_digest?: DigestContext; | ||
} | ||
export interface Response { | ||
data: ResponseData; | ||
status: number; | ||
headers: Headers; | ||
statusText: string; | ||
} | ||
export declare type ResponseData = string | Buffer | ArrayBuffer | Object | Array<any>; | ||
export interface ResponseDataDetailed<T> { | ||
data: T; | ||
headers: Headers; | ||
status: number; | ||
statusText: string; | ||
} | ||
export interface ResponseStatusValidator { | ||
(status: number): boolean; | ||
} | ||
export interface StatOptions extends WebDAVMethodOptions { | ||
details?: boolean; | ||
} | ||
export declare type UploadProgress = ProgressEvent; | ||
export declare type UploadProgressCallback = ProgressEventCallback; | ||
export interface WebDAVClient { | ||
copyFile: (filename: string, destination: string) => Promise<void>; | ||
createDirectory: (path: string, options?: CreateDirectoryOptions) => Promise<void>; | ||
createReadStream: (filename: string, options?: CreateReadStreamOptions) => Stream.Readable; | ||
createWriteStream: (filename: string, options?: CreateWriteStreamOptions, callback?: CreateWriteStreamCallback) => Stream.Writable; | ||
customRequest: (path: string, requestOptions: RequestOptionsCustom) => Promise<Response>; | ||
deleteFile: (filename: string) => Promise<void>; | ||
exists: (path: string) => Promise<boolean>; | ||
getDirectoryContents: (path: string, options?: GetDirectoryContentsOptions) => Promise<Array<FileStat> | ResponseDataDetailed<Array<FileStat>>>; | ||
getFileContents: (filename: string, options?: GetFileContentsOptions) => Promise<BufferLike | string | ResponseDataDetailed<BufferLike | string>>; | ||
getFileDownloadLink: (filename: string) => string; | ||
getFileUploadLink: (filename: string) => string; | ||
getHeaders: () => Headers; | ||
getQuota: (options?: GetQuotaOptions) => Promise<DiskQuota | null | ResponseDataDetailed<DiskQuota | null>>; | ||
lock: (path: string, options?: LockOptions) => Promise<LockResponse>; | ||
moveFile: (filename: string, destinationFilename: string) => Promise<void>; | ||
putFileContents: (filename: string, data: string | BufferLike | Stream.Readable, options?: PutFileContentsOptions) => Promise<boolean>; | ||
setHeaders: (headers: Headers) => void; | ||
stat: (path: string, options?: StatOptions) => Promise<FileStat | ResponseDataDetailed<FileStat>>; | ||
unlock: (path: string, token: string, options?: WebDAVMethodOptions) => Promise<void>; | ||
} | ||
export interface WebDAVClientContext { | ||
authType: AuthType; | ||
contactHref: string; | ||
digest?: DigestContext; | ||
headers: Headers; | ||
httpAgent?: any; | ||
httpsAgent?: any; | ||
maxBodyLength?: number; | ||
maxContentLength?: number; | ||
password?: string; | ||
remotePath: string; | ||
remoteURL: string; | ||
token?: OAuthToken; | ||
username?: string; | ||
withCredentials?: boolean; | ||
} | ||
export interface WebDAVClientError extends Error { | ||
status?: number; | ||
response?: Response; | ||
} | ||
export interface WebDAVClientOptions { | ||
authType?: AuthType; | ||
contactHref?: string; | ||
headers?: Headers; | ||
httpAgent?: any; | ||
httpsAgent?: any; | ||
maxBodyLength?: number; | ||
maxContentLength?: number; | ||
password?: string; | ||
token?: OAuthToken; | ||
username?: string; | ||
withCredentials?: boolean; | ||
} | ||
export interface WebDAVMethodOptions { | ||
data?: RequestDataPayload; | ||
headers?: Headers; | ||
signal?: AbortSignal; | ||
} | ||
export {}; |
Oops, something went wrong.