fix(core): update

This commit is contained in:
Philipp Kunz 2024-04-20 21:41:30 +02:00
parent 7db9e0208a
commit 18f5a05c1d
2 changed files with 7 additions and 3 deletions

View File

@ -3,6 +3,6 @@
*/ */
export const commitinfo = { export const commitinfo = {
name: '@push.rocks/smartwebdav', name: '@push.rocks/smartwebdav',
version: '1.0.3', version: '1.0.4',
description: 'A TypeScript library for easy interaction with WebDAV servers, including file and directory management.' description: 'A TypeScript library for easy interaction with WebDAV servers, including file and directory management.'
} }

View File

@ -2,7 +2,7 @@ import * as plugins from './plugins.js';
export interface IWebdavClientOptions { export interface IWebdavClientOptions {
serverUrl: string; serverUrl: string;
authType: plugins.webdav.AuthType; authType?: plugins.webdav.AuthType;
username?: string; username?: string;
password?: string; password?: string;
} }
@ -11,7 +11,11 @@ export class WebdavClient {
wdClient: plugins.webdav.WebDAVClient; wdClient: plugins.webdav.WebDAVClient;
constructor(optionsArg: IWebdavClientOptions) { constructor(optionsArg: IWebdavClientOptions) {
this.wdClient = plugins.webdav.createClient(optionsArg.serverUrl, { this.wdClient = plugins.webdav.createClient(optionsArg.serverUrl, {
authType: optionsArg.authType, ...optionsArg.authType ? {
authType: optionsArg.authType,
} : {
authType: plugins.webdav.AuthType.Password,
},
...(optionsArg.username ...(optionsArg.username
? { ? {
username: optionsArg.username, username: optionsArg.username,