From 18f5a05c1da33cc20b19971566d16e215f1745d8 Mon Sep 17 00:00:00 2001 From: Philipp Kunz Date: Sat, 20 Apr 2024 21:41:30 +0200 Subject: [PATCH] fix(core): update --- ts/00_commitinfo_data.ts | 2 +- ts/classes.webdavclient.ts | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/ts/00_commitinfo_data.ts b/ts/00_commitinfo_data.ts index 1ebf656..5eb2e32 100644 --- a/ts/00_commitinfo_data.ts +++ b/ts/00_commitinfo_data.ts @@ -3,6 +3,6 @@ */ export const commitinfo = { 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.' } diff --git a/ts/classes.webdavclient.ts b/ts/classes.webdavclient.ts index 29966f9..420d76c 100644 --- a/ts/classes.webdavclient.ts +++ b/ts/classes.webdavclient.ts @@ -2,7 +2,7 @@ import * as plugins from './plugins.js'; export interface IWebdavClientOptions { serverUrl: string; - authType: plugins.webdav.AuthType; + authType?: plugins.webdav.AuthType; username?: string; password?: string; } @@ -11,7 +11,11 @@ export class WebdavClient { wdClient: plugins.webdav.WebDAVClient; constructor(optionsArg: IWebdavClientOptions) { this.wdClient = plugins.webdav.createClient(optionsArg.serverUrl, { - authType: optionsArg.authType, + ...optionsArg.authType ? { + authType: optionsArg.authType, + } : { + authType: plugins.webdav.AuthType.Password, + }, ...(optionsArg.username ? { username: optionsArg.username,