/** * Shared constants for Livo API */ declare const ticketPriorityValues: readonly ["low", "medium", "high", "urgent"]; declare const ticketStatusValues: readonly ["todo", "inprogress", "done", "cancelled"]; declare const ticketVisibilityValues: readonly ["public", "internal"]; declare const voteStatusValues: readonly ["active", "closed", "cancelled"]; type TicketPriority = (typeof ticketPriorityValues)[number]; type TicketStatus = (typeof ticketStatusValues)[number]; type TicketVisibility = (typeof ticketVisibilityValues)[number]; type VoteStatus = (typeof voteStatusValues)[number]; interface CreateLivoClientOptions { baseUrl: string; getHeaders?: () => Promise> | Record; } /** * Create a Livo API client * * @example * ```typescript * const rpc = createLivoClient({ * baseUrl: 'https://livo.pro', * getHeaders: async () => ({ * 'Authorization': `Bearer ${token}` * }) * }) * * const invitations = await rpc.auth.invitations.getPending() * ``` */ declare function createLivoClient(options: CreateLivoClientOptions): LivoClient; /** * The Livo API client type with all available procedures */ interface LivoClient { auth: { invitations: { getPending: () => Promise; accept: (input: AcceptInvitationInput) => Promise; decline: (input: DeclineInvitationInput) => Promise<{ success: boolean; }>; }; }; org: { sites: { create: (input: CreateSiteInput) => Promise; list: (input: OrgSlugInput) => Promise; getDashboard: (input: OrgSlugInput) => Promise; }; agenda: { getUpcomingEvents: (input: OrgSlugInput) => Promise; getAgendaEvents: (input: GetAgendaEventsInput) => Promise; createEvent: (input: CreateEventInput) => Promise; updateEvent: (input: UpdateEventInput) => Promise; deleteEvent: (input: DeleteEventInput) => Promise<{ success: boolean; }>; getEventById: (input: GetEventByIdInput) => Promise; }; }; site: { tickets: { create: (input: CreateTicketInput) => Promise; list: (input: SiteSlugInput) => Promise; get: (input: GetTicketInput) => Promise; }; generic: { getSiteDetails: (input: SiteSlugInput) => Promise; getSiteSettings: (input: SiteSlugInput) => Promise; updateSiteSettings: (input: UpdateSiteSettingsInput) => Promise; }; announcements: { get: (input: SiteSlugInput) => Promise; upsert: (input: UpsertAnnouncementInput) => Promise; }; votes: { create: (input: CreateVoteInput) => Promise; list: (input: SiteSlugInput) => Promise; get: (input: GetVoteInput) => Promise; getPending: (input: SiteSlugInput) => Promise; cast: (input: CastVoteInput) => Promise<{ success: boolean; }>; update: (input: UpdateVoteInput) => Promise; remove: (input: DeleteVoteInput) => Promise<{ success: boolean; }>; sendReminder: (input: SendVoteReminderInput) => Promise<{ success: boolean; }>; getMyVotes: (input: SiteSlugInput) => Promise; }; }; } interface OrgSlugInput { orgSlug: string; } interface SiteSlugInput { siteSlug: string; } interface PendingInvitation { id: string; type: "orgInvitation" | "siteInvitation"; email: string; role: "admin" | "manager" | "member"; createdAt: Date; expiresAt: Date; organization?: { id: string; name: string; slug: string; }; site?: { id: string; name: string; slug: string; }; } interface AcceptInvitationInput { invitationId: string; invitationType: "orgInvitation" | "siteInvitation"; } interface AcceptInvitationResult { success: boolean; orgSlug?: string; siteSlug?: string; } interface DeclineInvitationInput { invitationId: string; invitationType: "orgInvitation" | "siteInvitation"; } interface Site { id: string; name: string; slug: string; orgId: string; createdAt: Date; updatedAt: Date | null; } interface SiteListItem { id: string; name: string; slug: string; address?: string; city?: string; } interface DashboardData { totalSites: number; totalMembers: number; recentTickets: TicketListItem[]; upcomingEvents: EventOccurrence[]; } interface CreateSiteInput extends OrgSlugInput { name: string; } interface EventOccurrence { id: string; title: string; location: string | null; startDate: Date; endDate: Date; allDay: boolean; eventType: "one-time" | "recurring"; site: { id: string; name: string; slug: string; } | null; isRecurringInstance: boolean; } interface AgendaEvent { id: string; title: string; description: string | null; location: string | null; startDate: Date; endDate: Date; allDay: boolean; eventType: "one-time" | "recurring"; recurrenceRule: string | null; recurrenceEndDate: Date | null; siteId: string | null; orgId: string; creatorId: string; createdAt: Date; updatedAt: Date | null; site?: { id: string; name: string; slug: string; } | null; creator?: { id: string; name: string; email: string; image: string | null; }; } interface GetAgendaEventsInput extends OrgSlugInput { startDate: Date; endDate: Date; } interface CreateEventInput extends OrgSlugInput { title: string; description?: string; location?: string; startDate: Date; endDate: Date; allDay: boolean; eventType: "one-time" | "recurring"; recurrenceRule?: string; recurrenceEndDate?: Date; siteId?: string; } interface UpdateEventInput extends OrgSlugInput { id: string; title?: string; description?: string; location?: string; startDate?: Date; endDate?: Date; allDay?: boolean; recurrenceRule?: string; recurrenceEndDate?: Date; } interface DeleteEventInput extends OrgSlugInput { id: string; } interface GetEventByIdInput extends OrgSlugInput { eventId: string; } interface Ticket { id: string; title: string; description: string | null; location: string | null; status: TicketStatus; priority: TicketPriority; visibility: TicketVisibility; siteId: string; orgId: string; authorId: string; assigneeId: string | null; createdAt: Date; updatedAt: Date | null; } interface TicketListItem { id: string; title: string; status: TicketStatus; priority: TicketPriority; location: string | null; createdAt: Date; author: { id: string; name: string; }; } interface TicketDetail extends Ticket { author: { id: string; name: string; email: string; image: string | null; }; assignee?: { id: string; name: string; email: string; image: string | null; } | null; site: { id: string; name: string; slug: string; }; } interface CreateTicketInput extends SiteSlugInput { title: string; priority: TicketPriority; location: string; description?: string; visibility?: TicketVisibility; } interface GetTicketInput extends SiteSlugInput { ticketId: string; } interface SiteDetails { id: string; name: string; slug: string; address: string | null; city: string | null; state: string | null; zipCode: string | null; description: string | null; organization: { id: string; name: string; slug: string; }; } interface SiteSettings { id: string; name: string; address: string | null; city: string | null; state: string | null; zipCode: string | null; description: string | null; } interface UpdateSiteSettingsInput extends SiteSlugInput { name: string; address: string; city: string; state: string; zipCode: string; description?: string; } interface Announcement { id: string; title: string; content: string; isEnabled: boolean; siteId: string; createdAt: Date; updatedAt: Date | null; } interface UpsertAnnouncementInput extends SiteSlugInput { title: string; content: string; isEnabled: boolean; } interface VoteOption { id: string; label: string; } interface VoteRequest { id: string; title: string; description: string | null; status: VoteStatus; expiresAt: Date; allowMultipleChoices: boolean; options: VoteOption[]; siteId: string; orgId: string; createdById: string; createdAt: Date; updatedAt: Date | null; } interface VoteRequestListItem { id: string; title: string; status: VoteStatus; expiresAt: Date; participantCount: number; votedCount: number; createdAt: Date; } interface VoteRequestDetail extends VoteRequest { participants: VoteParticipant[]; responses: VoteResponse[]; createdBy: { id: string; name: string; email: string; image: string | null; }; } interface VoteParticipant { id: string; userId: string; hasVoted: boolean; votedAt: Date | null; user: { id: string; name: string; email: string; image: string | null; }; } interface VoteResponse { id: string; userId: string; selectedOptionIds: string[]; createdAt: Date; } interface PendingVote { id: string; title: string; expiresAt: Date; options: VoteOption[]; allowMultipleChoices: boolean; } interface MyVote { id: string; title: string; status: VoteStatus; expiresAt: Date; myResponse: { selectedOptionIds: string[]; votedAt: Date; } | null; } interface CreateVoteInput extends SiteSlugInput { title: string; description?: string; expiresAt: Date; allowMultipleChoices?: boolean; options: VoteOption[]; participantIds: string[]; } interface GetVoteInput extends SiteSlugInput { voteId: string; } interface CastVoteInput extends SiteSlugInput { voteRequestId: string; selectedOptionIds: string[]; } interface UpdateVoteInput extends SiteSlugInput { id: string; title?: string; description?: string; expiresAt?: Date; status?: VoteStatus; } interface DeleteVoteInput extends SiteSlugInput { id: string; } interface SendVoteReminderInput extends SiteSlugInput { voteRequestId: string; participantIds?: string[]; } export { type AcceptInvitationInput, type AcceptInvitationResult, type AgendaEvent, type Announcement, type CastVoteInput, type CreateEventInput, type CreateLivoClientOptions, type CreateSiteInput, type CreateTicketInput, type CreateVoteInput, type DashboardData, type DeclineInvitationInput, type DeleteEventInput, type DeleteVoteInput, type EventOccurrence, type GetAgendaEventsInput, type GetEventByIdInput, type GetTicketInput, type GetVoteInput, type LivoClient, type MyVote, type OrgSlugInput, type PendingInvitation, type PendingVote, type SendVoteReminderInput, type Site, type SiteDetails, type SiteListItem, type SiteSettings, type SiteSlugInput, type Ticket, type TicketDetail, type TicketListItem, type TicketPriority, type TicketStatus, type TicketVisibility, type UpdateEventInput, type UpdateSiteSettingsInput, type UpdateVoteInput, type UpsertAnnouncementInput, type VoteOption, type VoteParticipant, type VoteRequest, type VoteRequestDetail, type VoteRequestListItem, type VoteResponse, type VoteStatus, createLivoClient, ticketPriorityValues, ticketStatusValues, ticketVisibilityValues, voteStatusValues };