backend/source/types.ts

107 lines
1.2 KiB
TypeScript
Raw Normal View History

2024-09-12 00:03:29 +02:00
/**
*/
2024-09-21 11:05:24 +02:00
namespace _zeitbild
2024-09-12 00:03:29 +02:00
{
/**
*/
2024-09-21 10:56:00 +02:00
export enum enum_access_level {
none,
view,
edit,
admin
}
2024-09-12 00:03:29 +02:00
/**
*/
2024-09-21 11:05:24 +02:00
export type type_user_id = int;
2024-09-12 00:03:29 +02:00
/**
*/
2024-09-21 11:05:24 +02:00
export type type_user_object = {
2024-09-12 00:03:29 +02:00
name : string;
2024-09-13 17:49:32 +02:00
email_address : (
null
|
string
);
2024-09-12 00:03:29 +02:00
};
2024-09-25 14:50:32 +02:00
/**
*/
export type type_event_id = int;
2024-09-12 00:03:29 +02:00
/**
*/
2024-09-21 11:05:24 +02:00
export type type_event_object = {
2024-09-12 00:03:29 +02:00
name : string;
begin : _zeitbild.helpers.type_datetime;
end : (
null
|
_zeitbild.helpers.type_datetime
);
location : (
null
|
string
);
description : (
null
|
string
);
};
/**
*/
2024-09-21 11:05:24 +02:00
export type type_resource_id = int;
2024-09-12 00:03:29 +02:00
/**
*/
2024-09-21 11:05:24 +02:00
export type type_resource_object = (
2024-09-12 00:03:29 +02:00
{
2024-09-12 16:35:57 +02:00
kind : "local";
data : {
2024-09-25 14:50:32 +02:00
event_ids : Array<type_event_id>;
2024-09-12 16:35:57 +02:00
};
2024-09-12 00:03:29 +02:00
}
2024-09-12 16:35:57 +02:00
|
{
kind : "caldav";
data : {
url : string;
2024-09-25 14:50:32 +02:00
read_only : boolean;
2024-09-12 16:35:57 +02:00
};
}
);
/**
*/
2024-09-21 11:05:24 +02:00
export type type_calendar_id = int;
2024-09-12 16:35:57 +02:00
/**
*/
2024-09-21 11:05:24 +02:00
export type type_calendar_object = {
2024-09-12 16:35:57 +02:00
name : string;
2024-09-21 10:56:00 +02:00
access : {
default_level : enum_access_level;
attributed : lib_plankton.map.type_map<
2024-09-21 11:05:24 +02:00
type_user_id,
2024-09-21 10:56:00 +02:00
enum_access_level
>;
};
2024-09-21 11:05:24 +02:00
resource_id : type_resource_id;
2024-09-12 16:35:57 +02:00
};
2024-09-12 00:03:29 +02:00
}