[mod] api:action:events:hash mit ausgeben
This commit is contained in:
parent
e66da38cb1
commit
60f1c5a0de
|
|
@ -32,6 +32,7 @@ namespace _zeitbild.api
|
||||||
(
|
(
|
||||||
Array<
|
Array<
|
||||||
{
|
{
|
||||||
|
hash : _zeitbild.type_event_hash;
|
||||||
calendar_id : int;
|
calendar_id : int;
|
||||||
calendar_name : string;
|
calendar_name : string;
|
||||||
hue : float;
|
hue : float;
|
||||||
|
|
@ -73,6 +74,10 @@ namespace _zeitbild.api
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"additionalProperties": false,
|
"additionalProperties": false,
|
||||||
"properties": {
|
"properties": {
|
||||||
|
"hash": {
|
||||||
|
"nullable": false,
|
||||||
|
"type": "string",
|
||||||
|
},
|
||||||
"calendar_id": {
|
"calendar_id": {
|
||||||
"nullable": false,
|
"nullable": false,
|
||||||
"type": "number",
|
"type": "number",
|
||||||
|
|
@ -191,6 +196,8 @@ namespace _zeitbild.api
|
||||||
data
|
data
|
||||||
.map(
|
.map(
|
||||||
(entry) => ({
|
(entry) => ({
|
||||||
|
// todo
|
||||||
|
"hash": entry.hash,
|
||||||
"calendar_id": entry.calendar_id,
|
"calendar_id": entry.calendar_id,
|
||||||
"calendar_name": entry.calendar_name,
|
"calendar_name": entry.calendar_name,
|
||||||
"hue": entry.hue,
|
"hue": entry.hue,
|
||||||
|
|
|
||||||
|
|
@ -298,13 +298,14 @@ namespace _zeitbild.service.calendar
|
||||||
Array<
|
Array<
|
||||||
{
|
{
|
||||||
id : (null | _zeitbild.type_local_resource_event_id);
|
id : (null | _zeitbild.type_local_resource_event_id);
|
||||||
|
hash : _zeitbild.type_event_hash;
|
||||||
object : _zeitbild.type_event_object;
|
object : _zeitbild.type_event_object;
|
||||||
}
|
}
|
||||||
>
|
>
|
||||||
>
|
>
|
||||||
{
|
{
|
||||||
const calendar_object : _zeitbild.type_calendar_object = await _zeitbild.repository.calendar.read(calendar_id);
|
const calendar_object : _zeitbild.type_calendar_object = await _zeitbild.repository.calendar.read(calendar_id);
|
||||||
return wrap_check_access_level<Array<{id : (null | _zeitbild.type_local_resource_event_id); object : _zeitbild.type_event_object;}>>(
|
return wrap_check_access_level<Array<{id : (null | _zeitbild.type_local_resource_event_id); hash : _zeitbild.type_event_hash; object : _zeitbild.type_event_object;}>>(
|
||||||
calendar_object,
|
calendar_object,
|
||||||
user_id,
|
user_id,
|
||||||
_zeitbild.enum_access_level.view,
|
_zeitbild.enum_access_level.view,
|
||||||
|
|
@ -325,6 +326,13 @@ namespace _zeitbild.service.calendar
|
||||||
(event_object) => Promise.resolve(
|
(event_object) => Promise.resolve(
|
||||||
{
|
{
|
||||||
"id": event_id,
|
"id": event_id,
|
||||||
|
"hash": lib_plankton.string.coin(
|
||||||
|
"{{calendar_id}}:{{event_id}}",
|
||||||
|
{
|
||||||
|
"calendar_id": calendar_id.toFixed(0),
|
||||||
|
"event_id": event_id.toFixed(0),
|
||||||
|
}
|
||||||
|
),
|
||||||
"object": event_object,
|
"object": event_object,
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
@ -449,6 +457,19 @@ namespace _zeitbild.service.calendar
|
||||||
.map(
|
.map(
|
||||||
(event) => ({
|
(event) => ({
|
||||||
"id": null,
|
"id": null,
|
||||||
|
"hash": lib_plankton.string.coin(
|
||||||
|
"{{calendar_id}}~{{hash}}",
|
||||||
|
{
|
||||||
|
"calendar_id": calendar_id.toFixed(0),
|
||||||
|
"hash": lib_plankton.call.convey(
|
||||||
|
event,
|
||||||
|
[
|
||||||
|
(x : any) => lib_plankton.json.encode(x),
|
||||||
|
(x : string) => lib_plankton.base64.encode(x),
|
||||||
|
]
|
||||||
|
)
|
||||||
|
}
|
||||||
|
),
|
||||||
"object": event,
|
"object": event,
|
||||||
})
|
})
|
||||||
)
|
)
|
||||||
|
|
@ -531,6 +552,7 @@ namespace _zeitbild.service.calendar
|
||||||
const events : Array<
|
const events : Array<
|
||||||
{
|
{
|
||||||
id : (null | _zeitbild.type_local_resource_event_id);
|
id : (null | _zeitbild.type_local_resource_event_id);
|
||||||
|
hash : _zeitbild.type_event_hash;
|
||||||
object : _zeitbild.type_event_object;
|
object : _zeitbild.type_event_object;
|
||||||
}
|
}
|
||||||
> = await get_events(
|
> = await get_events(
|
||||||
|
|
@ -543,6 +565,7 @@ namespace _zeitbild.service.calendar
|
||||||
events
|
events
|
||||||
.map(
|
.map(
|
||||||
(event_entry) => ({
|
(event_entry) => ({
|
||||||
|
"hash": event_entry.hash,
|
||||||
"calendar_id": calendar_id,
|
"calendar_id": calendar_id,
|
||||||
"calendar_name": calendar_object.name,
|
"calendar_name": calendar_object.name,
|
||||||
"hue": calendar_object.hue,
|
"hue": calendar_object.hue,
|
||||||
|
|
|
||||||
|
|
@ -140,9 +140,15 @@ namespace _zeitbild
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
*/
|
||||||
|
export type type_event_hash = string;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*/
|
*/
|
||||||
export type type_event_extended = {
|
export type type_event_extended = {
|
||||||
|
hash : type_event_hash;
|
||||||
calendar_id : type_calendar_id;
|
calendar_id : type_calendar_id;
|
||||||
calendar_name : string;
|
calendar_name : string;
|
||||||
hue : float;
|
hue : float;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue