UNPKG

n8n-nodes-nextcloud-calendar

Version:

n8n Node für die Integration mit Nextcloud Calendar

35 lines 1.45 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.initClient = initClient; const tsdav_1 = require("tsdav"); async function initClient(context) { const credentials = await context.getCredentials('nextcloudCalendarApi'); let serverUrl = credentials.serverUrl; if (!serverUrl.endsWith('/remote.php/dav')) { serverUrl = serverUrl.replace(/\/?$/, '/remote.php/dav'); } console.log(`Initialisiere CalDAV Client für: ${serverUrl}`); console.log(`Benutzername: ${credentials.username}`); console.log(`Passwort gesetzt: ${credentials.password ? 'Ja' : 'Nein'}`); console.log(`Passwort-Länge: ${credentials.password ? credentials.password.length : 0}`); const client = new tsdav_1.DAVClient({ serverUrl, credentials: { username: credentials.username, password: credentials.password, }, defaultAccountType: 'caldav', authMethod: 'Basic', }); try { console.log('Versuche CalDAV Login...'); await client.login(); console.log('CalDAV Login erfolgreich'); return client; } catch (error) { console.error('CalDAV Login fehlgeschlagen:', error); throw new Error(`CalDAV Authentifizierung fehlgeschlagen: ${error.message}. Bitte überprüfen Sie Ihre Credentials und verwenden Sie ein App-Passwort falls erforderlich.`); } } //# sourceMappingURL=client.js.map