diff --git a/package-lock.json b/package-lock.json index d98dd487..d01bd96d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -31,7 +31,7 @@ "vue-router": "^3.6.5", "vue-virtual-scroller": "1.1.2", "vue2-leaflet": "^2.7.1", - "webdav": "^4.11.2" + "webdav": "^5.3.0" }, "devDependencies": { "@playwright/test": "^1.39.0", @@ -41,7 +41,6 @@ "@types/url-parse": "^1.4.10", "@types/videojs-contrib-quality-levels": "^2.0.3", "css-loader": "^6.8.1", - "node-polyfill-webpack-plugin": "2.0.1", "playwright": "^1.39.0", "prettier": "^3.0.3", "sass": "^1.69.5", @@ -1743,6 +1742,14 @@ "node": ">=6.9.0" } }, + "node_modules/@buttercup/fetch": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/@buttercup/fetch/-/fetch-0.1.2.tgz", + "integrity": "sha512-mDBtsysQ0Gnrp4FamlRJGpu7HUHwbyLC4uUav1I7QAqThFAa/4d1cdZCxrV5gKvh6zO1fu95bILNJi4Y2hALhQ==", + "optionalDependencies": { + "node-fetch": "^3.3.0" + } + }, "node_modules/@cspotcode/source-map-support": { "version": "0.8.1", "resolved": "https://registry.npmjs.org/@cspotcode/source-map-support/-/source-map-support-0.8.1.tgz", @@ -4098,6 +4105,15 @@ "resolved": "https://registry.npmjs.org/custom-event-polyfill/-/custom-event-polyfill-1.0.7.tgz", "integrity": "sha512-TDDkd5DkaZxZFM8p+1I3yAlvM3rSr1wbrOliG4yJiwinMZN8z/iGL7BTlDkrJcYTmgUSb4ywVCc3ZaUtOtC76w==" }, + "node_modules/data-uri-to-buffer": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/data-uri-to-buffer/-/data-uri-to-buffer-4.0.1.tgz", + "integrity": "sha512-0R9ikRb668HB7QDxT1vkpuUBtqc53YyAwMwGeUFKRojY/NWKvdZ+9UYtRfGmhqNbRkTSVpMbmyhXipFFv2cb/A==", + "optional": true, + "engines": { + "node": ">= 12" + } + }, "node_modules/date-format-parse": { "version": "0.2.7", "resolved": "https://registry.npmjs.org/date-format-parse/-/date-format-parse-0.2.7.tgz", @@ -4526,6 +4542,29 @@ "node": ">= 4.9.1" } }, + "node_modules/fetch-blob": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/fetch-blob/-/fetch-blob-3.2.0.tgz", + "integrity": "sha512-7yAQpD2UMJzLi1Dqv7qFYnPbaPx7ZfFK6PiIxQ4PfkGPyNyl2Ugx+a/umUonmKqjhM4DnfbMvdX6otXq83soQQ==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/jimmywarting" + }, + { + "type": "paypal", + "url": "https://paypal.me/jimmywarting" + } + ], + "optional": true, + "dependencies": { + "node-domexception": "^1.0.0", + "web-streams-polyfill": "^3.0.3" + }, + "engines": { + "node": "^12.20 || >= 14.13" + } + }, "node_modules/filelist": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/filelist/-/filelist-1.0.4.tgz", @@ -4738,6 +4777,18 @@ "node": ">= 6" } }, + "node_modules/formdata-polyfill": { + "version": "4.0.10", + "resolved": "https://registry.npmjs.org/formdata-polyfill/-/formdata-polyfill-4.0.10.tgz", + "integrity": "sha512-buewHzMvYL29jdeQTVILecSaZKnt/RJWjoZCF5OW60Z67/GmSLBkOFM7qh1PI3zFNtJbaZL5eQu1vLfazOwj4g==", + "optional": true, + "dependencies": { + "fetch-blob": "^3.1.2" + }, + "engines": { + "node": ">=12.20.0" + } + }, "node_modules/fs-extra": { "version": "9.1.0", "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-9.1.0.tgz", @@ -5125,9 +5176,9 @@ "integrity": "sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==" }, "node_modules/hot-patcher": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/hot-patcher/-/hot-patcher-1.0.0.tgz", - "integrity": "sha512-3H8VH0PreeNsKMZw16nTHbUp4YoHCnPlawpsPXGJUR4qENDynl79b6Xk9CIFvLcH1qungBsCuzKcWyzoPPalTw==" + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/hot-patcher/-/hot-patcher-2.0.1.tgz", + "integrity": "sha512-ECg1JFG0YzehicQaogenlcs2qg6WsXQsxtnbr1i696u5tLUjtJdQAh0u2g0Q5YV45f263Ta1GnUJsc8WIfJf4Q==" }, "node_modules/https-browserify": { "version": "1.0.0", @@ -5873,9 +5924,9 @@ ] }, "node_modules/layerr": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/layerr/-/layerr-0.1.2.tgz", - "integrity": "sha512-ob5kTd9H3S4GOG2nVXyQhOu9O8nBgP555XxWPkJI0tR0JeRilfyTp8WtPdIJHLXBmHMSdEq5+KMxiYABeScsIQ==" + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/layerr/-/layerr-2.0.1.tgz", + "integrity": "sha512-z0730CwG/JO24evdORnyDkwG1Q7b7mF2Tp1qRQ0YvrMMARbt1DFG694SOv439Gm7hYKolyZyaB49YIrYIfZBdg==" }, "node_modules/leaflet": { "version": "1.9.4", @@ -6661,6 +6712,7 @@ "version": "5.1.0", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.0.tgz", "integrity": "sha512-9TPBGGak4nHfGZsPBohm9AWg6NoT7QTCehS3BIJABslyZbzxfV78QM2Y6+i741OPZIafFAaiiEMh5OyIrJPgtg==", + "dev": true, "dependencies": { "brace-expansion": "^2.0.1" }, @@ -6767,6 +6819,43 @@ "resolved": "https://registry.npmjs.org/nested-property/-/nested-property-4.0.0.tgz", "integrity": "sha512-yFehXNWRs4cM0+dz7QxCd06hTbWbSkV0ISsqBfkntU6TOY4Qm3Q88fRRLOddkGh2Qq6dZvnKVAahfhjcUvLnyA==" }, + "node_modules/node-domexception": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/node-domexception/-/node-domexception-1.0.0.tgz", + "integrity": "sha512-/jKZoMpw0F8GRwl4/eLROPA3cfcXtLApP0QzLmUT/HuPCZWyB7IY9ZrMeKw2O/nFIqPQB3PVM9aYm0F312AXDQ==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/jimmywarting" + }, + { + "type": "github", + "url": "https://paypal.me/jimmywarting" + } + ], + "optional": true, + "engines": { + "node": ">=10.5.0" + } + }, + "node_modules/node-fetch": { + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-3.3.2.tgz", + "integrity": "sha512-dRB78srN/l6gqWulah9SrxeYnxeddIG30+GOqK/9OlLVyLg3HPnr6SqOWTWOXKRwC2eGYCkZ59NNuSgvSrpgOA==", + "optional": true, + "dependencies": { + "data-uri-to-buffer": "^4.0.0", + "fetch-blob": "^3.1.4", + "formdata-polyfill": "^4.0.10" + }, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/node-fetch" + } + }, "node_modules/node-gettext": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/node-gettext/-/node-gettext-3.0.0.tgz", @@ -9101,9 +9190,12 @@ } }, "node_modules/url-join": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/url-join/-/url-join-4.0.1.tgz", - "integrity": "sha512-jk1+QP6ZJqyOiuEI9AEWQfju/nB2Pw466kbA0LEZljHwKeMgd9WrAEgEGxjPDD2+TNbbb37rTyhEfrCXfuKXnA==" + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/url-join/-/url-join-5.0.0.tgz", + "integrity": "sha512-n2huDr9h9yzd6exQVnH/jU5mr+Pfx08LRXXZhkLLetAMESRj+anQsTAh940iMrIetKAmry9coFuZQ2jY8/p3WA==", + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + } }, "node_modules/url-parse": { "version": "1.5.10", @@ -9553,27 +9645,71 @@ "url": "https://github.com/sponsors/wooorm" } }, + "node_modules/web-streams-polyfill": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/web-streams-polyfill/-/web-streams-polyfill-3.2.1.tgz", + "integrity": "sha512-e0MO3wdXWKrLbL0DgGnUV7WHVuw9OUvL4hjgnPkIeEvESk74gAITi5G606JtZPp39cd8HA9VQzCIvA49LpPN5Q==", + "optional": true, + "engines": { + "node": ">= 8" + } + }, "node_modules/webdav": { - "version": "4.11.2", - "resolved": "https://registry.npmjs.org/webdav/-/webdav-4.11.2.tgz", - "integrity": "sha512-Ht9TPD5EB7gYW0YmhRcE5NW0/dn/HQfyLSPQY1Rw1coQ5MQTUooAQ9Bpqt4EU7QLw0b95tX4cU59R+SIojs9KQ==", + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/webdav/-/webdav-5.3.0.tgz", + "integrity": "sha512-xRu/URZGCxDPXmT+9Gu6tNGvlETBwjcuz69lx/6Qlq/0q3Gu2GSVyRt+mP0vTlLFfaY3xZ5O/SPTQ578tC/45Q==", "dependencies": { - "axios": "^0.27.2", + "@buttercup/fetch": "^0.1.1", "base-64": "^1.0.0", "byte-length": "^1.0.2", - "fast-xml-parser": "^3.19.0", + "fast-xml-parser": "^4.2.4", "he": "^1.2.0", - "hot-patcher": "^1.0.0", - "layerr": "^0.1.2", + "hot-patcher": "^2.0.0", + "layerr": "^2.0.1", "md5": "^2.3.0", - "minimatch": "^5.1.0", + "minimatch": "^7.4.6", "nested-property": "^4.0.0", "path-posix": "^1.0.0", - "url-join": "^4.0.1", + "url-join": "^5.0.0", "url-parse": "^1.5.10" }, + "engines": { + "node": ">=14" + } + }, + "node_modules/webdav/node_modules/fast-xml-parser": { + "version": "4.3.2", + "resolved": "https://registry.npmjs.org/fast-xml-parser/-/fast-xml-parser-4.3.2.tgz", + "integrity": "sha512-rmrXUXwbJedoXkStenj1kkljNF7ugn5ZjR9FJcwmCfcCbtOMDghPajbc+Tck6vE6F5XsDmx+Pr2le9fw8+pXBg==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/NaturalIntelligence" + }, + { + "type": "paypal", + "url": "https://paypal.me/naturalintelligence" + } + ], + "dependencies": { + "strnum": "^1.0.5" + }, + "bin": { + "fxparser": "src/cli/cli.js" + } + }, + "node_modules/webdav/node_modules/minimatch": { + "version": "7.4.6", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-7.4.6.tgz", + "integrity": "sha512-sBz8G/YjVniEz6lKPNpKxXwazJe4c19fEfV2GDMX6AjFz+MX9uDWIZW8XreVhkFW3fkIdTv/gxWr/Kks5FFAVw==", + "dependencies": { + "brace-expansion": "^2.0.1" + }, "engines": { "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" } }, "node_modules/webidl-conversions": { @@ -11258,6 +11394,14 @@ "to-fast-properties": "^2.0.0" } }, + "@buttercup/fetch": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/@buttercup/fetch/-/fetch-0.1.2.tgz", + "integrity": "sha512-mDBtsysQ0Gnrp4FamlRJGpu7HUHwbyLC4uUav1I7QAqThFAa/4d1cdZCxrV5gKvh6zO1fu95bILNJi4Y2hALhQ==", + "requires": { + "node-fetch": "^3.3.0" + } + }, "@cspotcode/source-map-support": { "version": "0.8.1", "resolved": "https://registry.npmjs.org/@cspotcode/source-map-support/-/source-map-support-0.8.1.tgz", @@ -13138,6 +13282,12 @@ "resolved": "https://registry.npmjs.org/custom-event-polyfill/-/custom-event-polyfill-1.0.7.tgz", "integrity": "sha512-TDDkd5DkaZxZFM8p+1I3yAlvM3rSr1wbrOliG4yJiwinMZN8z/iGL7BTlDkrJcYTmgUSb4ywVCc3ZaUtOtC76w==" }, + "data-uri-to-buffer": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/data-uri-to-buffer/-/data-uri-to-buffer-4.0.1.tgz", + "integrity": "sha512-0R9ikRb668HB7QDxT1vkpuUBtqc53YyAwMwGeUFKRojY/NWKvdZ+9UYtRfGmhqNbRkTSVpMbmyhXipFFv2cb/A==", + "optional": true + }, "date-format-parse": { "version": "0.2.7", "resolved": "https://registry.npmjs.org/date-format-parse/-/date-format-parse-0.2.7.tgz", @@ -13466,6 +13616,16 @@ "integrity": "sha512-eRnCtTTtGZFpQCwhJiUOuxPQWRXVKYDn0b2PeHfXL6/Zi53SLAzAHfVhVWK2AryC/WH05kGfxhFIPvTF0SXQzg==", "dev": true }, + "fetch-blob": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/fetch-blob/-/fetch-blob-3.2.0.tgz", + "integrity": "sha512-7yAQpD2UMJzLi1Dqv7qFYnPbaPx7ZfFK6PiIxQ4PfkGPyNyl2Ugx+a/umUonmKqjhM4DnfbMvdX6otXq83soQQ==", + "optional": true, + "requires": { + "node-domexception": "^1.0.0", + "web-streams-polyfill": "^3.0.3" + } + }, "filelist": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/filelist/-/filelist-1.0.4.tgz", @@ -13604,6 +13764,15 @@ "mime-types": "^2.1.12" } }, + "formdata-polyfill": { + "version": "4.0.10", + "resolved": "https://registry.npmjs.org/formdata-polyfill/-/formdata-polyfill-4.0.10.tgz", + "integrity": "sha512-buewHzMvYL29jdeQTVILecSaZKnt/RJWjoZCF5OW60Z67/GmSLBkOFM7qh1PI3zFNtJbaZL5eQu1vLfazOwj4g==", + "optional": true, + "requires": { + "fetch-blob": "^3.1.2" + } + }, "fs-extra": { "version": "9.1.0", "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-9.1.0.tgz", @@ -13902,9 +14071,9 @@ } }, "hot-patcher": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/hot-patcher/-/hot-patcher-1.0.0.tgz", - "integrity": "sha512-3H8VH0PreeNsKMZw16nTHbUp4YoHCnPlawpsPXGJUR4qENDynl79b6Xk9CIFvLcH1qungBsCuzKcWyzoPPalTw==" + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/hot-patcher/-/hot-patcher-2.0.1.tgz", + "integrity": "sha512-ECg1JFG0YzehicQaogenlcs2qg6WsXQsxtnbr1i696u5tLUjtJdQAh0u2g0Q5YV45f263Ta1GnUJsc8WIfJf4Q==" }, "https-browserify": { "version": "1.0.0", @@ -14412,9 +14581,9 @@ "integrity": "sha512-ARqdgAbdNIougRlOKvkQwHlGhXPRBV4KvhCP+qoPpGoVQwwiJe4Hkdu4HHdRPb9rGUp04jDTAxBzEwBsE272pg==" }, "layerr": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/layerr/-/layerr-0.1.2.tgz", - "integrity": "sha512-ob5kTd9H3S4GOG2nVXyQhOu9O8nBgP555XxWPkJI0tR0JeRilfyTp8WtPdIJHLXBmHMSdEq5+KMxiYABeScsIQ==" + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/layerr/-/layerr-2.0.1.tgz", + "integrity": "sha512-z0730CwG/JO24evdORnyDkwG1Q7b7mF2Tp1qRQ0YvrMMARbt1DFG694SOv439Gm7hYKolyZyaB49YIrYIfZBdg==" }, "leaflet": { "version": "1.9.4", @@ -14941,6 +15110,7 @@ "version": "5.1.0", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.0.tgz", "integrity": "sha512-9TPBGGak4nHfGZsPBohm9AWg6NoT7QTCehS3BIJABslyZbzxfV78QM2Y6+i741OPZIafFAaiiEMh5OyIrJPgtg==", + "dev": true, "requires": { "brace-expansion": "^2.0.1" } @@ -15014,6 +15184,23 @@ "resolved": "https://registry.npmjs.org/nested-property/-/nested-property-4.0.0.tgz", "integrity": "sha512-yFehXNWRs4cM0+dz7QxCd06hTbWbSkV0ISsqBfkntU6TOY4Qm3Q88fRRLOddkGh2Qq6dZvnKVAahfhjcUvLnyA==" }, + "node-domexception": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/node-domexception/-/node-domexception-1.0.0.tgz", + "integrity": "sha512-/jKZoMpw0F8GRwl4/eLROPA3cfcXtLApP0QzLmUT/HuPCZWyB7IY9ZrMeKw2O/nFIqPQB3PVM9aYm0F312AXDQ==", + "optional": true + }, + "node-fetch": { + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-3.3.2.tgz", + "integrity": "sha512-dRB78srN/l6gqWulah9SrxeYnxeddIG30+GOqK/9OlLVyLg3HPnr6SqOWTWOXKRwC2eGYCkZ59NNuSgvSrpgOA==", + "optional": true, + "requires": { + "data-uri-to-buffer": "^4.0.0", + "fetch-blob": "^3.1.4", + "formdata-polyfill": "^4.0.10" + } + }, "node-gettext": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/node-gettext/-/node-gettext-3.0.0.tgz", @@ -16674,9 +16861,9 @@ } }, "url-join": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/url-join/-/url-join-4.0.1.tgz", - "integrity": "sha512-jk1+QP6ZJqyOiuEI9AEWQfju/nB2Pw466kbA0LEZljHwKeMgd9WrAEgEGxjPDD2+TNbbb37rTyhEfrCXfuKXnA==" + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/url-join/-/url-join-5.0.0.tgz", + "integrity": "sha512-n2huDr9h9yzd6exQVnH/jU5mr+Pfx08LRXXZhkLLetAMESRj+anQsTAh940iMrIetKAmry9coFuZQ2jY8/p3WA==" }, "url-parse": { "version": "1.5.10", @@ -17004,24 +17191,48 @@ "resolved": "https://registry.npmjs.org/web-namespaces/-/web-namespaces-2.0.1.tgz", "integrity": "sha512-bKr1DkiNa2krS7qxNtdrtHAmzuYGFQLiQ13TsorsdT6ULTkPLKuu5+GsFpDlg6JFjUTwX2DyhMPG2be8uPrqsQ==" }, + "web-streams-polyfill": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/web-streams-polyfill/-/web-streams-polyfill-3.2.1.tgz", + "integrity": "sha512-e0MO3wdXWKrLbL0DgGnUV7WHVuw9OUvL4hjgnPkIeEvESk74gAITi5G606JtZPp39cd8HA9VQzCIvA49LpPN5Q==", + "optional": true + }, "webdav": { - "version": "4.11.2", - "resolved": "https://registry.npmjs.org/webdav/-/webdav-4.11.2.tgz", - "integrity": "sha512-Ht9TPD5EB7gYW0YmhRcE5NW0/dn/HQfyLSPQY1Rw1coQ5MQTUooAQ9Bpqt4EU7QLw0b95tX4cU59R+SIojs9KQ==", + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/webdav/-/webdav-5.3.0.tgz", + "integrity": "sha512-xRu/URZGCxDPXmT+9Gu6tNGvlETBwjcuz69lx/6Qlq/0q3Gu2GSVyRt+mP0vTlLFfaY3xZ5O/SPTQ578tC/45Q==", "requires": { - "axios": "^0.27.2", + "@buttercup/fetch": "^0.1.1", "base-64": "^1.0.0", "byte-length": "^1.0.2", - "fast-xml-parser": "^3.19.0", + "fast-xml-parser": "^4.2.4", "he": "^1.2.0", - "hot-patcher": "^1.0.0", - "layerr": "^0.1.2", + "hot-patcher": "^2.0.0", + "layerr": "^2.0.1", "md5": "^2.3.0", - "minimatch": "^5.1.0", + "minimatch": "^7.4.6", "nested-property": "^4.0.0", "path-posix": "^1.0.0", - "url-join": "^4.0.1", + "url-join": "^5.0.0", "url-parse": "^1.5.10" + }, + "dependencies": { + "fast-xml-parser": { + "version": "4.3.2", + "resolved": "https://registry.npmjs.org/fast-xml-parser/-/fast-xml-parser-4.3.2.tgz", + "integrity": "sha512-rmrXUXwbJedoXkStenj1kkljNF7ugn5ZjR9FJcwmCfcCbtOMDghPajbc+Tck6vE6F5XsDmx+Pr2le9fw8+pXBg==", + "requires": { + "strnum": "^1.0.5" + } + }, + "minimatch": { + "version": "7.4.6", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-7.4.6.tgz", + "integrity": "sha512-sBz8G/YjVniEz6lKPNpKxXwazJe4c19fEfV2GDMX6AjFz+MX9uDWIZW8XreVhkFW3fkIdTv/gxWr/Kks5FFAVw==", + "requires": { + "brace-expansion": "^2.0.1" + } + } } }, "webidl-conversions": { diff --git a/package.json b/package.json index f54374f8..7866257f 100644 --- a/package.json +++ b/package.json @@ -52,7 +52,7 @@ "vue-router": "^3.6.5", "vue-virtual-scroller": "1.1.2", "vue2-leaflet": "^2.7.1", - "webdav": "^4.11.2" + "webdav": "^5.3.0" }, "engines": { "node": ">=18.2.0", @@ -66,7 +66,6 @@ "@types/url-parse": "^1.4.10", "@types/videojs-contrib-quality-levels": "^2.0.3", "css-loader": "^6.8.1", - "node-polyfill-webpack-plugin": "2.0.1", "playwright": "^1.39.0", "prettier": "^3.0.3", "sass": "^1.69.5", diff --git a/src/services/dav/base.ts b/src/services/dav/base.ts index 671b8f7d..2e35dd50 100644 --- a/src/services/dav/base.ts +++ b/src/services/dav/base.ts @@ -2,7 +2,7 @@ import { showError } from '@nextcloud/dialogs'; import axios from '@nextcloud/axios'; import { getAlbumFileInfos } from './albums'; -import client from './client'; +import client, { remotePath } from './client'; import { API } from '@services/API'; import { translate as t } from '@services/l10n'; @@ -10,6 +10,7 @@ import * as utils from '@services/utils'; import * as nativex from '@native'; import type { IFileInfo, IPhoto } from '@typings'; +import type { ResponseDataDetailed, SearchResult } from 'webdav'; const GET_FILE_CHUNK_SIZE = 50; @@ -92,23 +93,27 @@ async function getFilesInternal2(fileIds: number[]): Promise { .map((fileId) => `${fileId}`) .join(''); - const options = { - method: 'SEARCH', - headers: { 'content-Type': 'text/xml' }, - data: `${prefixPath}0${filter}`, - deep: true, - details: true, - }; + // Make Search request + const xml = `${prefixPath}0${filter}`; + const response = (await client.search('', { data: xml, details: true })) as ResponseDataDetailed; - const response: any = await client.getDirectoryContents('', options); + return response.data.results + .filter((file) => file.props?.fileid) + .map((file) => { + // remote remotePath from start + if (file.filename.startsWith(remotePath)) { + file.filename = file.filename.substring(remotePath.length); + } - return response.data.map((data: any) => ({ - id: data.props.fileid, - fileid: data.props.fileid, - basename: data.basename, - originalFilename: data.filename, - filename: data.filename.replace(prefixPath, ''), - })); + // create IFileInfo + return { + id: file.props!.fileid as number, + fileid: file.props!.fileid as number, + basename: file.basename, + originalFilename: file.filename, + filename: file.filename.replace(prefixPath, ''), + }; + }); } /** diff --git a/src/services/dav/client.ts b/src/services/dav/client.ts index 05c0de78..079e483e 100644 --- a/src/services/dav/client.ts +++ b/src/services/dav/client.ts @@ -20,26 +20,27 @@ * */ -import * as webdav from 'webdav'; -import axios from '@nextcloud/axios'; -import parseUrl from 'url-parse'; +import { createClient } from 'webdav'; +import { getRequestToken, onRequestTokenUpdate } from '@nextcloud/auth'; import { generateRemoteUrl } from '@nextcloud/router'; -// Monkey business -import * as rq from 'webdav/dist/node/request'; -const prepareRequestOptionsOld = rq.prepareRequestOptions.bind(rq); -(rq).prepareRequestOptions = (requestOptions: any, context: any, userOptions: any) => { - requestOptions.method = userOptions.method || requestOptions.method; - return prepareRequestOptionsOld(requestOptions, context, userOptions); -}; - -// force our axios -const patcher = webdav.getPatcher(); -patcher.patch('request', axios); - // init webdav client on default dav endpoint const remote = generateRemoteUrl('dav'); -const client = webdav.createClient(remote); +const client = createClient(remote); -export const remotePath = parseUrl(remote).pathname; +// set CSRF token header +function setToken(token: string | null) { + client.setHeaders({ + requesttoken: token ?? String(), + }); +} + +// refresh headers when request token changes +setToken(getRequestToken()); +onRequestTokenUpdate((t) => setToken(t)); + +// Filenames start with this path +export const remotePath = new URL(remote).pathname; + +// Get the current client export default client; diff --git a/src/services/dav/tags.ts b/src/services/dav/tags.ts index ced19d97..ba21430e 100644 --- a/src/services/dav/tags.ts +++ b/src/services/dav/tags.ts @@ -50,7 +50,7 @@ export async function createTag(tag: ITag): Promise { data: postData, }); - const contentLocation = headers['content-location']; + const contentLocation = headers.get('content-location'); if (contentLocation) { return { ...tag, diff --git a/webpack.config.ts b/webpack.config.ts index 065df45f..caa85fad 100644 --- a/webpack.config.ts +++ b/webpack.config.ts @@ -3,7 +3,6 @@ const path = require('path'); const WorkboxPlugin = require('workbox-webpack-plugin'); const TerserPlugin = require('terser-webpack-plugin'); -const NodePolyfillPlugin = require('node-polyfill-webpack-plugin'); const { VueLoaderPlugin } = require('vue-loader'); const appName = process.env.npm_package_name!; @@ -103,12 +102,6 @@ module.exports = { plugins: [ new VueLoaderPlugin(), - // Make sure we auto-inject node polyfills on demand - // https://webpack.js.org/blog/2020-10-10-webpack-5-release/#automatic-nodejs-polyfills-removed - new NodePolyfillPlugin({ - includeAliases: ['stream', 'process'], // webdav - }), - // Bundle service worker new WorkboxPlugin.InjectManifest({ swSrc: path.resolve(path.join('src', 'service-worker.ts')),