fix(webdav-client): correct directory listing path handling and update tooling for current package dependencies

This commit is contained in:
2026-05-01 18:34:20 +00:00
parent f806027542
commit 850b5b9142
12 changed files with 7074 additions and 4022 deletions
+7 -4
View File
@@ -1,4 +1,3 @@
import type { isFile } from '@push.rocks/smartpath/dist_ts/smartpath.check.js';
import * as plugins from './plugins.js';
export interface IWebdavClientOptions {
@@ -30,8 +29,8 @@ export class WebdavClient {
});
}
public async listDirectory(pathArg: string) {
const result = await this.wdClient.getDirectoryContents('/');
public async listDirectory(pathArg: string): Promise<plugins.webdav.FileStat[]> {
const result = await this.wdClient.getDirectoryContents(pathArg);
return result as plugins.webdav.FileStat[];
}
@@ -42,7 +41,11 @@ export class WebdavClient {
const fileContents = (await this.wdClient.getFileContents(file.filename, {
format: 'binary',
})) as Buffer;
smartfileArray.push(await plugins.smartfile.SmartFile.fromBuffer(file.filename, fileContents));
smartfileArray.push(new plugins.smartfile.SmartFile({
path: file.filename,
contentBuffer: fileContents,
base: process.cwd(),
}));
}
return smartfileArray;
}