[add] api:action:meta_spec

This commit is contained in:
roydfalk 2024-05-21 19:58:00 +02:00
parent c1c3dd99c3
commit d2393e01e3
5 changed files with 64 additions and 2 deletions

View file

@ -43,20 +43,22 @@ namespace _espe.api
"membership_number": {
"type": "string",
"nullable": false,
"description": "Mitgliedsnummer"
},
"name_real_value": {
"type": "string",
"nullable": false,
"description": "Klarname"
},
"email_address_private": {
"type": "string",
"nullable": true,
"description": "private E-Mail-Adresse"
},
},
"required": [
"membership_number",
"name_real_value",
"email_address_private",
]
}),
"output_schema": () => ({
@ -69,7 +71,7 @@ namespace _espe.api
{
"membership_number": input.membership_number,
"name_real_value": input.name_real_value,
"email_address_private": input.email_address_private,
"email_address_private": (input.email_address_private ?? null),
}
);
return Promise.resolve({

View file

@ -50,18 +50,22 @@ namespace _espe.api
"email_use_veiled_address": {
"type": "boolean",
"nullable": false,
"description": "ob die nummern-basierte E-Mail-Adresse eingerichtet werden soll",
},
"email_use_nominal_address": {
"type": "boolean",
"nullable": false,
"description": "ob die namens-basierte E-Mail-Adresse eingerichtet werden soll",
},
"email_redirect_to_private_address": {
"type": "boolean",
"nullable": false,
"description": "ob auf die Partei-Adressen eingehende E-Mails zur privaten Adresse weitergeleitet werden sollen",
},
"password": {
"type": "string",
"nullable": true,
"description": "Passwort für alle Netz-Dienste",
},
},
"required": [

View file

@ -0,0 +1,51 @@
/*
Espe | Ein schlichtes Werkzeug zur Mitglieder-Verwaltung | Backend
Copyright (C) 2024 Christian Fraß
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public
License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later
version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied
warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see
<https://www.gnu.org/licenses/>.
*/
namespace _espe.api
{
/**
*/
export function register_meta_spec(
rest_subject : lib_plankton.rest.type_rest
) : void
{
lib_plankton.rest.register<
null,
any
>
(
rest_subject,
lib_plankton.http.enum_method.get,
_espe.conf.get().server.path_base + "/meta/spec",
{
"description": "gibt die API-Spezifikation im OpenAPI-Format aus",
"input_schema": () => ({
"nullable": true,
}),
"output_schema": () => ({
}),
"restriction": restriction_none,
"execution": () => {
return Promise.resolve({
"status_code": 200,
"data": lib_plankton.rest.to_oas(rest_subject),
});
},
}
);
}
}

View file

@ -33,6 +33,10 @@ namespace _espe.api
},
}
);
// meta
{
_espe.api.register_meta_spec(rest_subject);
}
// session
{
_espe.api.register_session_begin(rest_subject);

View file

@ -51,6 +51,7 @@ ${dir_temp}/espe-core.js ${dir_temp}/espe-core.d.ts: \
${dir_source}/services/member.ts \
${dir_source}/service-admin.ts \
${dir_source}/api/base.ts \
${dir_source}/api/actions/meta_spec.ts \
${dir_source}/api/actions/session_begin.ts \
${dir_source}/api/actions/session_end.ts \
${dir_source}/api/actions/member_project.ts \