diff --git a/lib/plankton/plankton.d.ts b/lib/plankton/plankton.d.ts index 49fd537..d07a527 100644 --- a/lib/plankton/plankton.d.ts +++ b/lib/plankton/plankton.d.ts @@ -658,6 +658,9 @@ declare namespace lib_plankton.call { /** */ export function sleep(seconds: float): Promise; + /** + */ + export function null_prop(value_from: (null | type_value_from), function_: ((value: type_value_from) => type_value_to)): (null | type_value_to); export {}; } declare namespace lib_plankton.email { @@ -4598,6 +4601,7 @@ declare namespace lib_plankton.auth.oidc { name: (null | string); label: (null | string); email: (null | string); + groups: (null | Array); }; /** */ diff --git a/lib/plankton/plankton.js b/lib/plankton/plankton.js index 2232892..3cf2c27 100644 --- a/lib/plankton/plankton.js +++ b/lib/plankton/plankton.js @@ -1491,6 +1491,16 @@ var lib_plankton; })); } call.sleep = sleep; + /** + */ + function null_prop(value_from, function_) { + return ((value_from === null) + ? + null + : + function_(value_from)); + } + call.null_prop = null_prop; })(call = lib_plankton.call || (lib_plankton.call = {})); })(lib_plankton || (lib_plankton = {})); var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { @@ -4056,10 +4066,10 @@ var lib_plankton; options = Object.assign({ "compare_value": instance_compare }, options); - if (is_empty(list)) { + /*if (is_empty(list)) { throw (new Error("the max-arg of an empty list is not defined")); } - else { + else */ { return (list .reduce(function (result, element, index) { var value = target_function(element); @@ -14466,8 +14476,7 @@ var lib_plankton; } }; lib_plankton.log.info("plankton.server.client_connected"); - socket.on("data", (input_chunk_raw, x2, x3, x4, x5) => { - process.stderr.write(JSON.stringify({ x2, x3, x4, x5 }) + "\n"); + socket.on("data", (input_chunk_raw) => { lib_plankton.log.debug("plankton.server.reading_chunk", { "chunk_raw": ((input_chunk_raw instanceof Buffer) ? @@ -16231,6 +16240,11 @@ var lib_plankton; "name": (data["preferred_username"] ?? null), "label": (data["name"] ?? null), "email": (data["email"] ?? null), + "groups": (((data["groups"] === undefined) || (data["groups"] === null)) + ? + null + : + data["groups"].split(",")), }); } /** diff --git a/source/value_objects/access_level.ts b/source/value_objects/access_level.ts deleted file mode 100644 index d1a5168..0000000 --- a/source/value_objects/access_level.ts +++ /dev/null @@ -1,74 +0,0 @@ -/* -This file is part of »zeitbild«. - -Copyright 2025 'kcf' - -»zeitbild« is free software: you can redistribute it and/or modify -it under the terms of the GNU Lesser General Public License as published by -the Free Software Foundation, either version 3 of the License, or -(at your option) any later version. - -»zeitbild« 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 Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public License -along with »zeitbild«. If not, see . - */ - - -/** - */ -namespace _zeitbild.value_object.access_level -{ - - /** - */ - export function to_string( - access_level : _zeitbild.enum_access_level - ) : string - { - switch (access_level) { - case _zeitbild.enum_access_level.none: {return "none";} - case _zeitbild.enum_access_level.view: {return "view";} - case _zeitbild.enum_access_level.edit: {return "edit";} - case _zeitbild.enum_access_level.admin: {return "admin";} - default: {throw (new Error("invalid access level: " + String(access_level)));} - } - } - - - /** - */ - export function from_string( - access_level_ : string - ) : _zeitbild.enum_access_level - { - switch (access_level_) { - case "none": {return _zeitbild.enum_access_level.none;} - case "view": {return _zeitbild.enum_access_level.view;} - case "edit": {return _zeitbild.enum_access_level.edit;} - case "admin": {return _zeitbild.enum_access_level.admin;} - default: {throw (new Error("invalid encoded access level: " + String(access_level_)));} - } - } - - - /** - */ - export function order( - x : _zeitbild.enum_access_level, - y : _zeitbild.enum_access_level - ) : boolean - { - const list : Array<_zeitbild.enum_access_level> = [ - _zeitbild.enum_access_level.none, - _zeitbild.enum_access_level.view, - _zeitbild.enum_access_level.edit, - _zeitbild.enum_access_level.admin, - ]; - return (list.indexOf(x) <= list.indexOf(y)); - } - -}