backend/source/api/actions/verification_check.ts

50 lines
1 KiB
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_check(
rest_subject : lib_plankton.rest.type_rest
) : void
{
lib_plankton.rest.register<{data : any; verification : string;}, boolean>(
rest_subject,
lib_plankton.http.enum_method.post,
"/verification/check",
{
"description": "untersucht ob ein Prüfwert zu einer Eingabe passt",
"input_schema": () => ({
"type": "object",
"nullable": true,
"properties": {
"data": {
"nullable": true
},
"verification": {
"type": "string",
"nullable": false
},
},
"additionalProperties": false,
"required": [
"input",
"verification",
]
}),
"output_schema": () => ({
"type": "boolean",
"nullable": false,
}),
"restriction": restriction_none,
"execution": async ({"input": input}) => {
return Promise.resolve({
"status_code": 200,
2024-04-22 10:22:18 +02:00
"data": await _espe.helpers.verification_check(input.data, input.verification),
2024-04-22 10:02:34 +02:00
});
},
}
);
}
}