Skip to content

Latest commit

 

History

History
188 lines (135 loc) · 7.72 KB

API.md

File metadata and controls

188 lines (135 loc) · 7.72 KB

Functions

createWebDAVClient(remoteURL)Object

Create a webdav client interface

Typedefs

ClientInterface : Object
OptionsWithHeaders : Object
OptionsHeadersAndFormat : OptionsWithHeaders

createWebDAVClient(remoteURL) ⇒ Object

Create a webdav client interface

Kind: global function
Returns: Object - The client interface
Access: public
See: createClient

Param Type Description
remoteURL String The target URL

ClientInterface : Object

Kind: global typedef

ClientInterface.createDirectory(dirPath, [options]) ⇒ Promise

Create a directory

Kind: static method of ClientInterface
Returns: Promise - A promise that resolves when the remote path has been created

Param Type Description
dirPath String The path to create
[options] OptionsWithHeaders Options for the request

ClientInterface.createReadStream(remoteFilename, [options]) ⇒ Readable

Create a readable stream of a remote file

Kind: static method of ClientInterface
Returns: Readable - A readable stream

Param Type Description
remoteFilename String The file to stream
[options] OptionsHeadersAndFormat Options for the request

ClientInterface.deleteFile(remotePath, [options]) ⇒ Promise

Delete a remote file

Kind: static method of ClientInterface
Returns: Promise - A promise that resolves when the remote file as been deleted

Param Type Description
remotePath String The remote path to delete
[options] OptionsWithHeaders The options for the request

ClientInterface.getDirectoryContents(remotePath, [options]) ⇒ Promise.<Array>

Get the contents of a remote directory

Kind: static method of ClientInterface
Returns: Promise.<Array> - A promise that resolves with an array of remote item stats

Param Type Description
remotePath String The path to fetch the contents of
[options] OptionsWithHeaders Options for the remote the request

ClientInterface.getFileContents(remoteFilename, [options]) ⇒ Promise.<(Buffer|String)>

Get the contents of a remote file

Kind: static method of ClientInterface
Returns: Promise.<(Buffer|String)> - A promise that resolves with the contents of the remote file

Param Type Description
remoteFilename String The file to fetch
[options] OptionsHeadersAndFormat Options for the request

ClientInterface.getFileStream(remoteFilename, [options]) ⇒ Promise.<Readable>

Get a readable stream of a remote file

Kind: static method of ClientInterface
Returns: Promise.<Readable> - A promise that resolves with a readable stream

Param Type Description
remoteFilename String The file to stream
[options] OptionsHeadersAndFormat Options for the request

ClientInterface.moveFile(remotePath, targetRemotePath, [options]) ⇒ Promise

Move a remote item to another path

Kind: static method of ClientInterface
Returns: Promise - A promise that resolves once the request has completed

Param Type Description
remotePath String The remote item path
targetRemotePath String The new path after moving
[options] OptionsWithHeaders Options for the request

ClientInterface.putFileContents(remoteFilename, data, [options]) ⇒ Promise

Write contents to a remote file path

Kind: static method of ClientInterface
Returns: Promise - A promise that resolves once the contents have been written

Param Type Description
remoteFilename String The path of the remote file
data String | Buffer The data to write
[options] OptionsHeadersAndFormat The options for the request

ClientInterface.stat(remotePath, [options]) ⇒ Promise.<Object>

Stat a remote object

Kind: static method of ClientInterface
Returns: Promise.<Object> - A promise that resolves with the stat data

Param Type Description
remotePath String The path of the item
[options] OptionsWithHeaders Options for the request

OptionsWithHeaders : Object

Kind: global typedef
Properties

Name Type Description
headers Object Optional headers to send with the request

OptionsHeadersAndFormat : OptionsWithHeaders

Kind: global typedef
Properties

Name Type Description
format String Format of request/response payload (binary/text)