diff --git a/source/api/actions/calendar_add.ts b/source/api/actions/calendar_add.ts index cee2aa9..f54fc76 100644 --- a/source/api/actions/calendar_add.ts +++ b/source/api/actions/calendar_add.ts @@ -5,7 +5,7 @@ namespace _zeitbild.api /** */ export function register_calendar_add( - rest_subject : lib_plankton.rest.type_rest + rest_subject : lib_plankton.rest_http.type_rest ) : void { register< @@ -64,7 +64,8 @@ namespace _zeitbild.api else { // TODO move logic to calendar service let resource_object : _zeitbild.type_resource_object; - switch (stuff.input.resource.kind) { + switch (stuff.input.resource.kind) + { case "local": { resource_object = { "kind": "local", diff --git a/source/api/actions/calendar_change.ts b/source/api/actions/calendar_change.ts index 07a32d8..9ba5733 100644 --- a/source/api/actions/calendar_change.ts +++ b/source/api/actions/calendar_change.ts @@ -5,7 +5,7 @@ namespace _zeitbild.api /** */ export function register_calendar_change( - rest_subject : lib_plankton.rest.type_rest + rest_subject : lib_plankton.rest_http.type_rest ) : void { register< diff --git a/source/api/actions/calendar_event_add.ts b/source/api/actions/calendar_event_add.ts index df4c00e..0dfd8a1 100644 --- a/source/api/actions/calendar_event_add.ts +++ b/source/api/actions/calendar_event_add.ts @@ -5,7 +5,7 @@ namespace _zeitbild.api /** */ export function register_calendar_event_add( - rest_subject : lib_plankton.rest.type_rest + rest_subject : lib_plankton.rest_http.type_rest ) : void { register< diff --git a/source/api/actions/calendar_event_change.ts b/source/api/actions/calendar_event_change.ts index 42ec2d3..9e78895 100644 --- a/source/api/actions/calendar_event_change.ts +++ b/source/api/actions/calendar_event_change.ts @@ -5,7 +5,7 @@ namespace _zeitbild.api /** */ export function register_calendar_event_change( - rest_subject : lib_plankton.rest.type_rest + rest_subject : lib_plankton.rest_http.type_rest ) : void { register< diff --git a/source/api/actions/calendar_event_get.ts b/source/api/actions/calendar_event_get.ts index 34427a7..cd6f352 100644 --- a/source/api/actions/calendar_event_get.ts +++ b/source/api/actions/calendar_event_get.ts @@ -5,7 +5,7 @@ namespace _zeitbild.api /** */ export function register_calendar_event_get( - rest_subject : lib_plankton.rest.type_rest + rest_subject : lib_plankton.rest_http.type_rest ) : void { register< diff --git a/source/api/actions/calendar_event_remove.ts b/source/api/actions/calendar_event_remove.ts index cd83b3a..f5271cc 100644 --- a/source/api/actions/calendar_event_remove.ts +++ b/source/api/actions/calendar_event_remove.ts @@ -5,7 +5,7 @@ namespace _zeitbild.api /** */ export function register_calendar_event_remove( - rest_subject : lib_plankton.rest.type_rest + rest_subject : lib_plankton.rest_http.type_rest ) : void { register< diff --git a/source/api/actions/calendar_get.ts b/source/api/actions/calendar_get.ts index cdb4b0d..f22d098 100644 --- a/source/api/actions/calendar_get.ts +++ b/source/api/actions/calendar_get.ts @@ -5,7 +5,7 @@ namespace _zeitbild.api /** */ export function register_calendar_get( - rest_subject : lib_plankton.rest.type_rest + rest_subject : lib_plankton.rest_http.type_rest ) : void { register< diff --git a/source/api/actions/calendar_list.ts b/source/api/actions/calendar_list.ts index 5c345dd..a00596b 100644 --- a/source/api/actions/calendar_list.ts +++ b/source/api/actions/calendar_list.ts @@ -5,7 +5,7 @@ namespace _zeitbild.api /** */ export function register_calendar_list( - rest_subject : lib_plankton.rest.type_rest + rest_subject : lib_plankton.rest_http.type_rest ) : void { register< diff --git a/source/api/actions/calendar_remove.ts b/source/api/actions/calendar_remove.ts index 693afc4..10c3066 100644 --- a/source/api/actions/calendar_remove.ts +++ b/source/api/actions/calendar_remove.ts @@ -5,7 +5,7 @@ namespace _zeitbild.api /** */ export function register_calendar_remove( - rest_subject : lib_plankton.rest.type_rest + rest_subject : lib_plankton.rest_http.type_rest ) : void { register< diff --git a/source/api/actions/events.ts b/source/api/actions/events.ts index 2032f75..cf59c3e 100644 --- a/source/api/actions/events.ts +++ b/source/api/actions/events.ts @@ -5,7 +5,7 @@ namespace _zeitbild.api /** */ export function register_events( - rest_subject : lib_plankton.rest.type_rest + rest_subject : lib_plankton.rest_http.type_rest ) : void { register< diff --git a/source/api/actions/meta_ping.ts b/source/api/actions/meta_ping.ts index bfe01f1..7fee0d3 100644 --- a/source/api/actions/meta_ping.ts +++ b/source/api/actions/meta_ping.ts @@ -5,10 +5,10 @@ namespace _zeitbild.api /** */ export function register_meta_ping( - rest_subject : lib_plankton.rest.type_rest + rest_subject : lib_plankton.rest_http.type_rest ) : void { - lib_plankton.rest.register< + lib_plankton.rest_http.register< null, string > @@ -17,7 +17,7 @@ namespace _zeitbild.api lib_plankton.http.enum_method.get, _zeitbild.conf.get().server.path_base + "/meta/ping", { - "description": "sendet ein 'pong' zurück; gedacht um die Erreichbarkeit des Backends zu prüfen", + "description": () => "sendet ein 'pong' zurück; gedacht um die Erreichbarkeit des Backends zu prüfen", "input_schema": () => ({ "nullable": true, }), @@ -25,8 +25,10 @@ namespace _zeitbild.api "nullable": false, "type": "string", }), - "restriction": restriction_none, - "execution": () => { + "response_body_encode": () => (body) => Promise.resolve(body), + "response_body_mimetype": () => "text/plain", + "restriction": () => restriction_none, + "execution": () => () => { return Promise.resolve({ "status_code": 200, "data": "pong", diff --git a/source/api/actions/meta_spec.ts b/source/api/actions/meta_spec.ts index cecb3ad..cf0fd7d 100644 --- a/source/api/actions/meta_spec.ts +++ b/source/api/actions/meta_spec.ts @@ -5,10 +5,10 @@ namespace _zeitbild.api /** */ export function register_meta_spec( - rest_subject : lib_plankton.rest.type_rest + rest_subject : lib_plankton.rest_http.type_rest ) : void { - lib_plankton.rest.register< + lib_plankton.rest_http.register< null, any > @@ -17,17 +17,17 @@ namespace _zeitbild.api lib_plankton.http.enum_method.get, _zeitbild.conf.get().server.path_base + "/meta/spec", { - "description": "gibt die API-Spezifikation im OpenAPI-Format aus", + "description": () => "gibt die API-Spezifikation im OpenAPI-Format aus", "input_schema": () => ({ "nullable": true, }), "output_schema": () => ({ }), - "restriction": restriction_none, - "execution": () => { + "restriction": () => restriction_none, + "execution": () => () => { return Promise.resolve({ "status_code": 200, - "data": lib_plankton.rest.to_oas(rest_subject), + "data": lib_plankton.rest_http.to_oas(rest_subject), }); }, } diff --git a/source/api/actions/session_begin.ts b/source/api/actions/session_begin.ts index 8125575..2cc384e 100644 --- a/source/api/actions/session_begin.ts +++ b/source/api/actions/session_begin.ts @@ -5,10 +5,10 @@ namespace _zeitbild.api /** */ export function register_session_begin( - rest_subject : lib_plankton.rest.type_rest + rest_subject : lib_plankton.rest_http.type_rest ) : void { - lib_plankton.rest.register< + lib_plankton.rest_http.register< { name : string; password : string; @@ -23,7 +23,7 @@ namespace _zeitbild.api lib_plankton.http.enum_method.post, "/session/begin", { - "description": "führt die Anmeldung am System aus um geschützte Aktionen nutzen zu können", + "description": () => "führt die Anmeldung am System aus um geschützte Aktionen nutzen zu können", "input_schema": () => ({ "type": "object", "properties": { @@ -44,8 +44,8 @@ namespace _zeitbild.api "type": "string", "description": "der Sitzungs-Schlüssel, der als Header 'X-Session-Key' gesetzt werden muss um Erlaubnis zur Ausführung geschützter Aktionen zu erhalten", }), - "restriction": restriction_none, - "execution": async ({"input": input}) => { + "restriction": () => restriction_none, + "execution": () => async ({"input": input}) => { if (input === null) { return Promise.reject(new Error("impossible")); } diff --git a/source/api/actions/session_end.ts b/source/api/actions/session_end.ts index 124bb5e..08c723c 100644 --- a/source/api/actions/session_end.ts +++ b/source/api/actions/session_end.ts @@ -5,7 +5,7 @@ namespace _zeitbild.api /** */ export function register_session_end( - rest_subject : lib_plankton.rest.type_rest + rest_subject : lib_plankton.rest_http.type_rest ) : void { register( diff --git a/source/api/actions/session_oidc.ts b/source/api/actions/session_oidc.ts index d609537..a80aa72 100644 --- a/source/api/actions/session_oidc.ts +++ b/source/api/actions/session_oidc.ts @@ -5,7 +5,7 @@ namespace _zeitbild.api /** */ export function register_session_oidc( - rest_subject : lib_plankton.rest.type_rest + rest_subject : lib_plankton.rest_http.type_rest ) : void { register< diff --git a/source/api/actions/session_prepare.ts b/source/api/actions/session_prepare.ts index e76e225..7081000 100644 --- a/source/api/actions/session_prepare.ts +++ b/source/api/actions/session_prepare.ts @@ -5,10 +5,10 @@ namespace _zeitbild.api /** */ export function register_session_prepare( - rest_subject : lib_plankton.rest.type_rest + rest_subject : lib_plankton.rest_http.type_rest ) : void { - lib_plankton.rest.register< + lib_plankton.rest_http.register< any, { kind : string; @@ -19,15 +19,15 @@ namespace _zeitbild.api lib_plankton.http.enum_method.post, "/session/prepare", { - "description": "gibt die nötigen Werkzeuge für eine Anmeldung aus", + "description": () => "gibt die nötigen Werkzeuge für eine Anmeldung aus", "input_schema": () => ({ "nullable": true, }), "output_schema": () => ({ "nullable": false }), - "restriction": restriction_none, - "execution": async (stuff) => { + "restriction": () => restriction_none, + "execution": () => async (stuff) => { const preparation = await _zeitbild.auth.prepare(stuff.input); return Promise.resolve({ "status_code": 200, diff --git a/source/api/actions/users.ts b/source/api/actions/users.ts index fc4010b..2b190db 100644 --- a/source/api/actions/users.ts +++ b/source/api/actions/users.ts @@ -5,7 +5,7 @@ namespace _zeitbild.api /** */ export function register_users( - rest_subject : lib_plankton.rest.type_rest + rest_subject : lib_plankton.rest_http.type_rest ) : void { register<