Skip to content

can't not fetchCalendarObjects from caldav.wecom.work #221

@quanru

Description

@quanru
import { createDAVClient } from 'tsdav';

(async () => {
  const client = await createDAVClient({
    serverUrl: 'https://caldav.wecom.work',
    credentials: {
      username: '[email protected]',
      password: 'FtBpSvuc69SYzgSB',
    },
    authMethod: 'Basic',
    defaultAccountType: 'caldav',
  });
  
  const calendars = await client.fetchCalendars();
  console.log('calendars: ', calendars);

  const calendar = calendars[0];

  const calendarObjects = await client.fetchCalendarObjects({
    calendar: calendar,
    expand: true,
  });

  console.log(JSON.stringify(calendarObjects, null, 2));
})().catch(error => {
  console.error('error:', error);
});

DEBUG=* node tsdav.mjs
Debugger attached.
  tsdav:authHelper Basic auth token generated: bGlueWliaW5nQGxpZmVvczEud2Vjb20ud29yazpGdEJwU3Z1YzY5U1l6Z1NC +0ms
  tsdav:account Service discovery... +0ms
  tsdav:account Service discovery redirected to https://caldav.wecom.work/calendar/ +587ms
  tsdav:account Fetching principal url from path https://caldav.wecom.work/calendar/ +1ms
  tsdav:account Fetched principal url /calendar/linyibing%40lifeos1.wecom.work +523ms
  tsdav:account Fetch home url from https://caldav.wecom.work/calendar/linyibing%40lifeos1.wecom.work +0ms
  tsdav:account Fetched home url https://caldav.wecom.work/calendar/ +480ms
calendars:  [
  {
    description: '[email protected]',
    timezone: 'BEGIN:VTIMEZONE\r\n' +
      'TZID:Asia/Shanghai\r\n' +
      'X-LIC-LOCATION:Asia/Shanghai\r\n' +
      'BEGIN:STANDARD\r\n' +
      'TZOFFSETFROM:+0800\r\n' +
      'TZOFFSETTO:+0800\r\n' +
      'TZNAME:CST\r\n' +
      'DTSTART:19700101T000000\r\n' +
      'END:STANDARD\r\n' +
      'END:VTIMEZONE',
    url: 'https://caldav.wecom.work/calendar/1688855375594291/',
    ctag: 1731112901,
    calendarColor: '#2d8eff',
    displayName: 'xxx',
    components: [ 'VEVENT' ],
    resourcetype: [ 'collection', 'calendar' ],
    syncToken: 'http://dav.exmail.qq.com/ns/sync-token/1731112901',
    projectedProps: {},
    reports: [ 'expandProperty', 'syncCollection' ]
  }
]
  tsdav:calendar Fetching calendar objects from https://caldav.wecom.work/calendar/1688855375594291/ +0ms
[
  {
    "url": "https://caldav.wecom.work/calendar/1688855375594291/",
    "etag": "[object Object]",
    "data": {}
  },
  {
    "url": "https://caldav.wecom.work/calendar/1688855375594291/f3a370bed921ec2bce27ca8111b25f15uprduwqs.ics",
    "etag": "1731113340",
    "data": {}
  }
]

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions