[mod] date formatting [mod] caldav resource integration
This commit is contained in:
parent
cde912392c
commit
c9b882edbe
7 changed files with 42 additions and 22 deletions
|
@ -33,6 +33,7 @@ namespace _zeitbild.api
|
||||||
data : {
|
data : {
|
||||||
url : string;
|
url : string;
|
||||||
read_only : boolean;
|
read_only : boolean;
|
||||||
|
from_fucked_up_wordpress : boolean;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
@ -79,6 +80,7 @@ namespace _zeitbild.api
|
||||||
"data": {
|
"data": {
|
||||||
"url": stuff.input.resource.data.url,
|
"url": stuff.input.resource.data.url,
|
||||||
"read_only": stuff.input.resource.data.read_only,
|
"read_only": stuff.input.resource.data.read_only,
|
||||||
|
"from_fucked_up_wordpress": stuff.input.resource.data.from_fucked_up_wordpress,
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -168,27 +168,31 @@ namespace _zeitbild.api
|
||||||
user_id
|
user_id
|
||||||
)
|
)
|
||||||
.then(
|
.then(
|
||||||
(data) => Promise.resolve({
|
(data) => Promise.resolve(
|
||||||
"status_code": 200,
|
{
|
||||||
"data": (
|
"status_code": 200,
|
||||||
data
|
"data": (
|
||||||
.map(
|
data
|
||||||
(entry) => ({
|
.map(
|
||||||
"calendar_id": entry.calendar_id,
|
(entry) => ({
|
||||||
"calendar_name": entry.calendar_name,
|
"calendar_id": entry.calendar_id,
|
||||||
"access_level": _zeitbild.api.access_level_encode(entry.access_level),
|
"calendar_name": entry.calendar_name,
|
||||||
"event_id": entry.event_id,
|
"access_level": _zeitbild.api.access_level_encode(entry.access_level),
|
||||||
"event_object": entry.event_object,
|
"event_id": entry.event_id,
|
||||||
})
|
"event_object": entry.event_object,
|
||||||
)
|
})
|
||||||
),
|
)
|
||||||
})
|
),
|
||||||
|
}
|
||||||
|
)
|
||||||
)
|
)
|
||||||
.catch(
|
.catch(
|
||||||
(reason) => Promise.resolve({
|
(reason) => Promise.resolve(
|
||||||
"status_code": 403,
|
{
|
||||||
"data": String(reason),
|
"status_code": 403,
|
||||||
})
|
"data": String(reason),
|
||||||
|
}
|
||||||
|
)
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,7 +5,7 @@ namespace _zeitbild.database
|
||||||
/**
|
/**
|
||||||
*/
|
*/
|
||||||
const _compatible_revisions : Array<string> = [
|
const _compatible_revisions : Array<string> = [
|
||||||
"r3",
|
"r4",
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -40,6 +40,7 @@ type type_data = {
|
||||||
data : {
|
data : {
|
||||||
url : string;
|
url : string;
|
||||||
read_only : boolean;
|
read_only : boolean;
|
||||||
|
from_fucked_up_wordpress ?: boolean;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
@ -109,6 +110,7 @@ async function data_init(
|
||||||
"data": {
|
"data": {
|
||||||
"url": calendar_raw.resource.data.url,
|
"url": calendar_raw.resource.data.url,
|
||||||
"read_only": calendar_raw.resource.data.read_only,
|
"read_only": calendar_raw.resource.data.read_only,
|
||||||
|
"from_fucked_up_wordpress": (calendar_raw.resource.data.from_fucked_up_wordpress ?? false),
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
resource_id = await _zeitbild.service.resource.add(
|
resource_id = await _zeitbild.service.resource.add(
|
||||||
|
|
|
@ -366,6 +366,7 @@ namespace _zeitbild.repository.resource
|
||||||
"data": {
|
"data": {
|
||||||
"url": dataset_extra_caldav["url"],
|
"url": dataset_extra_caldav["url"],
|
||||||
"read_only": dataset_extra_caldav["read_only"],
|
"read_only": dataset_extra_caldav["read_only"],
|
||||||
|
"from_fucked_up_wordpress": dataset_extra_caldav["from_fucked_up_wordpress"],
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
@ -409,6 +410,7 @@ namespace _zeitbild.repository.resource
|
||||||
{
|
{
|
||||||
"url": resource_object.data.url,
|
"url": resource_object.data.url,
|
||||||
"read_only": resource_object.data.read_only,
|
"read_only": resource_object.data.read_only,
|
||||||
|
"from_fucked_up_wordpress": resource_object.data.from_fucked_up_wordpress,
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
const resource_id : _zeitbild.type_resource_id = await get_resource_core_store().create(
|
const resource_id : _zeitbild.type_resource_id = await get_resource_core_store().create(
|
||||||
|
|
|
@ -348,11 +348,20 @@ namespace _zeitbild.service.calendar
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
const vcalendar : lib_plankton.ical.type_vcalendar = lib_plankton.ical.ics_decode(
|
const ics_raw : string = http_response.body.toString();
|
||||||
http_response.body.toString(),
|
const vcalendar_list : Array<lib_plankton.ical.type_vcalendar> = lib_plankton.ical.ics_decode_multi(
|
||||||
|
ics_raw,
|
||||||
{
|
{
|
||||||
|
"ignore_unhandled_instruction_keys": resource_object.data.from_fucked_up_wordpress,
|
||||||
|
"from_fucked_up_wordpress": resource_object.data.from_fucked_up_wordpress,
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
const vcalendar : lib_plankton.ical.type_vcalendar = {
|
||||||
|
// required
|
||||||
|
"version": vcalendar_list[0].version,
|
||||||
|
"prodid": vcalendar_list[0].prodid,
|
||||||
|
"vevents": vcalendar_list.map(x => x.vevents).reduce((x, y) => x.concat(y), []),
|
||||||
|
};
|
||||||
return Promise.resolve(
|
return Promise.resolve(
|
||||||
vcalendar.vevents
|
vcalendar.vevents
|
||||||
.map(
|
.map(
|
||||||
|
|
|
@ -86,6 +86,7 @@ namespace _zeitbild
|
||||||
data : {
|
data : {
|
||||||
url : string;
|
url : string;
|
||||||
read_only : boolean;
|
read_only : boolean;
|
||||||
|
from_fucked_up_wordpress : boolean;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
Loading…
Add table
Reference in a new issue