backend/source/services/user.ts

81 lines
1.6 KiB
TypeScript
Raw Normal View History

2025-09-25 17:18:16 +02:00
/*
This file is part of »zeitbild«.
Copyright 2025 'kcf' <fenris@folksprak.org>
»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 <http://www.gnu.org/licenses/>.
*/
2024-09-18 18:17:25 +02:00
namespace _zeitbild.service.user
{
/**
*/
export function list(
) : Promise<
Array<
{
id : _zeitbild.type_user_id;
name : string;
}
>
>
2024-09-18 18:17:25 +02:00
{
return _zeitbild.repository.user.list();
2024-09-18 18:17:25 +02:00
}
/**
*/
export function identify(
name : string
2024-09-21 11:05:24 +02:00
) : Promise<_zeitbild.type_user_id>
2024-09-18 18:17:25 +02:00
{
return _zeitbild.repository.user.identify(name);
}
/**
*/
export function get(
user_id : _zeitbild.type_user_id
) : Promise<_zeitbild.type_user_object>
{
return _zeitbild.repository.user.read(user_id);
}
/**
*/
export function add(
user_object : _zeitbild.type_user_object
) : Promise<_zeitbild.type_user_id>
{
return _zeitbild.repository.user.create(user_object);
}
/**
*/
export function change(
user_id : _zeitbild.type_user_id,
user_object : _zeitbild.type_user_object
) : Promise<void>
{
return _zeitbild.repository.user.update(user_id, user_object);
}
2024-09-18 18:17:25 +02:00
}