[task-193] [int]

This commit is contained in:
roydfalk 2025-04-01 20:54:10 +00:00
parent eb74ecd66f
commit d3f9a88958
6 changed files with 164 additions and 33 deletions

View file

@ -56,7 +56,12 @@
"login_url": null "login_url": null
} }
}, },
"output": { "outputs": [
"authelia": "/tmp/authelia-users.yml" {
} "kind": "authelia_file",
"data": {
"path": "/tmp/authelia-users.yml"
}
}
]
} }

View file

@ -22,8 +22,14 @@ namespace _espe.api
) : void ) : void
{ {
register< register<
any, {
any key : string;
membership_number_value : (null | string);
name_value : string;
email_address_value : (null | string);
groups_value : Array<string>;
},
null
>( >(
rest_subject, rest_subject,
lib_plankton.http.enum_method.post, lib_plankton.http.enum_method.post,
@ -47,13 +53,33 @@ namespace _espe.api
}), }),
"restriction": restriction_none, "restriction": restriction_none,
"execution": async ({"input": input}) => { "execution": async ({"input": input}) => {
/** if (input === null) {
* @todo return Promise.resolve({
*/ "status_code": 400,
return Promise.resolve({ "data": null
"status_code": 501, });
"data": null }
}); else {
try {
await _espe.service.invite.accept(
input.key,
input.membership_number_value,
input.name_value,
input.email_address_value,
input.groups_value
);
return Promise.resolve({
"status_code": 200,
"data": null
});
}
catch (error) {
return Promise.resolve({
"status_code": 404,
"data": null
});
}
}
} }
} }
); );

View file

@ -51,36 +51,62 @@ namespace _espe.api
/** /**
* @todo translation * @todo translation
*/ */
"description": "erstellt eine Einladung neues Mitglied und gibt die erzeugte ID und den erzeugten Schlüssel aus", "description": "erstellt eine Einladung und gibt die erzeugte ID und den erzeugten Schlüssel aus",
"input_schema": () => ({ "input_schema": () => ({
"type": "object", "type": "object",
"nullable": false, "nullable": false,
"additionalProperties": false, "additionalProperties": false,
"properties": { "properties": {
/* "membership_number_mode": {
"membership_number": { "type": "integer",
"type": "string",
"nullable": false, "nullable": false,
"description": "Mitgliedsnummer" "description": "Mitgliedsnummer | Modus"
}, },
"name_real_value": { "membership_number_value": {
"type": "string",
"nullable": false,
"description": "Klarname"
},
"email_address_private": {
"type": "string", "type": "string",
"nullable": true, "nullable": true,
"description": "private E-Mail-Adresse" "description": "Mitgliedsnummer | Wert"
}, },
"groups": { "name_mode": {
"type": "integer",
"nullable": false,
"description": "Name | Modus"
},
"name_value": {
"type": "string",
"nullable": true,
"description": "Name | Wert"
},
"email_address_mode": {
"type": "integer",
"nullable": true,
"description": "E-Mail-Adresse | Modus"
},
"email_address_value": {
"type": "string",
"nullable": true,
"description": "E-Mail-Adresse | Wert"
},
"groups_integer": {
"type": "integer",
"nullable": true,
"description": "Gruppen | Modus"
},
"groups_value": {
"nullable": false, "nullable": false,
"type": "array", "type": "array",
"items": { "items": {
"type": "string", "type": "string",
"nullable": false, "nullable": false,
} },
"description": "Gruppen | Wert"
}, },
"expiry": {
"nullable": true,
"type": "intiger",
"description": "Ablaufzeitpunkt"
},
/*
"notification_target_url_template": { "notification_target_url_template": {
"type": "string", "type": "string",
"nullable": true, "nullable": true,
@ -89,9 +115,13 @@ namespace _espe.api
*/ */
}, },
"required": [ "required": [
"membership_number_mode",
"membership_number_value", "membership_number_value",
"name_mode",
"name_value", "name_value",
"email_address_mode",
"email_address_value", "email_address_value",
"groups_mode",
"groups_value", "groups_value",
"expiry", "expiry",
] ]

View file

@ -37,11 +37,72 @@ namespace _espe.api
"type": "string", "type": "string",
"nullable": false, "nullable": false,
}), }),
/**
* @todo
*/
"output_schema": () => ({ "output_schema": () => ({
"nullable": true, "type": "object",
"nullable": false,
"additionalProperties": false,
"properties": {
"expiry": {
"nullable": true,
"type": "intiger",
"description": "Ablaufzeitpunkt"
},
"membership_number_mode": {
"type": "integer",
"nullable": false,
"description": "Mitgliedsnummer | Modus"
},
"membership_number_value": {
"type": "string",
"nullable": true,
"description": "Mitgliedsnummer | Wert"
},
"name_mode": {
"type": "integer",
"nullable": false,
"description": "Name | Modus"
},
"name_value": {
"type": "string",
"nullable": true,
"description": "Name | Wert"
},
"email_address_mode": {
"type": "integer",
"nullable": true,
"description": "E-Mail-Adresse | Modus"
},
"email_address_value": {
"type": "string",
"nullable": true,
"description": "E-Mail-Adresse | Wert"
},
"groups_integer": {
"type": "integer",
"nullable": true,
"description": "Gruppen | Modus"
},
"groups_value": {
"nullable": false,
"type": "array",
"items": {
"type": "string",
"nullable": false,
},
"description": "Gruppen | Wert"
},
},
"required": [
"expiry",
"membership_number_mode",
"membership_number_value",
"name_mode",
"name_value",
"email_address_mode",
"email_address_value",
"groups_mode",
"groups_value",
]
}), }),
"restriction": restriction_none, "restriction": restriction_none,
"execution": ({"input": input}) => { "execution": ({"input": input}) => {
@ -52,7 +113,15 @@ namespace _espe.api
(invite_object) => Promise.resolve({ (invite_object) => Promise.resolve({
"status_code": 200, "status_code": 200,
"data": { "data": {
"expiry": invite_object.expiry,
"membership_number_mode": _espe.helpers.invite_prefill_mode_encode(invite_object.membership_number_mode), "membership_number_mode": _espe.helpers.invite_prefill_mode_encode(invite_object.membership_number_mode),
"membership_number_value": invite_object.membership_number_value,
"name_mode": _espe.helpers.invite_prefill_mode_encode(invite_object.name_mode),
"name_value": invite_object.name_value,
"email_address_mode": _espe.helpers.invite_prefill_mode_encode(invite_object.email_address_mode),
"email_address_value": invite_object.email_address_value,
"groups_mode": _espe.helpers.invite_prefill_mode_encode(invite_object.groups_mode),
"groups_value": invite_object.groups_value,
} }
}) })
) )

View file

@ -454,7 +454,8 @@ namespace _espe.conf
return (conf_raw["outputs"] ?? []); return (conf_raw["outputs"] ?? []);
break; break;
} }
case 4: { case 4:
case 5: {
const node_outputs = (conf_raw["outputs"] ?? []); const node_outputs = (conf_raw["outputs"] ?? []);
return node_outputs.map( return node_outputs.map(
(output_description : {kind : string; data : any;}) => { (output_description : {kind : string; data : any;}) => {

View file

@ -59,7 +59,7 @@ namespace _espe.service.invite
+ +
"/" "/"
+ +
lib_plankton.base.get_current_timestamp().toFixed(0) Math.floor(lib_plankton.base.get_current_timestamp()).toFixed(0)
), ),
"secret" "secret"
); );
@ -68,7 +68,7 @@ namespace _espe.service.invite
"expiry": ( "expiry": (
((expiry !== null) && (expiry < 0)) ((expiry !== null) && (expiry < 0))
? ?
(lib_plankton.base.get_current_timestamp() + default_lifetime) (Math.floor(lib_plankton.base.get_current_timestamp()) + default_lifetime)
: :
expiry expiry
), ),