{"_id":"@asun01/webdav","_rev":"3-60219759e62499414e918e282d12656f","name":"@asun01/webdav","dist-tags":{"latest":"5.5.3"},"versions":{"5.5.0":{"name":"@asun01/webdav","version":"5.5.0","description":"WebDAV client for NodeJS","exports":{".":{"browser":"./dist/web/index.js","react-native":"./dist/react-native/index.js","default":"./dist/node/index.js"},"./react-native":"./dist/react-native/index.js","./web":"./dist/web/index.js","./dist/*":"./dist/*"},"react-native":"./dist/react-native/index.js","type":"module","types":"./dist/node/index.d.ts","scripts":{"build":"npm run clean && run-p build:node build:web","build:node":"tsc","build:web":"webpack --mode production --config webpack.config.cjs","clean":"rimraf dist web","dev":"nodemon -e ts,js --exec 'npm run build' --ignore 'dist/' --ignore 'web/'","format":"prettier --write '{source,test}/**/*.{js,ts}'","prepublishOnly":"npm run build","test":"run-s test:node test:web test:format","test:format":"prettier-check '{source,test}/**/*.{js,ts}'","test:node":"c8 --check-coverage --lines 89 --functions 91 --branches 77 --statements 89 mocha --config .mocharc.json","test:node:watch":"nodemon --exec 'npm run test:node' --ignore 'dist/'","test:web":"concurrently --success 'first' --kill-others 'npm run test:web:karma' 'npm run test:web:server'","test:web:karma":"karma start test/karma.conf.cjs","test:web:server":"node --loader ts-node/esm ./test/server.web.ts"},"repository":{"type":"git","url":"git+https://github.com/ASunYC/webdav-client.git"},"publishConfig":{"access":"public"},"keywords":["webdav","client","remote","sync"],"engines":{"node":">=14"},"lint-staged":{"{source,test}/**/*.{js,ts}":["prettier --write"]},"husky":{"hooks":{"pre-commit":"lint-staged"}},"author":{"name":"Perry Mitchell","email":"https://home.freeman.fit"},"license":"MIT","bugs":{"url":"https://github.com/ASunYC/webdav-client/issues"},"homepage":"https://github.com/ASunYC/webdav-client#readme","dependencies":{"base-64":"^1.0.0","byte-length":"^1.0.2","fast-xml-parser":"^4.2.4","he":"^1.2.0","layerr":"^2.0.1","md5":"^2.3.0","minimatch":"^7.4.6","nested-property":"^4.0.0","path-posix":"^1.0.0","url-join":"^5.0.0","url-parse":"^1.5.10"},"devDependencies":{"@babel/core":"^7.24.0","@babel/preset-env":"^7.24.0","@babel/preset-typescript":"^7.23.3","@types/chai":"^4.3.12","@types/he":"^1.2.3","@types/mocha":"^10.0.6","@types/node":"^20.11.28","@types/sinon":"^17.0.3","@types/url-parse":"^1.4.11","babel-loader":"^9.1.3","babel-plugin-transform-async-to-promises":"^0.8.18","buffer-equals":"^2.0.0","c8":"^9.1.0","chai":"^4.4.1","concurrently":"^8.2.2","copy-dir":"^1.3.0","directory-exists":"^2.0.1","exists-file":"^3.0.2","husky":"^4.3.8","karma":"^6.4.3","karma-chai":"^0.1.0","karma-chrome-launcher":"^3.2.0","karma-firefox-launcher":"^2.1.3","karma-mocha":"^2.0.1","karma-sinon":"^1.0.5","karma-spec-reporter":"^0.0.36","karma-webpack":"^5.0.1","lint-staged":"^15.2.2","mkdirp":"^1.0.4","mocha":"^10.3.0","nock":"^13.5.4","node-fetch":"^3.3.0","nodemon":"^3.1.0","npm-run-all":"^4.1.5","prettier":"^3.2.5","prettier-check":"^2.0.0","resolve-typescript-plugin":"^2.0.1","rimraf":"^5.0.5","sinon":"^17.0.1","ts-node":"^10.9.2","typescript":"^5.4.2","wait-on":"^6.0.1","webdav-server":"^2.6.2","webpack":"^5.90.3","webpack-cli":"^5.1.4","webpack-merge":"^5.10.0"},"gitHead":"771d357b47cacd621e56cf00569812d9a7e323bc","_id":"@asun01/webdav@5.5.0","_nodeVersion":"16.16.0","_npmVersion":"8.11.0","dist":{"integrity":"sha512-YMURwidDoWsBqby8PGUfyeOGbvSQEVhIpMlmuYLpJjrzQC+dtySQ721MT7KMVyHQ69vSPzBT3Z8EGZOYPCN+Jg==","shasum":"170a52a7a8aec88f7b3630c9f5b93189b8ae5f3c","tarball":"https://registry.npmjs.org/@asun01/webdav/-/webdav-5.5.0.tgz","fileCount":99,"unpackedSize":420954,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDIPgwUXyO/QXPY7MFyTL2uDXWzUrC4UgpFKVjxQDjLogIgCwZiUxbRE3wAab/TVg3bsXIhcqfAsAXlFfcKNVjR6k8="}]},"_npmUser":{"name":"asun01","email":"452212601@qq.com"},"directories":{},"maintainers":[{"name":"asun01","email":"452212601@qq.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/webdav_5.5.0_1713156317152_0.5032019786072899"},"_hasShrinkwrap":false},"5.5.1":{"name":"@asun01/webdav","version":"5.5.1","description":"WebDAV client for NodeJS","exports":{".":{"browser":"./dist/web/index.js","react-native":"./dist/react-native/index.js","default":"./dist/node/index.js"},"./react-native":"./dist/react-native/index.js","./web":"./dist/web/index.js","./dist/*":"./dist/*"},"react-native":"./dist/react-native/index.js","type":"module","types":"./dist/node/index.d.ts","scripts":{"build":"npm run clean && run-p build:node build:web","build:node":"tsc","build:web":"webpack --mode production --config webpack.config.cjs","clean":"rimraf dist web","dev":"nodemon -e ts,js --exec 'npm run build' --ignore 'dist/' --ignore 'web/'","format":"prettier --write '{source,test}/**/*.{js,ts}'","prepublishOnly":"npm run build","test":"run-s test:node test:web test:format","test:format":"prettier-check '{source,test}/**/*.{js,ts}'","test:node":"c8 --check-coverage --lines 89 --functions 91 --branches 77 --statements 89 mocha --config .mocharc.json","test:node:watch":"nodemon --exec 'npm run test:node' --ignore 'dist/'","test:web":"concurrently --success 'first' --kill-others 'npm run test:web:karma' 'npm run test:web:server'","test:web:karma":"karma start test/karma.conf.cjs","test:web:server":"node --loader ts-node/esm ./test/server.web.ts"},"repository":{"type":"git","url":"git+https://github.com/ASunYC/webdav-client.git"},"publishConfig":{"access":"public"},"keywords":["webdav","client","remote","sync"],"engines":{"node":">=14"},"lint-staged":{"{source,test}/**/*.{js,ts}":["prettier --write"]},"husky":{"hooks":{"pre-commit":"lint-staged"}},"author":{"name":"Perry Mitchell","email":"https://home.freeman.fit"},"license":"MIT","bugs":{"url":"https://github.com/ASunYC/webdav-client/issues"},"homepage":"https://github.com/ASunYC/webdav-client#readme","dependencies":{"base-64":"^1.0.0","byte-length":"^1.0.2","fast-xml-parser":"^4.2.4","he":"^1.2.0","layerr":"^2.0.1","md5":"^2.3.0","minimatch":"^7.4.6","nested-property":"^4.0.0","path-posix":"^1.0.0","url-join":"^5.0.0","url-parse":"^1.5.10"},"devDependencies":{"@babel/core":"^7.24.0","@babel/preset-env":"^7.24.0","@babel/preset-typescript":"^7.23.3","@types/chai":"^4.3.12","@types/he":"^1.2.3","@types/mocha":"^10.0.6","@types/node":"^20.11.28","@types/sinon":"^17.0.3","@types/url-parse":"^1.4.11","babel-loader":"^9.1.3","babel-plugin-transform-async-to-promises":"^0.8.18","buffer-equals":"^2.0.0","c8":"^9.1.0","chai":"^4.4.1","concurrently":"^8.2.2","copy-dir":"^1.3.0","directory-exists":"^2.0.1","exists-file":"^3.0.2","husky":"^4.3.8","karma":"^6.4.3","karma-chai":"^0.1.0","karma-chrome-launcher":"^3.2.0","karma-firefox-launcher":"^2.1.3","karma-mocha":"^2.0.1","karma-sinon":"^1.0.5","karma-spec-reporter":"^0.0.36","karma-webpack":"^5.0.1","lint-staged":"^15.2.2","mkdirp":"^1.0.4","mocha":"^10.3.0","nock":"^13.5.4","node-fetch":"^3.3.0","nodemon":"^3.1.0","npm-run-all":"^4.1.5","prettier":"^3.2.5","prettier-check":"^2.0.0","resolve-typescript-plugin":"^2.0.1","rimraf":"^5.0.5","sinon":"^17.0.1","ts-node":"^10.9.2","typescript":"^5.4.2","wait-on":"^6.0.1","webdav-server":"^2.6.2","webpack":"^5.90.3","webpack-cli":"^5.1.4","webpack-merge":"^5.10.0"},"gitHead":"af1cc4005fd8aa4a75f08c93d2b7a2839093db61","_id":"@asun01/webdav@5.5.1","_nodeVersion":"16.16.0","_npmVersion":"8.11.0","dist":{"integrity":"sha512-+AfPkD5wlPf/5q0uyx6/SkGdeN84GXSGRqqOISwXmBjSLQkoEiXIc/oUaM6LkDcJCWVG/5H06d5aTlzLgTyh8g==","shasum":"d78d2f5155cfbd4c600dc6d373bd9dfe93992eb7","tarball":"https://registry.npmjs.org/@asun01/webdav/-/webdav-5.5.1.tgz","fileCount":99,"unpackedSize":420980,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCLrkjzrTURih2yyEI7IDEDkAAzP/kXJ4/WhlMbZk3T3gIgT2ifTXZ7MoV4/9yWD/3zjnI9RRp6zaCQrU2y4wdAMRU="}]},"_npmUser":{"name":"asun01","email":"452212601@qq.com"},"directories":{},"maintainers":[{"name":"asun01","email":"452212601@qq.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/webdav_5.5.1_1713160328226_0.05083992194146436"},"_hasShrinkwrap":false},"5.5.2":{"name":"@asun01/webdav","version":"5.5.2","description":"WebDAV client for NodeJS","exports":{".":{"browser":"./dist/web/index.js","react-native":"./dist/react-native/index.js","default":"./dist/node/index.js"},"./react-native":"./dist/react-native/index.js","./web":"./dist/web/index.js","./dist/*":"./dist/*"},"react-native":"./dist/react-native/index.js","types":"./dist/node/index.d.ts","scripts":{"build":"npm run clean && run-p build:node build:web","build:node":"tsc","build:web":"webpack --mode production --config webpack.config.cjs","clean":"rimraf dist web","dev":"nodemon -e ts,js --exec 'npm run build' --ignore 'dist/' --ignore 'web/'","format":"prettier --write '{source,test}/**/*.{js,ts}'","prepublishOnly":"npm run build","test":"run-s test:node test:web test:format","test:format":"prettier-check '{source,test}/**/*.{js,ts}'","test:node":"c8 --check-coverage --lines 89 --functions 91 --branches 77 --statements 89 mocha --config .mocharc.json","test:node:watch":"nodemon --exec 'npm run test:node' --ignore 'dist/'","test:web":"concurrently --success 'first' --kill-others 'npm run test:web:karma' 'npm run test:web:server'","test:web:karma":"karma start test/karma.conf.cjs","test:web:server":"node --loader ts-node/esm ./test/server.web.ts"},"repository":{"type":"git","url":"git+https://github.com/ASunYC/webdav-client.git"},"publishConfig":{"access":"public"},"keywords":["webdav","client","remote","sync"],"engines":{"node":">=14"},"lint-staged":{"{source,test}/**/*.{js,ts}":["prettier --write"]},"husky":{"hooks":{"pre-commit":"lint-staged"}},"author":{"name":"Perry Mitchell","email":"https://home.freeman.fit"},"license":"MIT","bugs":{"url":"https://github.com/ASunYC/webdav-client/issues"},"homepage":"https://github.com/ASunYC/webdav-client#readme","dependencies":{"base-64":"^1.0.0","byte-length":"^1.0.2","fast-xml-parser":"^4.2.4","he":"^1.2.0","layerr":"^2.0.1","md5":"^2.3.0","minimatch":"^7.4.6","nested-property":"^4.0.0","node-fetch":"^2.7.0","path-posix":"^1.0.0","url-join":"^5.0.0","url-parse":"^1.5.10"},"devDependencies":{"@babel/core":"^7.24.0","@babel/preset-env":"^7.24.0","@babel/preset-typescript":"^7.23.3","@types/chai":"^4.3.12","@types/he":"^1.2.3","@types/mocha":"^10.0.6","@types/node":"^20.11.28","@types/sinon":"^17.0.3","@types/url-parse":"^1.4.11","babel-loader":"^9.1.3","babel-plugin-transform-async-to-promises":"^0.8.18","buffer-equals":"^2.0.0","c8":"^9.1.0","chai":"^4.4.1","concurrently":"^8.2.2","copy-dir":"^1.3.0","directory-exists":"^2.0.1","exists-file":"^3.0.2","husky":"^4.3.8","karma":"^6.4.3","karma-chai":"^0.1.0","karma-chrome-launcher":"^3.2.0","karma-firefox-launcher":"^2.1.3","karma-mocha":"^2.0.1","karma-sinon":"^1.0.5","karma-spec-reporter":"^0.0.36","karma-webpack":"^5.0.1","lint-staged":"^15.2.2","mkdirp":"^1.0.4","mocha":"^10.3.0","nock":"^13.5.4","nodemon":"^3.1.0","npm-run-all":"^4.1.5","prettier":"^3.2.5","prettier-check":"^2.0.0","resolve-typescript-plugin":"^2.0.1","rimraf":"^5.0.5","sinon":"^17.0.1","ts-node":"^10.9.2","typescript":"^5.4.2","wait-on":"^7.2.0","webdav-server":"^2.6.2","webpack":"^5.90.3","webpack-cli":"^5.1.4","webpack-merge":"^5.10.0"},"gitHead":"ddcda328a3f60aaa241ff1a08538f8a2660757ce","_id":"@asun01/webdav@5.5.2","_nodeVersion":"16.16.0","_npmVersion":"8.11.0","dist":{"integrity":"sha512-7Jbs4lg1VqRHQ1hSkADMdi2svxs7ySlc8Pctv4bLBiGykKlPUnBuFZmNHQMddF+fnUOpaiTmjH7hs+B2gUj5Cg==","shasum":"b6977f7bac8d5517be9395fecbb9f6b5ca9861ad","tarball":"https://registry.npmjs.org/@asun01/webdav/-/webdav-5.5.2.tgz","fileCount":99,"unpackedSize":424122,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHefqJAuqfk/HQLvSmIH7WP02Co8u9Bxg8ljW6+20CBrAiEA8Zhv4UQm/m/FfSdUDDWAMdaYawWbV90btp4u20Dng8s="}]},"_npmUser":{"name":"asun01","email":"452212601@qq.com"},"directories":{},"maintainers":[{"name":"asun01","email":"452212601@qq.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/webdav_5.5.2_1713171898833_0.9628932680928461"},"_hasShrinkwrap":false},"5.5.3":{"name":"@asun01/webdav","version":"5.5.3","description":"WebDAV client for NodeJS","exports":{".":{"browser":"./dist/web/index.js","react-native":"./dist/react-native/index.js","default":"./dist/node/index.js"},"./react-native":"./dist/react-native/index.js","./web":"./dist/web/index.js","./dist/*":"./dist/*"},"react-native":"./dist/react-native/index.js","types":"./dist/node/index.d.ts","scripts":{"build":"npm run clean && run-p build:node build:web","build:node":"tsc","build:web":"webpack --mode production --config webpack.config.cjs","clean":"rimraf dist web","dev":"nodemon -e ts,js --exec 'npm run build' --ignore 'dist/' --ignore 'web/'","format":"prettier --write '{source,test}/**/*.{js,ts}'","prepublishOnly":"npm run build","test":"run-s test:node test:web test:format","test:format":"prettier-check '{source,test}/**/*.{js,ts}'","test:node":"c8 --check-coverage --lines 89 --functions 91 --branches 77 --statements 89 mocha --config .mocharc.json","test:node:watch":"nodemon --exec 'npm run test:node' --ignore 'dist/'","test:web":"concurrently --success 'first' --kill-others 'npm run test:web:karma' 'npm run test:web:server'","test:web:karma":"karma start test/karma.conf.cjs","test:web:server":"node --loader ts-node/esm ./test/server.web.ts"},"repository":{"type":"git","url":"git+https://github.com/ASunYC/webdav-client.git"},"publishConfig":{"access":"public"},"keywords":["webdav","client","remote","sync"],"engines":{"node":">=14"},"lint-staged":{"{source,test}/**/*.{js,ts}":["prettier --write"]},"husky":{"hooks":{"pre-commit":"lint-staged"}},"author":{"name":"Perry Mitchell","email":"https://home.freeman.fit"},"license":"MIT","bugs":{"url":"https://github.com/ASunYC/webdav-client/issues"},"homepage":"https://github.com/ASunYC/webdav-client#readme","dependencies":{"base-64":"^1.0.0","byte-length":"^1.0.2","fast-xml-parser":"^4.2.4","he":"^1.2.0","layerr":"^0.1.2","md5":"^2.3.0","minimatch":"^7.4.6","nested-property":"^4.0.0","node-fetch":"^2.7.0","path-posix":"^1.0.0","url-join":"^4.0.1","url-parse":"^1.5.3"},"devDependencies":{"@babel/core":"^7.24.0","@babel/preset-env":"^7.24.0","@babel/preset-typescript":"^7.23.3","@types/chai":"^4.3.12","@types/he":"^1.2.3","@types/mocha":"^10.0.6","@types/node":"^20.11.28","@types/sinon":"^17.0.3","@types/url-parse":"^1.4.11","babel-loader":"^9.1.3","babel-plugin-transform-async-to-promises":"^0.8.18","buffer-equals":"^2.0.0","c8":"^9.1.0","chai":"^4.4.1","concurrently":"^8.2.2","copy-dir":"^1.3.0","directory-exists":"^2.0.1","exists-file":"^3.0.2","husky":"^4.3.8","karma":"^6.4.3","karma-chai":"^0.1.0","karma-chrome-launcher":"^3.2.0","karma-firefox-launcher":"^2.1.3","karma-mocha":"^2.0.1","karma-sinon":"^1.0.5","karma-spec-reporter":"^0.0.36","karma-webpack":"^5.0.1","lint-staged":"^15.2.2","mkdirp":"^1.0.4","mocha":"^10.3.0","nock":"^13.5.4","nodemon":"^3.1.0","npm-run-all":"^4.1.5","prettier":"^3.2.5","prettier-check":"^2.0.0","resolve-typescript-plugin":"^2.0.1","rimraf":"^5.0.5","sinon":"^17.0.1","ts-node":"^10.9.2","typescript":"^5.4.2","wait-on":"^7.2.0","webdav-server":"^2.6.2","webpack":"^5.90.3","webpack-cli":"^5.1.4","webpack-merge":"^5.10.0"},"gitHead":"ddcda328a3f60aaa241ff1a08538f8a2660757ce","_id":"@asun01/webdav@5.5.3","_nodeVersion":"16.16.0","_npmVersion":"8.11.0","dist":{"integrity":"sha512-BK8py+75l+X8NOqHpuh+GKGBBJJYyNIrPMxuZYeSM3qel3+4fCFpzZse2/jOwQAsVXgDpYzQU7Tcq2kepZucIA==","shasum":"27453f45c41351ce02fd809f117877014381f943","tarball":"https://registry.npmjs.org/@asun01/webdav/-/webdav-5.5.3.tgz","fileCount":99,"unpackedSize":424121,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIF+2s6anoRUk7kX5R2IBvmDmZ3pT2WaLAQ8cLDrH1WViAiEArmLuPvATWWvDHF/mTykLXwSBi89jAI14vnakSmRlQq0="}]},"_npmUser":{"name":"asun01","email":"452212601@qq.com"},"directories":{},"maintainers":[{"name":"asun01","email":"452212601@qq.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/webdav_5.5.3_1713172938156_0.7127425806903271"},"_hasShrinkwrap":false}},"time":{"created":"2024-04-15T04:45:17.076Z","5.5.0":"2024-04-15T04:45:17.318Z","modified":"2024-04-15T09:22:18.554Z","5.5.1":"2024-04-15T05:52:08.396Z","5.5.2":"2024-04-15T09:04:58.986Z","5.5.3":"2024-04-15T09:22:18.398Z"},"maintainers":[{"name":"asun01","email":"452212601@qq.com"}],"description":"WebDAV client for NodeJS","homepage":"https://github.com/ASunYC/webdav-client#readme","keywords":["webdav","client","remote","sync"],"repository":{"type":"git","url":"git+https://github.com/ASunYC/webdav-client.git"},"author":{"name":"Perry Mitchell","email":"https://home.freeman.fit"},"bugs":{"url":"https://github.com/ASunYC/webdav-client/issues"},"license":"MIT","readme":"![WebDAV](https://raw.githubusercontent.com/ASunYC/webdav-client/main/webdav.jpg)\n\n> A WebDAV client, written in Typescript, for NodeJS and the browser\n\n[![npm version](https://badge.fury.io/js/webdav.svg)](https://www.npmjs.com/package/webdav) [![monthly downloads](https://img.shields.io/npm/dm/webdav.svg)](https://www.npmjs.com/package/webdav) [![total downloads](https://img.shields.io/npm/dt/webdav.svg?label=total%20downloads)](https://www.npmjs.com/package/webdav) ![Dependents (via libraries.io)](https://img.shields.io/librariesio/dependents/npm/webdav)\n\n## About\n\nThis library comes from the [webdav-client](https://github.com/perry-mitchell/webdav-client) created by the industry heavyweight, **Perry Mitchell**. I have made some modifications to it to ensure its compatibility with **CommonJS**.\n\n**Version 5.5.x** corresponds to the original author's Version 5.5.0.\n\n**The original WebDAV** is a well-known, stable and highly flexible protocol for interacting with remote filesystems via an API. Being that it is so widespread, many file hosting services such as **Nextcloud**/**ownCloud**, **Box** and **Yandex** use it as a fallback to their primary interfaces.\n\nThis library provides a **WebDAV client** interface that makes interacting with WebDAV enabled services easy. The API returns promises and resolve with the results. It parses and prepares directory-contents requests for easy consumption, as well as providing methods for fetching things like file stats and quotas.\n\nThis library's motivation is **not** to follow an RFC or to strictly adhere to standard WebDAV interfaces, but to provide an easy-to-consume client API for working with most WebDAV services from Node or the browser.\n\n#### Node support\n\nSupport table:\n\n| Library Major Version | Node JS Range     |\n|-----------------------|-------------------|\n| v5                    | 14+               |\n\nOnly v5 is supported. Anoter version you can  obtained from the original author's repository ：[webdav-client](https://github.com/perry-mitchell/webdav-client)\n\n## Quick Start\n\n### Installation\n\nSimple install as a dependency using npm:\n\n```\nnpm install @asun01/webdav --save\n```\n\n### To use\nIn this version you need to:\n\n```typescript\nconst { createClient } = require(\"@asun01/webdav\");\n\n// both work fine in supported bundlers\n```\n\n## Some Usage\n\nUsage entails creating a client adapter instance by calling the factory function `createClient`:\n\n```typescript\nconst { createClient } = require(\"@asun01/webdav\");\n\nconst client = createClient(\n    \"https://webdav.example.com/test123\",\n    {\n        username: \"test\",\n        password: \"mytestssPa$$w0rd\"\n    }\n);\n\n// Get directory contents\nconst directoryItems = await client.getDirectoryContents(\"/\");\n// Outputs a structure like:\n// [{\n//     filename: \"/my-file.txt\",\n//     basename: \"my-file.txt\",\n//     lastmod: \"Mon, 10 Oct 2018 23:24:11 GMT\",\n//     size: 371,\n//     type: \"file\"\n// }]\n```\n\n### Authentication & Connection\n\nThe WebDAV client automatically detects which authentication to use, between `AuthType.None` and `AuthType.Password`, if no `authType` configuration parameter is provided. For `AuthType.Token` or `AuthType.Digest`, you must specify it explicitly.\n\nSetting the `authType` will automatically manage the `Authorization` header when connecting.\n\nYou can set the `authType` to `AuthType.Auto` if you're unsure whether the remote server requires **digest** or **password** based authentication.\n\n#### Basic/no authentication\n\nYou can use the client without authentication if the server doesn't require it - simply avoid passing any values to `username`, `password` in the config.\n\nTo use basic authentication, simply pass a `username` and `password` in the config.\n\nThis library also allows for overriding the built in HTTP and HTTPS agents by setting the properties `httpAgent` & `httpsAgent` accordingly. These should be instances of node's [http.Agent](https://nodejs.org/api/http.html#http_class_http_agent) and [https.Agent](https://nodejs.org/api/https.html#https_class_https_agent) respectively.\n\n#### OAuth tokens\n\nTo use a token to authenticate, pass the token data to the `token` field and specify the `authType`:\n\n```typescript\ncreateClient(\n    \"https://address.com\",\n    {\n        authType: AuthType.Token,\n        token: {\n            access_token: \"2YotnFZFEjr1zCsicMWpAA\",\n            token_type: \"example\",\n            expires_in: 3600,\n            refresh_token: \"tGzv3JOkF0XG5Qx2TlKWIA\",\n            example_parameter: \"example_value\"\n        }\n    }\n);\n```\n\nYou can also provide the HA1 ([see here for details](https://en.wikipedia.org/wiki/Digest_access_authentication#Overview)) yourself. This enables you to generate the HA1 at the time the user is logged in and persist it, so you do not have persist the password itself.\n\n```typescript\ncreateClient(\"https://address.com\", {\n    authType: AuthType.Digest,\n    username: \"someUser\",\n    password: \"\",\n    ha1: \"your previously generated ha1 here\"\n});\n```\n\n#### Digest authentication\n\nIf a server requires digest-based authentication, you can enable this functionality by the `authType` configuration parameter, as well as providing a `username` and `password`:\n\n```typescript\ncreateClient(\n    \"https://address.com\",\n    {\n        authType: AuthType.Digest,\n        username: \"someUser\",\n        password: \"myS3curePa$$w0rd\"\n    }\n);\n```\n\n### Client configuration\n\nThe `createClient` method takes a WebDAV service URL, and a configuration options parameter.\n\nThe available configuration options are as follows:\n\n| Option        | Default       | Description                                       |\n|---------------|---------------|---------------------------------------------------|\n| `authType`    | `null`        | The authentication type to use. If not provided, defaults to trying to detect based upon whether `username` and `password` were provided. |\n| `contactHref` | _[This URL](https://github.com/ASunYC/webdav-client/blob/main/LOCK_CONTACT.md)_ | Contact URL used for LOCKs. |\n| `headers`     | `{}`          | Additional headers provided to all requests. Headers provided here are overridden by method-specific headers, including `Authorization`. |\n| `httpAgent`   | _None_        | HTTP agent instance. Available only in Node. See [http.Agent](https://nodejs.org/api/http.html#http_class_http_agent). |\n| `httpsAgent`  | _None_        | HTTPS agent instance. Available only in Node. See [https.Agent](https://nodejs.org/api/https.html#https_class_https_agent). |\n| `password`    | _None_        | Password for authentication.                      |\n| `token`       | _None_        | Token object for authentication.                  |\n| `username`    | _None_        | Username for authentication.                      |\n| `withCredentials` | _None_    | Credentials inclusion setting for the request,    |\n\n### Client methods\n\nThe `WebDAVClient` interface type contains all the methods and signatures for the WebDAV client instance.\n\n#### copyFile\n\nCopy a file from one location to another.\n\n```typescript\nawait client.copyFile(\n    \"/images/test.jpg\",\n    \"/public/img/test.jpg\"\n);\n```\n\n```typescript\n(filename: string, destination: string, options?: WebDAVMethodOptions) => Promise<void>\n```\n\n| Argument          | Required  | Description                                   |\n|-------------------|-----------|-----------------------------------------------|\n| `filename`        | Yes       | The source filename.                          |\n| `destination`     | Yes       | The destination filename.                     |\n| `options`         | No        | [Method options](#method-options).            |\n\n#### createDirectory\n\nCreate a new directory.\n\n```typescript\nawait client.createDirectory(\"/data/system/storage\");\n```\n\n```typescript\n(path: string, options?: CreateDirectoryOptions) => Promise<void>\n```\n\n| Argument              | Required  | Description                                   |\n|-----------------------|-----------|-----------------------------------------------|\n| `path`                | Yes       | The path to create.                           |\n| `options`             | No        | Create directory options.                     |\n| `options.recursive`   | No        | Recursively create directories if they do not exist. |\n\n_`options` extends [method options](#method-options)._\n\n##### Recursive creation\n\nRecursive directory creation is expensive request-wise. Multiple `stat` requests are made (totalling the depth of the path that exists, +1) to detect what parts of the path already exist, until finding a segment that doesn't exist - where it then only requests the _creation_ method.\n\nFor example, a recursive call to create a path `/a/b/c/d/e`, where `/a/b` already exists, will result in **3** `stat` requests (for `/a`, `/a/b` and `/a/b/c`) and **3** `createDirectory` requests (for `/a/b/c`, `/a/b/c/d` and `/a/b/c/d/e`).\n\n#### createReadStream\n\nSynchronously create a readable stream for a remote file.\n\n_Note that although a stream is returned instantly, the connection and fetching of the file is still performed asynchronously in the background. There will be some delay before the stream begins receiving data._\n\n```typescript\nclient\n    .createReadStream(\"/video.mp4\")\n    .pipe(fs.createWriteStream(\"~/video.mp4\"));\n```\n\nIf you want to stream only part of the file, you can specify the `range` in the options argument:\n\n```typescript\nclient\n    .createReadStream(\n        \"/video.mp4\", \n        { range: { start: 0, end: 1024 } }\n    ).pipe(fs.createWriteStream(\"~/video.mp4\"));\n```\n\n```typescript\n(filename: string, options?: CreateReadStreamOptions) => Stream.Readable\n```\n\n| Argument          | Required  | Description                                   |\n|-------------------|-----------|-----------------------------------------------|\n| `callback`        | No        | Callback to fire with the response of the request. |\n| `filename`        | Yes       | The remote file to stream.                    |\n| `options`         | No        | Read stream options.                          |\n| `options.range`   | No        | Stream range configuration.                   |\n| `options.range.start` | Yes   | Byte-position for the start of the stream.    |\n| `options.range.end` | No      | Byte-position for the end of the stream.      |\n\n_`options` extends [method options](#method-options)._\n\n#### createWriteStream\n\nCreate a write stream targeted at a remote file.\n\n_Note that although a stream is returned instantly, the connection and writing to the remote file is still performed asynchronously in the background. There will be some delay before the stream begins piping data._\n\n```typescript\nfs\n    .createReadStream(\"~/Music/song.mp3\")\n    .pipe(client.createWriteStream(\"/music/song.mp3\"));\n```\n\n```typescript\n(filename: string, options?: CreateWriteStreamOptions, callback?: CreateWriteStreamCallback) => Stream.Writable\n```\n\n| Argument          | Required  | Description                                   |\n|-------------------|-----------|-----------------------------------------------|\n| `filename`        | Yes       | The remote file to stream.                    |\n| `options`         | No        | Write stream options.                         |\n| `options.overwrite` | No      | Whether or not to overwrite the remote file if it already exists. Defaults to `true`. |\n| `callback`        | No        | Callback to fire once the connection has been made and streaming has started. Callback is called with the response of the request. |\n\n_`options` extends [method options](#method-options)._\n\n#### customRequest\n\nCustom requests can be made to the attached host by calling `customRequest`. Custom requests provide the boilerplate authentication and other request options used internally within the client.\n\n```typescript\nconst resp: Response = await this.client.customRequest(\"/alrighty.jpg\", {\n    method: \"PROPFIND\",\n    headers: {\n        Accept: \"text/plain\",\n        Depth: \"0\"\n    }\n});\nconst result: DAVResult = await parseXML(await resp.text());\nconst stat: FileStat = parseStat(result, \"/alrighty.jpg\", false);\n```\n\n```typescript\n(path: string, requestOptions: RequestOptionsCustom) => Promise<Response>\n```\n\n| Argument          | Required  | Description                                   |\n|-------------------|-----------|-----------------------------------------------|\n| `path`            | Yes       | The path to make a custom request against.    |\n| `requestOptions`  | Yes       | Request options - required parameters such as `url`, `method` etc. - Refer to the `RequestOptionsCustom` type definition. |\n\n_The request options parameter **does not** extend [method options](#method-options) as things like `headers` can already be specified._\n\n#### deleteFile\n\nDelete a remote file.\n\n```typescript\nawait client.deleteFile(\"/tmp.dat\");\n```\n\n```typescript\n(filename: string, options?: WebDAVMethodOptions) => Promise<void>\n```\n\n| Argument          | Required  | Description                                   |\n|-------------------|-----------|-----------------------------------------------|\n| `filename`        | Yes       | The file to delete.                           |\n| `options`         | No        | [Method options](#method-options).            |\n\n#### exists\n\nCheck if a file or directory exists.\n\n```typescript\nif (await client.exists(\"/some/path\") === false) {\n    await client.createDirectory(\"/some/path\");\n}\n```\n\n```typescript\n(path: string, options?: WebDAVMethodOptions) => Promise<boolean>\n```\n\n| Argument          | Required  | Description                                   |\n|-------------------|-----------|-----------------------------------------------|\n| `path`            | Yes       | The remote path to check.                     |\n| `options`         | No        | [Method options](#method-options).            |\n\n#### getDirectoryContents\n\nGet the contents of a remote directory. Returns an array of [item stats](#item-stats).\n\n```typescript\n// Get current directory contents:\nconst contents = await client.getDirectoryContents(\"/\");\n// Get all contents:\nconst contents = await client.getDirectoryContents(\"/\", { deep: true });\n```\n\nFiles can be globbed using the `glob` option (processed using [`minimatch`](https://github.com/isaacs/minimatch)). When using a glob pattern it is recommended to fetch `deep` contents:\n\n```typescript\nconst images = await client.getDirectoryContents(\"/\", { deep: true, glob: \"/**/*.{png,jpg,gif}\" });\n```\n\n```typescript\n(path: string, options?: GetDirectoryContentsOptions) => Promise<Array<FileStat> | ResponseDataDetailed<Array<FileStat>>>\n```\n\n| Argument          | Required  | Description                                   |\n|-------------------|-----------|-----------------------------------------------|\n| `path`            | Yes       | The path to fetch the contents of.            |\n| `options`         | No        | Configuration options.                        |\n| `options.deep`    | No        | Fetch deep results (recursive). Defaults to `false`. |\n| `options.details` | No        | Fetch detailed results (item stats, headers). Defaults to `false`. |\n| `options.glob`    | No        | Glob string for matching filenames. Not set by default. |\n\n_`options` extends [method options](#method-options)._\n\n#### getFileContents\n\nFetch the contents of a remote file. Binary contents are returned by default (`Buffer`):\n\n```typescript\nconst buff: Buffer = await client.getFileContents(\"/package.zip\");\n```\n\n_It is recommended to use streams if the files being transferred are large._\n\nText files can also be fetched:\n\n```typescript\nconst str: string = await client.getFileContents(\"/config.json\", { format: \"text\" });\n```\n\n```typescript\n(filename: string, options?: GetFileContentsOptions) => Promise<BufferLike | string | ResponseDataDetailed<BufferLike | string>>\n```\n\n| Argument          | Required  | Description                                   |\n|-------------------|-----------|-----------------------------------------------|\n| `filename`        | Yes       | The file to fetch the contents of.            |\n| `options`         | No        | Configuration options.                        |\n| `options.details` | No        | Fetch detailed results (additional headers). Defaults to `false`. |\n| `options.format`  | No        | Whether to fetch binary (\"binary\") data or textual (\"text\"). Defaults to \"binary\". |\n\n_`options` extends [method options](#method-options)._\n\n#### getFileDownloadLink\n\nGenerate a public link where a file can be downloaded. This method is synchronous. **Exposes authentication details in the URL**.\n\n_Not all servers may support this feature. Only Basic authentication and unauthenticated connections support this method._\n\n```typescript\nconst downloadLink: string = client.getFileDownloadLink(\"/image.png\");\n```\n\n```typescript\n(filename: string) => string\n```\n\n| Argument          | Required  | Description                                   |\n|-------------------|-----------|-----------------------------------------------|\n| `filename`        | Yes       | The remote file to generate a download link for. |\n\n#### getFileUploadLink\n\nGenerate a URL for a file upload. This method is synchronous. **Exposes authentication details in the URL**.\n\n```typescript\nconst uploadLink: string = client.getFileUploadLink(\"/image.png\");\n```\n\n```typescript\n(filename: string) => string\n```\n\n| Argument          | Required  | Description                                   |\n|-------------------|-----------|-----------------------------------------------|\n| `filename`        | Yes       | The remote file to generate an upload link for. |\n\n#### getQuota\n\nGet the quota information for the current account:\n\n```typescript\nconst quota: DiskQuota = await client.getQuota();\n// {\n//     \"used\": 1938743,\n//     \"available\": \"unlimited\"\n// }\n```\n\n```typescript\n(options?: GetQuotaOptions) => Promise<DiskQuota | null | ResponseDataDetailed<DiskQuota | null>>\n```\n\n| Argument          | Required  | Description                                   |\n|-------------------|-----------|-----------------------------------------------|\n| `options`         | No        | Configuration options.                        |\n| `options.details` | No        | Return detailed results (headers etc.). Defaults to `false`. |\n| `options.path`    | No        | Path used to make the quota request.          |\n\n_`options` extends [method options](#method-options)._\n\n#### lock\n\nLock a remote resource (using a **write** lock).\n\n```typescript\nconst lock = await client.lock(\"/file.doc\");\n\n// Later\nawait client.unlock(\"/file.doc\", lock.token);\n```\n\n```typescript\n(path: string, options?: LockOptions) => Promise<LockResponse>\n```\n\n| Argument          | Required  | Description                                   |\n|-------------------|-----------|-----------------------------------------------|\n| `path`            | Yes       | The path to lock.                             |\n| `options`         | No        | Configuration options.                        |\n| `options.timeout` | No        | WebDAV lock requested timeout. See the [WebDAV `Timeout` header documentation](https://docs.microsoft.com/en-us/previous-versions/office/developer/exchange-server-2003/aa143141(v=exchg.65)). |\n| `options.refreshToken` | No   | Previous valid lock token that should be refreshed. |\n\n_`options` extends [method options](#method-options)._\n\n#### moveFile\n\nMove a file to another location.\n\n```typescript\nawait client.moveFile(\"/file1.png\", \"/file2.png\");\n```\n\n```typescript\n(filename: string, destinationFilename: string, options?: WebDAVMethodOptions) => Promise<void>\n```\n\n| Argument          | Required  | Description                                   |\n|-------------------|-----------|-----------------------------------------------|\n| `filename`        | Yes       | File to move.                                 |\n| `destinationFilename` | Yes   | Destination filename.                         |\n| `options`         | No        | [Method options](#method-options).            |\n\n#### putFileContents\n\nWrite data to a remote file. Returns `false` when file was not written (eg. `{ overwrite: false }` and file exists), and `true` otherwise.\n\n```typescript\n// Write a buffer:\nawait client.putFileContents(\"/my/file.jpg\", imageBuffer, { overwrite: false });\n// Write a text file:\nawait client.putFileContents(\"/my/file.txt\", str);\n```\n\n```typescript\n(filename: string, data: string | BufferLike | Stream.Readable, options?: PutFileContentsOptions) => Promise<boolean>\n```\n\n| Argument          | Required  | Description                                   |\n|-------------------|-----------|-----------------------------------------------|\n| `filename`        | Yes       | File to write to.                             |\n| `data`            | Yes       | The data to write. Can be a string, buffer or a readable stream. |\n| `options`         | No        | Configuration options.                        |\n| `options.contentLength` | No  | Data content length override. Either a boolean (`true` (**default**) = calculate, `false` = don't set) or a number indicating the exact byte length of the file. |\n| `options.overwrite` | No      | Whether or not to override the remote file if it exists. Defaults to `true`. |\n\n_`options` extends [method options](#method-options)._\n\n#### partialUpdateFileContents\n\nUpdate a remote file with a partial update. This method is useful for updating a file without having to download and re-upload the entire file.\n\n**_Note that this method is not standardised and may not be supported by all servers._** To use this feature, one of the following must be met:\n * WebDav is served by Apache with the [mod_dav](https://httpd.apache.org/docs/2.4/mod/mod_dav.html) module\n * The server supports Sabredav PartialUpdate Extension (https://sabre.io/dav/http-patch/)\n\n```typescript\n(filePath: string, start: number, end: number, data: string | BufferLike | Stream.Readable, options?: WebDAVMethodOptions)=> Promise<void>\n```\n\n| Argument          | Required  | Description                                   |\n|-------------------|-----------|-----------------------------------------------|\n| `filePath`        | Yes       | File to update.                               |\n| `start`           | Yes       | Start byte position. (inclusive)              |\n| `end`             | Yes       | End byte position.   (inclusive)              |\n| `data`            | Yes       | The data to write. Can be a string, buffer or a readable stream. |\n| `options`         | No        | Configuration options.                        |\n\n#### search\n\nPerform a WebDAV search as per [rfc5323](https://www.ietf.org/rfc/rfc5323.html).\n\n```typescript\nconst searchRequest = `\n<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<d:searchrequest xmlns:d=\"DAV:\" xmlns:f=\"http://example.com/foo\">\n    <f:natural-language-query>\n    Find files changed last week\n    </f:natural-language-query>\n</d:searchrequest>\n`\nconst result: SearchResult = await client.search(\"/some-collection\", { data: searchRequest });\n```\n\n```typescript\n(path: string, options?: SearchOptions) => Promise<SearchResult | ResponseDataDetailed<SearchResult>>\n```\n\n| Argument          | Required  | Description                                   |\n|-------------------|-----------|-----------------------------------------------|\n| `path`            | Yes       | Remote path to which executes the search.     |\n| `options`         | No        | Configuration options.                        |\n| `options.details` | No        | Return detailed results (headers etc.). Defaults to `false`. |\n\n_`options` extends [method options](#method-options)._\n\n#### stat\n\nGet a file or directory stat object. Returns an [item stat](#item-stats).\n\n```typescript\nconst stat: FileStat = await client.stat(\"/some/file.tar.gz\");\n```\n\n```typescript\n(path: string, options?: StatOptions) => Promise<FileStat | ResponseDataDetailed<FileStat>>\n```\n\n| Argument          | Required  | Description                                   |\n|-------------------|-----------|-----------------------------------------------|\n| `path`            | Yes       | Remote path to stat.                          |\n| `options`         | No        | Configuration options.                        |\n| `options.details` | No        | Return detailed results (headers etc.). Defaults to `false`. |\n\n_`options` extends [method options](#method-options)._\n\n#### unlock\n\nUnlock a locked resource using a token.\n\n```typescript\nawait client.unlock(\"/file.doc\", lock.token);\n```\n\n```typescript\n(path: string, token:string, options?: WebDAVMethodOptions) => Promise<void>\n```\n\n| Argument          | Required  | Description                                   |\n|-------------------|-----------|-----------------------------------------------|\n| `path`            | Yes       | Remote path to unlock.                        |\n| `token`           | Yes       | Token string from a previous lock request.    |\n| `options`         | No        | Configuration options.                        |\n\n_`options` extends [method options](#method-options)._\n\n##### Custom properties\n\nFor requests like `stat`, which use the `PROPFIND` method under the hood, it is possible to provide a custom request body to the method so that the server may respond with additional/different data. Overriding of the body can be performed by setting the `data` property in the [method options](#method-options).\n\n### Method options\n\nMost WebDAV methods extend `WebDAVMethodOptions`, which allow setting things like custom headers.\n\n| Option            | Required  | Description                                   |\n|-------------------|-----------|-----------------------------------------------|\n| `data`            | No        | Optional body/data value to send in the request. This overrides the original body of the request, if applicable. |\n| `headers`         | No        | Optional headers object to apply to the request. These headers override all others, so be careful. |\n| `signal`          | No        | Instance of [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal), for aborting requests. |\n\n### Common data structures\n\n#### Item stats\n\nItem stats are objects with properties that descibe a file or directory. They resemble the following:\n\n```json\n{\n    \"filename\": \"/test\",\n    \"basename\": \"test\",\n    \"lastmod\": \"Tue, 05 Apr 2016 14:39:18 GMT\",\n    \"size\": 0,\n    \"type\": \"directory\",\n    \"etag\": null\n}\n```\n\nor:\n\n```json\n{\n    \"filename\": \"/image.jpg\",\n    \"basename\": \"image.jpg\",\n    \"lastmod\": \"Sun, 13 Mar 2016 04:23:32 GMT\",\n    \"size\": 42497,\n    \"type\": \"file\",\n    \"mime\": \"image/jpeg\",\n    \"etag\": \"33a728c7f288ede1fecc90ac6a10e062\"\n}\n```\n\nProperties:\n\n| Property name | Type    | Present      | Description                                 |\n|---------------|---------|--------------|---------------------------------------------|\n| filename      | String  | Always       | File path of the remote item                |\n| basename      | String  | Always       | Base filename of the remote item, no path   |\n| lastmod       | String  | Always       | Last modification date of the item          |\n| size          | Number  | Always       | File size - 0 for directories               |\n| type          | String  | Always       | Item type - \"file\" or \"directory\"           |\n| mime          | String  | Files only   | Mime type - for file items only             |\n| etag          | String / null | When supported | [ETag](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/ETag) of the file |\n| props         | Object  | `details: true` | Props object containing all item properties returned by the server |\n\n\n#### Detailed responses\n\nRequests that return results, such as `getDirectoryContents`, `getFileContents`, `getQuota`, `search` and `stat`, can be configured to return more detailed information, such as response headers. Pass `{ details: true }` to their options argument to receive an object like the following:\n\n| Property     | Type            | Description                            |\n|--------------|-----------------|----------------------------------------|\n| data         | *               | The data returned by the procedure. Will be whatever type is returned by calling without `{ details: true }` |\n| headers      | Object          | The response headers.                  |\n| status       | Number          | The numeric status code.               |\n| statusText   | String          | The status text.                       |\n\n### CORS\nCORS is a security enforcement technique employed by browsers to ensure requests are executed to and from expected contexts. It can conflict with this library if the target server doesn't return CORS headers when making requests from a browser. It is your responsibility to handle this.\n\nIt is a known issue that Nextcloud servers by default don't return friendly CORS headers, making working with this library within a browser context impossible. You can of course force the addition of CORS headers (Apache or Nginx configs) yourself, but do this at your own risk.","readmeFilename":"README.md"}