backend/source/types.ts

119 lines
1.2 KiB
TypeScript
Raw Normal View History

2024-09-12 00:03:29 +02:00
/**
*/
namespace _zeitbild.type
{
/**
*/
2024-09-12 16:35:57 +02:00
export type role = (
"admin"
|
2024-09-12 00:03:29 +02:00
"editor"
|
"viewer"
);
/**
*/
2024-09-12 16:35:57 +02:00
export type user_id = int;
2024-09-12 00:03:29 +02:00
/**
*/
2024-09-12 16:35:57 +02:00
export type user_object = {
2024-09-12 00:03:29 +02:00
name : string;
};
/**
*/
export type event_object = {
name : string;
begin : _zeitbild.helpers.type_datetime;
end : (
null
|
_zeitbild.helpers.type_datetime
);
location : (
null
|
string
);
description : (
null
|
string
);
};
/**
*/
2024-09-12 16:35:57 +02:00
export type resource_id = int;
2024-09-12 00:03:29 +02:00
/**
*/
2024-09-12 16:35:57 +02:00
export type resource_object = (
2024-09-12 00:03:29 +02:00
{
2024-09-12 16:35:57 +02:00
kind : "local";
data : {
events : Array<
event_object
>;
};
2024-09-12 00:03:29 +02:00
}
2024-09-12 16:35:57 +02:00
|
{
kind : "caldav";
data : {
read_only : boolean;
url : string;
};
}
);
/**
*/
export type calendar_id = int;
/**
*/
export type calendar_object = {
name : string;
public : boolean;
members : Array<
2024-09-12 00:03:29 +02:00
{
2024-09-12 16:35:57 +02:00
user_id : user_id;
role : role;
2024-09-12 00:03:29 +02:00
}
2024-09-12 16:35:57 +02:00
>;
// resource : resource_object;
resource_id : resource_id;
};
/**
*/
export type root = {
users : Array<
2024-09-12 00:03:29 +02:00
{
2024-09-12 16:35:57 +02:00
id : user_id;
object : user_object;
2024-09-12 00:03:29 +02:00
}
2024-09-12 16:35:57 +02:00
>;
calendars : Array<
{
id : calendar_id;
object : calendar_object;
}
>;
};
2024-09-12 00:03:29 +02:00
}