Release v0.1.5

This commit is contained in:
2026-07-07 15:49:06 +02:00
parent 3bcb04ff76
commit b328a6d649
21 changed files with 5718 additions and 714 deletions

View File

@@ -1,6 +1,6 @@
{
"name": "@govoplan/calendar-webui",
"version": "0.1.4",
"version": "0.1.5",
"private": true,
"type": "module",
"main": "src/index.ts",
@@ -14,7 +14,7 @@
"./styles/calendar.css": "./src/styles/calendar.css"
},
"peerDependencies": {
"@govoplan/core-webui": "^0.1.4",
"@govoplan/core-webui": "^0.1.5",
"lucide-react": "^0.555.0",
"react": "^19.0.0",
"react-dom": "^19.0.0",

View File

@@ -56,6 +56,27 @@ export type CalendarEvent = {
export type CalendarCollectionListResponse = { calendars: CalendarCollection[] };
export type CalendarEventListResponse = { events: CalendarEvent[] };
export type CalendarCollectionCreatePayload = {
name: string;
slug?: string | null;
description?: string | null;
timezone?: string;
color?: string | null;
owner_type?: "tenant" | "user" | "group" | "resource";
owner_id?: string | null;
visibility?: "private" | "tenant" | "shared" | "public";
is_default?: boolean;
metadata?: Record<string, unknown>;
};
export type CalendarCollectionUpdatePayload = Partial<CalendarCollectionCreatePayload>;
export type CalendarDeleteEventAction = "delete" | "move";
export type CalendarCollectionDeletePayload = {
event_action?: CalendarDeleteEventAction;
target_calendar_id?: string | null;
make_target_default?: boolean;
};
export type CalendarEventCreatePayload = {
calendar_id?: string | null;
summary: string;
@@ -71,10 +92,24 @@ export type CalendarEventCreatePayload = {
categories?: string[];
};
export type CalendarEventUpdatePayload = Partial<CalendarEventCreatePayload>;
export function listCalendars(settings: ApiSettings): Promise<CalendarCollectionListResponse> {
return apiFetch<CalendarCollectionListResponse>(settings, "/api/v1/calendar/calendars");
}
export function createCalendar(settings: ApiSettings, payload: CalendarCollectionCreatePayload): Promise<CalendarCollection> {
return apiFetch<CalendarCollection>(settings, "/api/v1/calendar/calendars", { method: "POST", body: JSON.stringify(payload) });
}
export function updateCalendar(settings: ApiSettings, calendarId: string, payload: CalendarCollectionUpdatePayload): Promise<CalendarCollection> {
return apiFetch<CalendarCollection>(settings, `/api/v1/calendar/calendars/${calendarId}`, { method: "PATCH", body: JSON.stringify(payload) });
}
export function deleteCalendar(settings: ApiSettings, calendarId: string, payload: CalendarCollectionDeletePayload = { event_action: "delete" }): Promise<void> {
return apiFetch<void>(settings, `/api/v1/calendar/calendars/${calendarId}`, { method: "DELETE", body: JSON.stringify(payload) });
}
export function listCalendarEvents(
settings: ApiSettings,
params: { calendar_id?: string; start_at?: string; end_at?: string } = {}
@@ -90,3 +125,11 @@ export function listCalendarEvents(
export function createCalendarEvent(settings: ApiSettings, payload: CalendarEventCreatePayload): Promise<CalendarEvent> {
return apiFetch<CalendarEvent>(settings, "/api/v1/calendar/events", { method: "POST", body: JSON.stringify(payload) });
}
export function updateCalendarEvent(settings: ApiSettings, eventId: string, payload: CalendarEventUpdatePayload): Promise<CalendarEvent> {
return apiFetch<CalendarEvent>(settings, `/api/v1/calendar/events/${eventId}`, { method: "PATCH", body: JSON.stringify(payload) });
}
export function deleteCalendarEvent(settings: ApiSettings, eventId: string): Promise<void> {
return apiFetch<void>(settings, `/api/v1/calendar/events/${eventId}`, { method: "DELETE" });
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff