backend/source/api/actions/verification_get.ts

45 lines
916 B
TypeScript
Raw Normal View History

2024-04-22 10:22:18 +02:00
namespace _espe.api
2024-04-22 10:02:34 +02:00
{
/**
*/
export function register_verification_get(
rest_subject : lib_plankton.rest.type_rest
) : void
{
lib_plankton.rest.register<{data : any;}, string>(
rest_subject,
lib_plankton.http.enum_method.post,
"/verification/get",
{
"description": "berechnet einen Prüfwert auf Basis eines Geheimnisses",
"input_schema": () => ({
"type": "object",
"nullable": true,
"properties": {
"data": {
"nullable": true
},
},
"additionalProperties": false,
"required": [
"input",
]
}),
"output_schema": () => ({
"type": "string",
"nullable": false,
}),
"restriction": restriction_logged_in,
"execution": async ({"input": input}) => {
return Promise.resolve({
"status_code": 200,
2024-04-22 10:22:18 +02:00
"data": await _espe.helpers.verification_get(input.data),
2024-04-22 10:02:34 +02:00
});
},
}
);
}
}