fix(webdav-client): correct directory listing path handling and update tooling for current package dependencies
This commit is contained in:
@@ -1,8 +1,8 @@
|
||||
/**
|
||||
* autocreated commitinfo by @pushrocks/commitinfo
|
||||
* autocreated commitinfo by @push.rocks/commitinfo
|
||||
*/
|
||||
export const commitinfo = {
|
||||
name: '@push.rocks/smartwebdav',
|
||||
version: '1.1.2',
|
||||
version: '1.1.3',
|
||||
description: 'A TypeScript library for easy interaction with WebDAV servers, including file and directory management.'
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
+3
-3
@@ -1,15 +1,15 @@
|
||||
// @push.rocks scope
|
||||
import * as smartfile from '@push.rocks/smartfile';
|
||||
import * as smartpath from '@push.rocks/smartpath'
|
||||
import * as smartpath from '@push.rocks/smartpath';
|
||||
|
||||
export {
|
||||
smartfile,
|
||||
smartpath,
|
||||
}
|
||||
};
|
||||
|
||||
// third party scope
|
||||
import * as webdav from 'webdav';
|
||||
|
||||
export {
|
||||
webdav,
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user