Compare commits
5 commits
9d1fd0b55f
...
54e27f2ad9
Author | SHA1 | Date | |
---|---|---|---|
![]() |
54e27f2ad9 | ||
![]() |
b5b5dde9e3 | ||
![]() |
5de4728901 | ||
![]() |
c9b882edbe | ||
![]() |
cde912392c |
17 changed files with 3172 additions and 2305 deletions
|
@ -4,7 +4,8 @@
|
||||||
{
|
{
|
||||||
"kind": "stdout",
|
"kind": "stdout",
|
||||||
"data": {
|
"data": {
|
||||||
"threshold": "info"
|
"threshold": "info",
|
||||||
|
"format": "human_readable"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
|
1102
lib/plankton/plankton.d.ts
vendored
1102
lib/plankton/plankton.d.ts
vendored
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
|
@ -9,8 +9,8 @@ namespace _zeitbild.api
|
||||||
) : void
|
) : void
|
||||||
{
|
{
|
||||||
register<
|
register<
|
||||||
any,
|
null,
|
||||||
any
|
string
|
||||||
>(
|
>(
|
||||||
rest_subject,
|
rest_subject,
|
||||||
lib_plankton.caldav.enum_method.propfind,
|
lib_plankton.caldav.enum_method.propfind,
|
||||||
|
@ -42,46 +42,70 @@ namespace _zeitbild.api
|
||||||
"nullable": false,
|
"nullable": false,
|
||||||
"type": "string",
|
"type": "string",
|
||||||
}),
|
}),
|
||||||
"response_body_mimetype": "application/xml",
|
"response_body_mimetype": "text/xml; charset=utf-8",
|
||||||
"response_body_encode": output => Buffer.from(output),
|
"response_body_encode": output => Buffer.from(output),
|
||||||
|
// "restriction": restriction_basic_auth,
|
||||||
"restriction": restriction_none,
|
"restriction": restriction_none,
|
||||||
/**
|
/**
|
||||||
* @todo examine body
|
* @todo examine body
|
||||||
*/
|
*/
|
||||||
"execution": async (stuff) => {
|
"execution": async (stuff) => {
|
||||||
|
const user_id : (null | type_user_id) = await _zeitbild.api.web_auth(
|
||||||
|
stuff.headers["Authorization"]
|
||||||
|
??
|
||||||
|
stuff.headers["authorization"]
|
||||||
|
??
|
||||||
|
null
|
||||||
|
);
|
||||||
|
if (user_id === null) {
|
||||||
return Promise.resolve(
|
return Promise.resolve(
|
||||||
{
|
{
|
||||||
|
"status_code": 401,
|
||||||
|
"data": "",
|
||||||
|
"extra_headers": {
|
||||||
|
"WWW-Authenticate": "Basic realm=Restricted",
|
||||||
|
}
|
||||||
|
}
|
||||||
|
);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
return (
|
||||||
|
_zeitbild.service.calendar.overview(user_id)
|
||||||
|
.then(
|
||||||
|
(data_raw) => Promise.resolve(
|
||||||
|
data_raw
|
||||||
|
.map(
|
||||||
|
(entry) => ({
|
||||||
|
"id": entry.id,
|
||||||
|
"name": entry.name,
|
||||||
|
"access_level": _zeitbild.value_object.access_level.to_string(entry.access_level),
|
||||||
|
})
|
||||||
|
)
|
||||||
|
)
|
||||||
|
)
|
||||||
|
.then(
|
||||||
|
(data) => Promise.resolve({
|
||||||
"status_code": 207,
|
"status_code": 207,
|
||||||
"data": (
|
"data": (
|
||||||
/*"<?xml version=\"1.0\" encoding=\"utf-8\" ?>\n"
|
"<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"
|
||||||
+*/
|
+
|
||||||
lib_plankton.webdav.data_multistatus_encode(
|
lib_plankton.webdav.data_multistatus_encode(
|
||||||
{
|
{
|
||||||
"responses": [
|
"responses": [
|
||||||
{
|
{
|
||||||
"href": "/caldav/events",
|
"href": "/caldav/events",
|
||||||
"body": {
|
"body": {
|
||||||
"propstats": [
|
"propstats": data.map(
|
||||||
{
|
(entry) => ({
|
||||||
"prop": [
|
"prop": [
|
||||||
{"name": "d:displayname", "value": "default"},
|
{"name": "displayname", "value": entry.name},
|
||||||
// {"name": "cs:getctag", "value": "47"}, // TODO correct value
|
// {"name": "cs:getctag", "value": "47"}, // TODO correct value
|
||||||
// {"name": "current-user-privilege-set", "value": ""},
|
// {"name": "current-user-privilege-set", "value": ""},
|
||||||
/*
|
|
||||||
"uid",
|
|
||||||
"dtstamp",
|
|
||||||
"dtstart",
|
|
||||||
"dtend",
|
|
||||||
"summary",
|
|
||||||
"description",
|
|
||||||
"url",
|
|
||||||
"location",
|
|
||||||
*/
|
|
||||||
],
|
],
|
||||||
"status": "HTTP/2.0 200 OK",
|
"status": "HTTP/2.0 200 OK",
|
||||||
"description": null,
|
"description": entry.access_level,
|
||||||
},
|
})
|
||||||
]
|
),
|
||||||
},
|
},
|
||||||
"description": null,
|
"description": null,
|
||||||
}
|
}
|
||||||
|
@ -90,10 +114,12 @@ namespace _zeitbild.api
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
),
|
),
|
||||||
}
|
})
|
||||||
|
)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
46
source/api/actions/caldav_sniff.ts
Normal file
46
source/api/actions/caldav_sniff.ts
Normal file
|
@ -0,0 +1,46 @@
|
||||||
|
|
||||||
|
namespace _zeitbild.api
|
||||||
|
{
|
||||||
|
|
||||||
|
/**
|
||||||
|
*/
|
||||||
|
export function register_caldav_sniff(
|
||||||
|
rest_subject : lib_plankton.rest_caldav.type_rest
|
||||||
|
) : void
|
||||||
|
{
|
||||||
|
register<
|
||||||
|
any,
|
||||||
|
null
|
||||||
|
>(
|
||||||
|
rest_subject,
|
||||||
|
lib_plankton.caldav.enum_method.options,
|
||||||
|
"/caldav",
|
||||||
|
{
|
||||||
|
"restriction": restriction_none,
|
||||||
|
"execution": async (stuff) => {
|
||||||
|
const permitted : boolean = await restriction_basic_auth(stuff);
|
||||||
|
if (! permitted) {
|
||||||
|
return Promise.resolve(
|
||||||
|
{
|
||||||
|
"status_code": 401,
|
||||||
|
"data": null,
|
||||||
|
"extra_headers": {
|
||||||
|
"WWW-Authenticate": "Basic realm=Restricted",
|
||||||
|
}
|
||||||
|
}
|
||||||
|
);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
return Promise.resolve(
|
||||||
|
{
|
||||||
|
"status_code": 200,
|
||||||
|
"data": null
|
||||||
|
}
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -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;
|
||||||
|
|
|
@ -160,7 +160,8 @@ namespace _zeitbild.api
|
||||||
user_id
|
user_id
|
||||||
)
|
)
|
||||||
.then(
|
.then(
|
||||||
(data) => Promise.resolve({
|
(data) => Promise.resolve(
|
||||||
|
{
|
||||||
"status_code": 200,
|
"status_code": 200,
|
||||||
"data": (
|
"data": (
|
||||||
data
|
data
|
||||||
|
@ -174,13 +175,16 @@ namespace _zeitbild.api
|
||||||
})
|
})
|
||||||
)
|
)
|
||||||
),
|
),
|
||||||
})
|
}
|
||||||
|
)
|
||||||
)
|
)
|
||||||
.catch(
|
.catch(
|
||||||
(reason) => Promise.resolve({
|
(reason) => Promise.resolve(
|
||||||
|
{
|
||||||
"status_code": 403,
|
"status_code": 403,
|
||||||
"data": String(reason),
|
"data": String(reason),
|
||||||
})
|
}
|
||||||
|
)
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
@ -25,6 +25,77 @@ namespace _zeitbild.api
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @todo outsource?
|
||||||
|
*/
|
||||||
|
export async function web_auth(
|
||||||
|
authorization_string : (null | string)
|
||||||
|
) : Promise<(null | _zeitbild.type_user_id)>
|
||||||
|
{
|
||||||
|
if (authorization_string === null) {
|
||||||
|
return Promise.resolve<(null | _zeitbild.type_user_id)>(null);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
const parts : Array<string> = authorization_string.split(" ");
|
||||||
|
const strategy : string = parts[0];
|
||||||
|
const data_raw : string = parts.slice(1).join(" ");
|
||||||
|
switch (strategy) {
|
||||||
|
default: {
|
||||||
|
lib_plankton.log.notice(
|
||||||
|
"zeitbild.web_auth.unhandled_strategy",
|
||||||
|
{
|
||||||
|
"strategy": strategy,
|
||||||
|
}
|
||||||
|
);
|
||||||
|
return Promise.resolve<(null | _zeitbild.type_user_id)>(null);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case "Basic": {
|
||||||
|
const data_raw_decoded : string = lib_plankton.base64.decode(data_raw);
|
||||||
|
const parts_ : Array<string> = data_raw_decoded.split(":");
|
||||||
|
const username : string = parts_[0];
|
||||||
|
const password_is : string = parts_.slice(1).join(":");
|
||||||
|
const {"value": user_id, "error": error} = await lib_plankton.call.try_catch_wrap_async<_zeitbild.type_user_id>(
|
||||||
|
() => _zeitbild.service.user.identify(username)
|
||||||
|
);
|
||||||
|
if (error !== null) {
|
||||||
|
lib_plankton.log.notice(
|
||||||
|
"zeitbild.web_auth.unknown_user",
|
||||||
|
{
|
||||||
|
"username": username,
|
||||||
|
}
|
||||||
|
);
|
||||||
|
return Promise.resolve<(null | _zeitbild.type_user_id)>(null);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
const password_shall : string = lib_plankton.sha256.get(
|
||||||
|
username,
|
||||||
|
_zeitbild.conf.get()["misc"]["auth_salt"]
|
||||||
|
);
|
||||||
|
if (! (password_is === password_shall)) {
|
||||||
|
/**
|
||||||
|
* @todo remove
|
||||||
|
*/
|
||||||
|
lib_plankton.log.notice(
|
||||||
|
"zeitbild.web_auth.wrong_pasword",
|
||||||
|
{
|
||||||
|
"shall": password_shall,
|
||||||
|
"is": password_is,
|
||||||
|
}
|
||||||
|
);
|
||||||
|
return Promise.resolve<(null | _zeitbild.type_user_id)>(null);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
return Promise.resolve<(null | _zeitbild.type_user_id)>(user_id);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*/
|
*/
|
||||||
export const restriction_logged_in : lib_plankton.rest_caldav.type_restriction<any> = (
|
export const restriction_logged_in : lib_plankton.rest_caldav.type_restriction<any> = (
|
||||||
|
@ -36,6 +107,26 @@ namespace _zeitbild.api
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
*/
|
||||||
|
export const restriction_basic_auth : lib_plankton.rest_caldav.type_restriction<any> = (
|
||||||
|
(stuff) => (
|
||||||
|
web_auth(
|
||||||
|
stuff.headers["Authorization"]
|
||||||
|
??
|
||||||
|
stuff.headers["authorization"]
|
||||||
|
??
|
||||||
|
null
|
||||||
|
)
|
||||||
|
.then<boolean>(
|
||||||
|
(user_id) => Promise.resolve<boolean>(
|
||||||
|
(user_id !== null)
|
||||||
|
)
|
||||||
|
)
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*/
|
*/
|
||||||
export const restriction_none : lib_plankton.rest_caldav.type_restriction<any> = (
|
export const restriction_none : lib_plankton.rest_caldav.type_restriction<any> = (
|
||||||
|
|
|
@ -52,6 +52,7 @@ namespace _zeitbild.api
|
||||||
}
|
}
|
||||||
// caldav
|
// caldav
|
||||||
{
|
{
|
||||||
|
_zeitbild.api.register_caldav_sniff(rest_subject);
|
||||||
_zeitbild.api.register_caldav_probe(rest_subject);
|
_zeitbild.api.register_caldav_probe(rest_subject);
|
||||||
_zeitbild.api.register_caldav_get(rest_subject);
|
_zeitbild.api.register_caldav_get(rest_subject);
|
||||||
}
|
}
|
||||||
|
|
|
@ -41,7 +41,17 @@ namespace _zeitbild.conf
|
||||||
"error"
|
"error"
|
||||||
],
|
],
|
||||||
"default": "info"
|
"default": "info"
|
||||||
}
|
},
|
||||||
|
"format": {
|
||||||
|
"nullable": false,
|
||||||
|
"type": "string",
|
||||||
|
"enum": [
|
||||||
|
"human_readable",
|
||||||
|
"jsonl",
|
||||||
|
"jsonl_structured",
|
||||||
|
],
|
||||||
|
"default": "human_readable",
|
||||||
|
},
|
||||||
},
|
},
|
||||||
"required": [
|
"required": [
|
||||||
]
|
]
|
||||||
|
|
|
@ -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(
|
||||||
|
@ -157,11 +159,17 @@ async function main(
|
||||||
) : Promise<void>
|
) : Promise<void>
|
||||||
{
|
{
|
||||||
// init1
|
// init1
|
||||||
lib_plankton.log.conf_push(
|
/*
|
||||||
|
lib_plankton.log.set_main_logger(
|
||||||
[
|
[
|
||||||
lib_plankton.log.channel_make({"kind": "stdout", "data": {"threshold": "info"}}),
|
{
|
||||||
|
"kind": "std",
|
||||||
|
"data": {
|
||||||
|
}
|
||||||
|
}
|
||||||
]
|
]
|
||||||
);
|
);
|
||||||
|
*/
|
||||||
|
|
||||||
// args
|
// args
|
||||||
const arg_handler : lib_plankton.args.class_handler = new lib_plankton.args.class_handler({
|
const arg_handler : lib_plankton.args.class_handler = new lib_plankton.args.class_handler({
|
||||||
|
@ -244,20 +252,65 @@ async function main(
|
||||||
"name": "help",
|
"name": "help",
|
||||||
}),
|
}),
|
||||||
});
|
});
|
||||||
const args : Record<string, any> = arg_handler.read(lib_plankton.args.enum_environment.cli, args_raw.join(" "));
|
const args : Record<string, any> = arg_handler.read(
|
||||||
|
lib_plankton.args.enum_environment.cli,
|
||||||
|
args_raw.join(" ")
|
||||||
|
);
|
||||||
|
|
||||||
// init2
|
// init2
|
||||||
await _zeitbild.conf.init(
|
await _zeitbild.conf.init(
|
||||||
args["conf_path"]
|
args["conf_path"]
|
||||||
);
|
);
|
||||||
lib_plankton.log.conf_push(
|
lib_plankton.log.set_main_logger(
|
||||||
_zeitbild.conf.get().log.map(
|
_zeitbild.conf.get().log.map(
|
||||||
(log_output : any) => lib_plankton.log.channel_make(
|
(log_output : any) => {
|
||||||
|
switch (log_output.kind) {
|
||||||
|
case "stdout": {
|
||||||
|
return {
|
||||||
|
"kind": "minlevel",
|
||||||
|
"data": {
|
||||||
|
"core": {
|
||||||
|
"kind": "std",
|
||||||
|
"data": {
|
||||||
|
"target": "stdout",
|
||||||
|
"format": lib_plankton.call.distinguish(
|
||||||
{
|
{
|
||||||
"kind": log_output.kind,
|
"kind": log_output.data.format,
|
||||||
"data": log_output.data
|
"data": null,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"jsonl": () => ({
|
||||||
|
"kind": "jsonl",
|
||||||
|
"data": {
|
||||||
|
"structured": false,
|
||||||
|
}
|
||||||
|
}),
|
||||||
|
"jsonl_structured": () => ({
|
||||||
|
"kind": "jsonl",
|
||||||
|
"data": {
|
||||||
|
"structured": true,
|
||||||
|
}
|
||||||
|
}),
|
||||||
|
"human_readable": () => ({
|
||||||
|
"kind": "human_readable",
|
||||||
|
"data": {
|
||||||
|
}
|
||||||
|
}),
|
||||||
|
}
|
||||||
|
),
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"threshold": log_output.data.threshold,
|
||||||
|
}
|
||||||
|
};
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
default: {
|
||||||
|
throw (new Error("unhandled"));
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
)
|
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
_zeitbild.cache = lib_plankton.cache.chest.implementation<any>(
|
_zeitbild.cache = lib_plankton.cache.chest.implementation<any>(
|
||||||
|
@ -319,9 +372,8 @@ async function main(
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case "api-doc": {
|
case "api-doc": {
|
||||||
lib_plankton.log.conf_push([]);
|
lib_plankton.log.set_main_logger([]);
|
||||||
const rest_subject : lib_plankton.rest_caldav.type_rest = _zeitbild.api.make();
|
const rest_subject : lib_plankton.rest_caldav.type_rest = _zeitbild.api.make();
|
||||||
lib_plankton.log.conf_pop();
|
|
||||||
process.stdout.write(
|
process.stdout.write(
|
||||||
JSON.stringify(
|
JSON.stringify(
|
||||||
lib_plankton.rest_caldav.to_oas(rest_subject),
|
lib_plankton.rest_caldav.to_oas(rest_subject),
|
||||||
|
@ -387,6 +439,7 @@ async function main(
|
||||||
"checklevel_restriction": lib_plankton.api.enum_checklevel.hard,
|
"checklevel_restriction": lib_plankton.api.enum_checklevel.hard,
|
||||||
// "checklevel_input": lib_plankton.api.enum_checklevel.soft,
|
// "checklevel_input": lib_plankton.api.enum_checklevel.soft,
|
||||||
// "checklevel_output": lib_plankton.api.enum_checklevel.soft,
|
// "checklevel_output": lib_plankton.api.enum_checklevel.soft,
|
||||||
|
"set_content_length": false,
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
const output : string = lib_plankton.caldav.encode_response(http_response);
|
const output : string = lib_plankton.caldav.encode_response(http_response);
|
||||||
|
@ -416,6 +469,7 @@ async function main(
|
||||||
)
|
)
|
||||||
.catch(
|
.catch(
|
||||||
(error) => {
|
(error) => {
|
||||||
|
// console.error(error);
|
||||||
process.stderr.write(String(error) + "\n");
|
process.stderr.write(String(error) + "\n");
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
|
@ -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,26 @@ 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 === null)
|
||||||
|
?
|
||||||
|
""
|
||||||
|
:
|
||||||
|
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;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
|
@ -76,6 +76,7 @@ ${dir_temp}/zeitbild-unlinked.js: \
|
||||||
${dir_source}/api/actions/calendar_event_remove.ts \
|
${dir_source}/api/actions/calendar_event_remove.ts \
|
||||||
${dir_source}/api/actions/events.ts \
|
${dir_source}/api/actions/events.ts \
|
||||||
${dir_source}/api/actions/export_ical.ts \
|
${dir_source}/api/actions/export_ical.ts \
|
||||||
|
${dir_source}/api/actions/caldav_sniff.ts \
|
||||||
${dir_source}/api/actions/caldav_probe.ts \
|
${dir_source}/api/actions/caldav_probe.ts \
|
||||||
${dir_source}/api/actions/caldav_get.ts \
|
${dir_source}/api/actions/caldav_get.ts \
|
||||||
${dir_source}/api/functions.ts \
|
${dir_source}/api/functions.ts \
|
||||||
|
|
|
@ -24,9 +24,8 @@ modules="${modules} http"
|
||||||
modules="${modules} webdav"
|
modules="${modules} webdav"
|
||||||
modules="${modules} caldav"
|
modules="${modules} caldav"
|
||||||
modules="${modules} api"
|
modules="${modules} api"
|
||||||
modules="${modules} rest"
|
# modules="${modules} rest_http"
|
||||||
modules="${modules} rest_http"
|
# modules="${modules} rest_webdav"
|
||||||
modules="${modules} rest_webdav"
|
|
||||||
modules="${modules} rest_caldav"
|
modules="${modules} rest_caldav"
|
||||||
modules="${modules} server"
|
modules="${modules} server"
|
||||||
modules="${modules} args"
|
modules="${modules} args"
|
||||||
|
|
Loading…
Add table
Reference in a new issue