fix(webdav-client): correct directory listing path handling and update tooling for current package dependencies
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user