syncCollection
syncCollection
One way to synchronize data between two entities is to use some form of synchronization token
const result = await syncCollection({
url: 'https://caldav.icloud.com/12345676/calendars/c623f6be-a2d4-4c60-932a-043e67025dde/',
props: {
[`${DAVNamespaceShort.DAV}:getetag`]: {},
[`${DAVNamespaceShort.CALDAV}:calendar-data`]: {},
[`${DAVNamespaceShort.DAV}:displayname`]: {},
},
syncLevel: 1,
syncToken: 'bb399205ff6ff07',
headers: {
authorization: 'Basic x0C9ueWd9Vz8OwS0DEAtkAlj',
},
});
Arguments
url
required, target collection urlprops
required, ElementCompactsyncLevel
Indicates the "scope" of the synchronization report requestsyncToken
The synchronization token provided by the server and returned by the clientheaders
request headersheadersToExclude
array of keys of the headers you want to excludefetchOptions
options to pass to underlying fetch function
Return Value
array of DAVResponse
Behavior
send sync-collection REPORT to target collection url, parse response xml into array of DAVResponse