natelindev / tsdav

WebDAV, CALDAV, and CARDDAV client for Nodejs and the Browser
https://tsdav.vercel.app
MIT License
239 stars 39 forks source link

can't not fetchCalendarObjects from calendar.dingtalk.com #222

Open quanru opened 1 week ago

quanru commented 1 week ago
  const client = await createDAVClient({
    serverUrl: 'https://calendar.dingtalk.com',
    credentials: {
      username: 'u_vpsuz2c6',
      password: 'uvdgcwqn',
    },
    authMethod: 'Basic',
    defaultAccountType: 'caldav',
  });
  const calendars = await client.fetchCalendars();

  console.log('calendars: ', calendars);
  const calendarObjects = await client.fetchCalendarObjects({
    calendar: calendars[0],
    useMultiGet: true,
    expand: true,
  });
  console.log('calendarObjects: ', calendarObjects);
temp DEBUG=* node caldav.mjs
  tsdav:authHelper Basic auth token generated: dV92cHN1ejJjNjp1dmRnY3dxbg== +0ms
  tsdav:account Service discovery... +0ms
  tsdav:account Service discovery redirected to https://calendar.dingtalk.com/dav/principals/ +218ms
  tsdav:account Fetching principal url from path https://calendar.dingtalk.com/dav/principals/ +0ms
  tsdav:account Fetched principal url /dav/users/u_vpsuz2c6 +158ms
  tsdav:account Fetch home url from https://calendar.dingtalk.com/dav/users/u_vpsuz2c6 +1ms
  tsdav:account Fetched home url https://calendar.dingtalk.com/dav/u_vpsuz2c6 +127ms
calendars:  [
  {
    description: '',
    timezone: '',
    url: 'https://calendar.dingtalk.com/dav/u_vpsuz2c6/primary/',
    ctag: 1731380020279,
    calendarColor: { _attributes: [Object] },
    displayName: '我的日历(钉钉)',
    components: [ 'VEVENT', 'VAVAILABILITY', 'VFREEBUSY', 'VJOURNAL', 'VTODO' ],
    resourcetype: [ 'calendar', 'collection' ],
    syncToken: 'https://calendar.dingtalk.com/dav/sync-tokens/_empty_1731550565135',
    projectedProps: {},
    reports: [
      'principalPropertySearch',
      'freeBusyQuery',
      'calendarQuery',
      'principalMatch',
      'calendarMultiget',
      'syncCollection'
    ]
  }
]
  tsdav:calendar Fetching calendar objects from https://calendar.dingtalk.com/dav/u_vpsuz2c6/primary/ +0ms
calendarObjects:  []
➜  temp DEBUG=* node caldav.mjs
  tsdav:authHelper Basic auth token generated: dV92cHN1ejJjNjp1dmRnY3dxbg== +0ms
  tsdav:account Service discovery... +0ms
  tsdav:account Service discovery redirected to https://calendar.dingtalk.com/dav/principals/ +151ms
  tsdav:account Fetching principal url from path https://calendar.dingtalk.com/dav/principals/ +0ms
  tsdav:account Fetched principal url /dav/users/u_vpsuz2c6 +131ms
  tsdav:account Fetch home url from https://calendar.dingtalk.com/dav/users/u_vpsuz2c6 +0ms
  tsdav:account Fetched home url https://calendar.dingtalk.com/dav/u_vpsuz2c6 +162ms
calendars:  [
  {
    description: '',
    timezone: '',
    url: 'https://calendar.dingtalk.com/dav/u_vpsuz2c6/primary/',
    ctag: 1731380020279,
    calendarColor: { _attributes: [Object] },
    displayName: '我的日历(钉钉)',
    components: [ 'VEVENT', 'VAVAILABILITY', 'VFREEBUSY', 'VJOURNAL', 'VTODO' ],
    resourcetype: [ 'calendar', 'collection' ],
    syncToken: 'https://calendar.dingtalk.com/dav/sync-tokens/_empty_1731550675922',
    projectedProps: {},
    reports: [
      'principalPropertySearch',
      'freeBusyQuery',
      'syncCollection',
      'calendarQuery',
      'calendarMultiget',
      'principalMatch'
    ]
  }
]
  tsdav:calendar Fetching calendar objects from https://calendar.dingtalk.com/dav/u_vpsuz2c6/primary/ +0ms
calendarObjects:  []
quanru commented 4 days ago

Related #221