New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

webdav

Package Overview
Dependencies
Maintainers
1
Versions
101
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

webdav - npm Package Compare versions

Comparing version 2.7.0 to 2.8.0

dist/interface/directoryExists.js

5

CHANGELOG.md
# WebDAV-Client changelog
## v2.8.0
_2018-05-26_
* Remove `path` dependency
## v2.7.0

@@ -4,0 +9,0 @@ _2019-05-23_

46

dist/factory.js

@@ -86,3 +86,3 @@ "use strict";

* @param {String} remoteURL The remote address of the webdav server
* @param {CreateClientOptions=} options Client options
* @param {CreateClientOptions=} opts Client options
* @returns {ClientInterface} A new client interface instance

@@ -109,4 +109,14 @@ * @memberof module:WebDAV

*/
function createClient(remoteURL, { username, password, httpAgent, httpsAgent, token = null } = {}) {
const baseOptions = {
function createClient(remoteURL, opts = {}) {
if (!opts || typeof opts !== "object") {
throw new Error("Options must be an object, if specified");
}
const username = opts.username,
password = opts.password,
httpAgent = opts.httpAgent,
httpsAgent = opts.httpsAgent;
var _opts$token = opts.token;
const token = _opts$token === undefined ? null : _opts$token;
const runtimeOptions = {
headers: {},

@@ -120,5 +130,5 @@ remotePath: urlTools.extractURLPath(remoteURL),

if (username) {
baseOptions.headers.Authorization = authTools.generateBasicAuthHeader(username, password);
runtimeOptions.headers.Authorization = authTools.generateBasicAuthHeader(username, password);
} else if (token && typeof token === "object") {
baseOptions.headers.Authorization = authTools.generateTokenAuthHeader(token);
runtimeOptions.headers.Authorization = authTools.generateTokenAuthHeader(token);
}

@@ -137,3 +147,3 @@ return {

copyFile: function copyFile(remotePath, targetRemotePath, options) {
const copyOptions = merge(baseOptions, options || {});
const copyOptions = merge(runtimeOptions, options || {});
return copy.copyFile(remotePath, targetRemotePath, copyOptions);

@@ -152,3 +162,3 @@ },

createDirectory: function createDirectory(dirPath, options) {
const createOptions = merge(baseOptions, options || {});
const createOptions = merge(runtimeOptions, options || {});
return createDir.createDirectory(dirPath, createOptions);

@@ -168,3 +178,3 @@ },

createReadStream: function createReadStream(remoteFilename, options) {
const createOptions = merge(baseOptions, options || {});
const createOptions = merge(runtimeOptions, options || {});
return createStream.createReadStream(remoteFilename, createOptions);

@@ -184,3 +194,3 @@ },

createWriteStream: function createWriteStream(remoteFilename, options) {
const createOptions = merge(baseOptions, options || {});
const createOptions = merge(runtimeOptions, options || {});
return createStream.createWriteStream(remoteFilename, createOptions);

@@ -199,3 +209,3 @@ },

deleteFile: function deleteFile(remotePath, options) {
const deleteOptions = merge(baseOptions, options || {});
const deleteOptions = merge(runtimeOptions, options || {});
return deletion.deleteFile(remotePath, deleteOptions);

@@ -214,3 +224,3 @@ },

getDirectoryContents: function getDirectoryContents(remotePath, options) {
const getOptions = merge(baseOptions, options || {});
const getOptions = merge(runtimeOptions, options || {});
return directoryContents.getDirectoryContents(remotePath, getOptions);

@@ -232,3 +242,3 @@ },

getFileContents: function getFileContents(remoteFilename, options) {
const getOptions = merge(baseOptions, options || {});
const getOptions = merge(runtimeOptions, options || {});
getOptions.format = getOptions.format || "binary";

@@ -250,3 +260,3 @@ if (["binary", "text"].indexOf(getOptions.format) < 0) {

getFileDownloadLink: function getFileDownloadLink(remoteFilename, options) {
const getOptions = merge(baseOptions, options || {});
const getOptions = merge(runtimeOptions, options || {});
return getFile.getFileLink(remoteFilename, getOptions);

@@ -264,3 +274,3 @@ },

getFileUploadLink: function getFileUploadLink(remoteFilename, options) {
var putOptions = merge(baseOptions, options || {});
var putOptions = merge(runtimeOptions, options || {});
return putFile.getFileUploadLink(remoteFilename, putOptions);

@@ -276,3 +286,3 @@ },

getQuota: function getQuota(options) {
const getOptions = merge(baseOptions, options || {});
const getOptions = merge(runtimeOptions, options || {});
return quota.getQuota(getOptions);

@@ -292,3 +302,3 @@ },

moveFile: function moveFile(remotePath, targetRemotePath, options) {
const moveOptions = merge(baseOptions, options || {});
const moveOptions = merge(runtimeOptions, options || {});
return move.moveFile(remotePath, targetRemotePath, moveOptions);

@@ -310,3 +320,3 @@ },

putFileContents: function putFileContents(remoteFilename, data, options) {
const putOptions = merge(baseOptions, options || {});
const putOptions = merge(runtimeOptions, options || {});
return putFile.putFileContents(remoteFilename, data, putOptions);

@@ -323,3 +333,3 @@ },

stat: function stat(remotePath, options) {
const getOptions = merge(baseOptions, options || {});
const getOptions = merge(runtimeOptions, options || {});
return stats.getStat(remotePath, getOptions);

@@ -326,0 +336,0 @@ }

@@ -48,3 +48,3 @@ "use strict";

function propsToStat(props, filename, isDetailed = false) {
const path = require("path");
const path = require("path-posix");
// Last modified time, raw size, item type and mime

@@ -51,0 +51,0 @@ const lastMod = getSingleValue(getValueForKey("getlastmodified", props));

{
"name": "webdav",
"version": "2.7.0",
"version": "2.8.0",
"description": "WebDAV client for NodeJS",

@@ -5,0 +5,0 @@ "main": "dist/index.js",

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc