101 lines
2.1 KiB
TypeScript
101 lines
2.1 KiB
TypeScript
![]() |
|
||
|
namespace _zeitbild.api
|
||
|
{
|
||
|
|
||
|
/**
|
||
|
*/
|
||
|
export function register_caldav_probe(
|
||
|
rest_subject : lib_plankton.rest_caldav.type_rest
|
||
|
) : void
|
||
|
{
|
||
|
register<
|
||
|
any,
|
||
|
any
|
||
|
>(
|
||
|
rest_subject,
|
||
|
lib_plankton.caldav.enum_method.propfind,
|
||
|
"/caldav",
|
||
|
{
|
||
|
"query_parameters": () => ([
|
||
|
{
|
||
|
"name": "from",
|
||
|
"required": false,
|
||
|
"description": "UNIX timestamp",
|
||
|
},
|
||
|
{
|
||
|
"name": "to",
|
||
|
"required": false,
|
||
|
"description": "UNIX timestamp",
|
||
|
},
|
||
|
{
|
||
|
"name": "calendar_ids",
|
||
|
"required": false,
|
||
|
"description": "comma separated",
|
||
|
},
|
||
|
{
|
||
|
"name": "auth",
|
||
|
"required": true,
|
||
|
"description": "",
|
||
|
},
|
||
|
]),
|
||
|
"output_schema": () => ({
|
||
|
"nullable": false,
|
||
|
"type": "string",
|
||
|
}),
|
||
|
"response_body_mimetype": "application/xml",
|
||
|
"response_body_encode": output => Buffer.from(output),
|
||
|
"restriction": restriction_none,
|
||
|
/**
|
||
|
* @todo examine body
|
||
|
*/
|
||
|
"execution": async (stuff) => {
|
||
|
return Promise.resolve(
|
||
|
{
|
||
|
"status_code": 207,
|
||
|
"data": (
|
||
|
/*"<?xml version=\"1.0\" encoding=\"utf-8\" ?>\n"
|
||
|
+*/
|
||
|
lib_plankton.webdav.data_multistatus_encode(
|
||
|
{
|
||
|
"responses": [
|
||
|
{
|
||
|
"href": "/caldav/events",
|
||
|
"body": {
|
||
|
"propstats": [
|
||
|
{
|
||
|
"prop": [
|
||
|
{"name": "d:displayname", "value": "default"},
|
||
|
// {"name": "cs:getctag", "value": "47"}, // TODO correct value
|
||
|
// {"name": "current-user-privilege-set", "value": ""},
|
||
|
/*
|
||
|
"uid",
|
||
|
"dtstamp",
|
||
|
"dtstart",
|
||
|
"dtend",
|
||
|
"summary",
|
||
|
"description",
|
||
|
"url",
|
||
|
"location",
|
||
|
*/
|
||
|
],
|
||
|
"status": "HTTP/2.0 200 OK",
|
||
|
"description": null,
|
||
|
},
|
||
|
]
|
||
|
},
|
||
|
"description": null,
|
||
|
}
|
||
|
],
|
||
|
"description": null,
|
||
|
}
|
||
|
)
|
||
|
),
|
||
|
}
|
||
|
);
|
||
|
}
|
||
|
}
|
||
|
);
|
||
|
}
|
||
|
|
||
|
}
|