[fix] api actions
This commit is contained in:
parent
a08f7f3bf4
commit
3d7ba02b78
|
|
@ -5,7 +5,7 @@ namespace _zeitbild.api
|
||||||
/**
|
/**
|
||||||
*/
|
*/
|
||||||
export function register_calendar_add(
|
export function register_calendar_add(
|
||||||
rest_subject : lib_plankton.rest.type_rest
|
rest_subject : lib_plankton.rest_http.type_rest
|
||||||
) : void
|
) : void
|
||||||
{
|
{
|
||||||
register<
|
register<
|
||||||
|
|
@ -64,7 +64,8 @@ namespace _zeitbild.api
|
||||||
else {
|
else {
|
||||||
// TODO move logic to calendar service
|
// TODO move logic to calendar service
|
||||||
let resource_object : _zeitbild.type_resource_object;
|
let resource_object : _zeitbild.type_resource_object;
|
||||||
switch (stuff.input.resource.kind) {
|
switch (stuff.input.resource.kind)
|
||||||
|
{
|
||||||
case "local": {
|
case "local": {
|
||||||
resource_object = {
|
resource_object = {
|
||||||
"kind": "local",
|
"kind": "local",
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@ namespace _zeitbild.api
|
||||||
/**
|
/**
|
||||||
*/
|
*/
|
||||||
export function register_calendar_change(
|
export function register_calendar_change(
|
||||||
rest_subject : lib_plankton.rest.type_rest
|
rest_subject : lib_plankton.rest_http.type_rest
|
||||||
) : void
|
) : void
|
||||||
{
|
{
|
||||||
register<
|
register<
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@ namespace _zeitbild.api
|
||||||
/**
|
/**
|
||||||
*/
|
*/
|
||||||
export function register_calendar_event_add(
|
export function register_calendar_event_add(
|
||||||
rest_subject : lib_plankton.rest.type_rest
|
rest_subject : lib_plankton.rest_http.type_rest
|
||||||
) : void
|
) : void
|
||||||
{
|
{
|
||||||
register<
|
register<
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@ namespace _zeitbild.api
|
||||||
/**
|
/**
|
||||||
*/
|
*/
|
||||||
export function register_calendar_event_change(
|
export function register_calendar_event_change(
|
||||||
rest_subject : lib_plankton.rest.type_rest
|
rest_subject : lib_plankton.rest_http.type_rest
|
||||||
) : void
|
) : void
|
||||||
{
|
{
|
||||||
register<
|
register<
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@ namespace _zeitbild.api
|
||||||
/**
|
/**
|
||||||
*/
|
*/
|
||||||
export function register_calendar_event_get(
|
export function register_calendar_event_get(
|
||||||
rest_subject : lib_plankton.rest.type_rest
|
rest_subject : lib_plankton.rest_http.type_rest
|
||||||
) : void
|
) : void
|
||||||
{
|
{
|
||||||
register<
|
register<
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@ namespace _zeitbild.api
|
||||||
/**
|
/**
|
||||||
*/
|
*/
|
||||||
export function register_calendar_event_remove(
|
export function register_calendar_event_remove(
|
||||||
rest_subject : lib_plankton.rest.type_rest
|
rest_subject : lib_plankton.rest_http.type_rest
|
||||||
) : void
|
) : void
|
||||||
{
|
{
|
||||||
register<
|
register<
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@ namespace _zeitbild.api
|
||||||
/**
|
/**
|
||||||
*/
|
*/
|
||||||
export function register_calendar_get(
|
export function register_calendar_get(
|
||||||
rest_subject : lib_plankton.rest.type_rest
|
rest_subject : lib_plankton.rest_http.type_rest
|
||||||
) : void
|
) : void
|
||||||
{
|
{
|
||||||
register<
|
register<
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@ namespace _zeitbild.api
|
||||||
/**
|
/**
|
||||||
*/
|
*/
|
||||||
export function register_calendar_list(
|
export function register_calendar_list(
|
||||||
rest_subject : lib_plankton.rest.type_rest
|
rest_subject : lib_plankton.rest_http.type_rest
|
||||||
) : void
|
) : void
|
||||||
{
|
{
|
||||||
register<
|
register<
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@ namespace _zeitbild.api
|
||||||
/**
|
/**
|
||||||
*/
|
*/
|
||||||
export function register_calendar_remove(
|
export function register_calendar_remove(
|
||||||
rest_subject : lib_plankton.rest.type_rest
|
rest_subject : lib_plankton.rest_http.type_rest
|
||||||
) : void
|
) : void
|
||||||
{
|
{
|
||||||
register<
|
register<
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@ namespace _zeitbild.api
|
||||||
/**
|
/**
|
||||||
*/
|
*/
|
||||||
export function register_events(
|
export function register_events(
|
||||||
rest_subject : lib_plankton.rest.type_rest
|
rest_subject : lib_plankton.rest_http.type_rest
|
||||||
) : void
|
) : void
|
||||||
{
|
{
|
||||||
register<
|
register<
|
||||||
|
|
|
||||||
|
|
@ -5,10 +5,10 @@ namespace _zeitbild.api
|
||||||
/**
|
/**
|
||||||
*/
|
*/
|
||||||
export function register_meta_ping(
|
export function register_meta_ping(
|
||||||
rest_subject : lib_plankton.rest.type_rest
|
rest_subject : lib_plankton.rest_http.type_rest
|
||||||
) : void
|
) : void
|
||||||
{
|
{
|
||||||
lib_plankton.rest.register<
|
lib_plankton.rest_http.register<
|
||||||
null,
|
null,
|
||||||
string
|
string
|
||||||
>
|
>
|
||||||
|
|
@ -17,7 +17,7 @@ namespace _zeitbild.api
|
||||||
lib_plankton.http.enum_method.get,
|
lib_plankton.http.enum_method.get,
|
||||||
_zeitbild.conf.get().server.path_base + "/meta/ping",
|
_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": () => ({
|
"input_schema": () => ({
|
||||||
"nullable": true,
|
"nullable": true,
|
||||||
}),
|
}),
|
||||||
|
|
@ -25,8 +25,10 @@ namespace _zeitbild.api
|
||||||
"nullable": false,
|
"nullable": false,
|
||||||
"type": "string",
|
"type": "string",
|
||||||
}),
|
}),
|
||||||
"restriction": restriction_none,
|
"response_body_encode": () => (body) => Promise.resolve<string>(body),
|
||||||
"execution": () => {
|
"response_body_mimetype": () => "text/plain",
|
||||||
|
"restriction": () => restriction_none,
|
||||||
|
"execution": () => () => {
|
||||||
return Promise.resolve({
|
return Promise.resolve({
|
||||||
"status_code": 200,
|
"status_code": 200,
|
||||||
"data": "pong",
|
"data": "pong",
|
||||||
|
|
|
||||||
|
|
@ -5,10 +5,10 @@ namespace _zeitbild.api
|
||||||
/**
|
/**
|
||||||
*/
|
*/
|
||||||
export function register_meta_spec(
|
export function register_meta_spec(
|
||||||
rest_subject : lib_plankton.rest.type_rest
|
rest_subject : lib_plankton.rest_http.type_rest
|
||||||
) : void
|
) : void
|
||||||
{
|
{
|
||||||
lib_plankton.rest.register<
|
lib_plankton.rest_http.register<
|
||||||
null,
|
null,
|
||||||
any
|
any
|
||||||
>
|
>
|
||||||
|
|
@ -17,17 +17,17 @@ namespace _zeitbild.api
|
||||||
lib_plankton.http.enum_method.get,
|
lib_plankton.http.enum_method.get,
|
||||||
_zeitbild.conf.get().server.path_base + "/meta/spec",
|
_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": () => ({
|
"input_schema": () => ({
|
||||||
"nullable": true,
|
"nullable": true,
|
||||||
}),
|
}),
|
||||||
"output_schema": () => ({
|
"output_schema": () => ({
|
||||||
}),
|
}),
|
||||||
"restriction": restriction_none,
|
"restriction": () => restriction_none,
|
||||||
"execution": () => {
|
"execution": () => () => {
|
||||||
return Promise.resolve({
|
return Promise.resolve({
|
||||||
"status_code": 200,
|
"status_code": 200,
|
||||||
"data": lib_plankton.rest.to_oas(rest_subject),
|
"data": lib_plankton.rest_http.to_oas(rest_subject),
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -5,10 +5,10 @@ namespace _zeitbild.api
|
||||||
/**
|
/**
|
||||||
*/
|
*/
|
||||||
export function register_session_begin(
|
export function register_session_begin(
|
||||||
rest_subject : lib_plankton.rest.type_rest
|
rest_subject : lib_plankton.rest_http.type_rest
|
||||||
) : void
|
) : void
|
||||||
{
|
{
|
||||||
lib_plankton.rest.register<
|
lib_plankton.rest_http.register<
|
||||||
{
|
{
|
||||||
name : string;
|
name : string;
|
||||||
password : string;
|
password : string;
|
||||||
|
|
@ -23,7 +23,7 @@ namespace _zeitbild.api
|
||||||
lib_plankton.http.enum_method.post,
|
lib_plankton.http.enum_method.post,
|
||||||
"/session/begin",
|
"/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": () => ({
|
"input_schema": () => ({
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"properties": {
|
"properties": {
|
||||||
|
|
@ -44,8 +44,8 @@ namespace _zeitbild.api
|
||||||
"type": "string",
|
"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",
|
"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,
|
"restriction": () => restriction_none,
|
||||||
"execution": async ({"input": input}) => {
|
"execution": () => async ({"input": input}) => {
|
||||||
if (input === null) {
|
if (input === null) {
|
||||||
return Promise.reject(new Error("impossible"));
|
return Promise.reject(new Error("impossible"));
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@ namespace _zeitbild.api
|
||||||
/**
|
/**
|
||||||
*/
|
*/
|
||||||
export function register_session_end(
|
export function register_session_end(
|
||||||
rest_subject : lib_plankton.rest.type_rest
|
rest_subject : lib_plankton.rest_http.type_rest
|
||||||
) : void
|
) : void
|
||||||
{
|
{
|
||||||
register<null, null>(
|
register<null, null>(
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@ namespace _zeitbild.api
|
||||||
/**
|
/**
|
||||||
*/
|
*/
|
||||||
export function register_session_oidc(
|
export function register_session_oidc(
|
||||||
rest_subject : lib_plankton.rest.type_rest
|
rest_subject : lib_plankton.rest_http.type_rest
|
||||||
) : void
|
) : void
|
||||||
{
|
{
|
||||||
register<
|
register<
|
||||||
|
|
|
||||||
|
|
@ -5,10 +5,10 @@ namespace _zeitbild.api
|
||||||
/**
|
/**
|
||||||
*/
|
*/
|
||||||
export function register_session_prepare(
|
export function register_session_prepare(
|
||||||
rest_subject : lib_plankton.rest.type_rest
|
rest_subject : lib_plankton.rest_http.type_rest
|
||||||
) : void
|
) : void
|
||||||
{
|
{
|
||||||
lib_plankton.rest.register<
|
lib_plankton.rest_http.register<
|
||||||
any,
|
any,
|
||||||
{
|
{
|
||||||
kind : string;
|
kind : string;
|
||||||
|
|
@ -19,15 +19,15 @@ namespace _zeitbild.api
|
||||||
lib_plankton.http.enum_method.post,
|
lib_plankton.http.enum_method.post,
|
||||||
"/session/prepare",
|
"/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": () => ({
|
"input_schema": () => ({
|
||||||
"nullable": true,
|
"nullable": true,
|
||||||
}),
|
}),
|
||||||
"output_schema": () => ({
|
"output_schema": () => ({
|
||||||
"nullable": false
|
"nullable": false
|
||||||
}),
|
}),
|
||||||
"restriction": restriction_none,
|
"restriction": () => restriction_none,
|
||||||
"execution": async (stuff) => {
|
"execution": () => async (stuff) => {
|
||||||
const preparation = await _zeitbild.auth.prepare(stuff.input);
|
const preparation = await _zeitbild.auth.prepare(stuff.input);
|
||||||
return Promise.resolve({
|
return Promise.resolve({
|
||||||
"status_code": 200,
|
"status_code": 200,
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@ namespace _zeitbild.api
|
||||||
/**
|
/**
|
||||||
*/
|
*/
|
||||||
export function register_users(
|
export function register_users(
|
||||||
rest_subject : lib_plankton.rest.type_rest
|
rest_subject : lib_plankton.rest_http.type_rest
|
||||||
) : void
|
) : void
|
||||||
{
|
{
|
||||||
register<
|
register<
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue