// This file is auto-generated by @hey-api/openapi-ts import { type Options as ClientOptions, type TDataShape, type Client, urlSearchParamsBodySerializer, formDataBodySerializer, } from "@hey-api/client-axios"; import type { RootGetData, RootGetResponse, RegisterData, RegisterResponse, RegisterError, LoginData, LoginResponse, LoginError, LoginOauthData, LoginOauthResponse, LoginOauthError, RefreshTokenData, RefreshTokenResponse, RefreshTokenError, ChangePasswordData, ChangePasswordError, GetCurrentUserInfoData, GetCurrentUserInfoResponse, ListEventThemesData, ListEventThemesResponse, ListEventThemesError, CreateEventThemeData, CreateEventThemeResponse, CreateEventThemeError, DeleteEventThemeData, DeleteEventThemeError, GetEventThemeData, GetEventThemeResponse, GetEventThemeError, UpdateEventThemeData, UpdateEventThemeResponse, UpdateEventThemeError, GetGuestsData, GetGuestsResponse, GetGuestsError, CreateGuestData, CreateGuestResponse, CreateGuestError, DeleteGuestData, DeleteGuestResponse, DeleteGuestError, GetGuestData, GetGuestResponse, GetGuestError, UpdateGuestData, UpdateGuestResponse, UpdateGuestError, SetGuestStatusData, SetGuestStatusResponse, SetGuestStatusError, CreateGuestRsvpData, CreateGuestRsvpResponse, CreateGuestRsvpError, GetRsvpsData, GetRsvpsResponse, GetRsvpsError, CreateRsvpData, CreateRsvpResponse, CreateRsvpError, DeleteRsvpData, DeleteRsvpResponse, DeleteRsvpError, GetRsvpData, GetRsvpResponse, GetRsvpError, UpdateRsvpData, UpdateRsvpResponse, UpdateRsvpError, UpdateRsvpStatusData, UpdateRsvpStatusResponse, UpdateRsvpStatusError, CreateEventData, CreateEventResponse, CreateEventError, GetUserEventsData, GetUserEventsResponse, GetUserEventsError, GetUpcomingEventsData, GetUpcomingEventsResponse, GetUpcomingEventsError, GetPublicEventsData, GetPublicEventsResponse, GetPublicEventsError, DeleteEventData, DeleteEventResponse, DeleteEventError, GetEventData, GetEventResponse, GetEventError, UpdateEventData, UpdateEventResponse, UpdateEventError, GetEventBySlugData, GetEventBySlugResponse, GetEventBySlugError, GeneratePresignedUrlData, GeneratePresignedUrlResponse, GeneratePresignedUrlError, UploadFileData, UploadFileError, } from "./types.gen"; import { client as _heyApiClient } from "./client.gen"; export type Options< TData extends TDataShape = TDataShape, ThrowOnError extends boolean = boolean, > = ClientOptions & { /** * You can provide a client instance returned by `createClient()` instead of * individual options. This might be also useful if you want to implement a * custom client. */ client?: Client; /** * You can pass arbitrary values through the `meta` object. This can be * used to access values that aren't defined as part of the SDK function. */ meta?: Record; }; /** * Root */ export const rootGet = ( options?: Options, ) => { return (options?.client ?? _heyApiClient).get< RootGetResponse, unknown, ThrowOnError >({ responseType: "text", url: "/", ...options, }); }; /** * Register User * Register a new user. * * Returns: * The created user information. */ export const register = ( options: Options, ) => { return (options.client ?? _heyApiClient).post< RegisterResponse, RegisterError, ThrowOnError >({ url: "/api/v1/auth/register", ...options, headers: { "Content-Type": "application/json", ...options?.headers, }, }); }; /** * Login * Login with username and password. * * Returns: * Access and refresh tokens. */ export const login = ( options: Options, ) => { return (options.client ?? _heyApiClient).post< LoginResponse, LoginError, ThrowOnError >({ url: "/api/v1/auth/login", ...options, headers: { "Content-Type": "application/json", ...options?.headers, }, }); }; /** * Login Oauth * OAuth2-compatible login endpoint, used by the OpenAPI UI. * * Returns: * Access and refresh tokens. */ export const loginOauth = ( options: Options, ) => { return (options.client ?? _heyApiClient).post< LoginOauthResponse, LoginOauthError, ThrowOnError >({ ...urlSearchParamsBodySerializer, url: "/api/v1/auth/login/oauth", ...options, headers: { "Content-Type": "application/x-www-form-urlencoded", ...options?.headers, }, }); }; /** * Refresh Token * Refresh access token using a refresh token. * * Returns: * New access and refresh tokens. */ export const refreshToken = ( options: Options, ) => { return (options.client ?? _heyApiClient).post< RefreshTokenResponse, RefreshTokenError, ThrowOnError >({ url: "/api/v1/auth/refresh", ...options, headers: { "Content-Type": "application/json", ...options?.headers, }, }); }; /** * Change Password * Change current user's password. * * Requires authentication. */ export const changePassword = ( options: Options, ) => { return (options.client ?? _heyApiClient).post< unknown, ChangePasswordError, ThrowOnError >({ security: [ { scheme: "bearer", type: "http", }, ], url: "/api/v1/auth/change-password", ...options, headers: { "Content-Type": "application/json", ...options?.headers, }, }); }; /** * Get Current User Info * Get current user information. * * Requires authentication. */ export const getCurrentUserInfo = ( options?: Options, ) => { return (options?.client ?? _heyApiClient).get< GetCurrentUserInfoResponse, unknown, ThrowOnError >({ security: [ { scheme: "bearer", type: "http", }, ], url: "/api/v1/auth/me", ...options, }); }; /** * List Themes * List event themes. */ export const listEventThemes = ( options?: Options, ) => { return (options?.client ?? _heyApiClient).get< ListEventThemesResponse, ListEventThemesError, ThrowOnError >({ url: "/api/v1/event_themes/", ...options, }); }; /** * Create Theme */ export const createEventTheme = ( options: Options, ) => { return (options.client ?? _heyApiClient).post< CreateEventThemeResponse, CreateEventThemeError, ThrowOnError >({ security: [ { scheme: "bearer", type: "http", }, ], url: "/api/v1/event_themes/", ...options, headers: { "Content-Type": "application/json", ...options?.headers, }, }); }; /** * Delete Theme * Delete specific theme by ID. */ export const deleteEventTheme = ( options: Options, ) => { return (options.client ?? _heyApiClient).delete< unknown, DeleteEventThemeError, ThrowOnError >({ security: [ { scheme: "bearer", type: "http", }, ], url: "/api/v1/event_themes/{theme_id}", ...options, }); }; /** * Get Theme * Get specific theme by ID. */ export const getEventTheme = ( options: Options, ) => { return (options.client ?? _heyApiClient).get< GetEventThemeResponse, GetEventThemeError, ThrowOnError >({ url: "/api/v1/event_themes/{theme_id}", ...options, }); }; /** * Update Theme */ export const updateEventTheme = ( options: Options, ) => { return (options.client ?? _heyApiClient).patch< UpdateEventThemeResponse, UpdateEventThemeError, ThrowOnError >({ security: [ { scheme: "bearer", type: "http", }, ], url: "/api/v1/event_themes/{theme_id}", ...options, headers: { "Content-Type": "application/json", ...options?.headers, }, }); }; /** * Read Guests */ export const getGuests = ( options?: Options, ) => { return (options?.client ?? _heyApiClient).get< GetGuestsResponse, GetGuestsError, ThrowOnError >({ url: "/api/v1/events/guests/", ...options, }); }; /** * Create Guest */ export const createGuest = ( options: Options, ) => { return (options.client ?? _heyApiClient).post< CreateGuestResponse, CreateGuestError, ThrowOnError >({ url: "/api/v1/events/guests/", ...options, headers: { "Content-Type": "application/json", ...options?.headers, }, }); }; /** * Delete Guest */ export const deleteGuest = ( options: Options, ) => { return (options.client ?? _heyApiClient).delete< DeleteGuestResponse, DeleteGuestError, ThrowOnError >({ url: "/api/v1/events/guests/{guest_id}", ...options, }); }; /** * Read Guest */ export const getGuest = ( options: Options, ) => { return (options.client ?? _heyApiClient).get< GetGuestResponse, GetGuestError, ThrowOnError >({ url: "/api/v1/events/guests/{guest_id}", ...options, }); }; /** * Update Guest */ export const updateGuest = ( options: Options, ) => { return (options.client ?? _heyApiClient).put< UpdateGuestResponse, UpdateGuestError, ThrowOnError >({ url: "/api/v1/events/guests/{guest_id}", ...options, headers: { "Content-Type": "application/json", ...options?.headers, }, }); }; /** * Set Guest Status */ export const setGuestStatus = ( options: Options, ) => { return (options.client ?? _heyApiClient).patch< SetGuestStatusResponse, SetGuestStatusError, ThrowOnError >({ url: "/api/v1/events/guests/{guest_id}/status", ...options, }); }; /** * Process Guest Rsvp */ export const createGuestRsvp = ( options: Options, ) => { return (options.client ?? _heyApiClient).post< CreateGuestRsvpResponse, CreateGuestRsvpError, ThrowOnError >({ url: "/api/v1/events/guests/{guest_id}/rsvp", ...options, headers: { "Content-Type": "application/json", ...options?.headers, }, }); }; /** * Read Rsvps */ export const getRsvps = ( options?: Options, ) => { return (options?.client ?? _heyApiClient).get< GetRsvpsResponse, GetRsvpsError, ThrowOnError >({ url: "/api/v1/events/rsvps/", ...options, }); }; /** * Create Rsvp */ export const createRsvp = ( options: Options, ) => { return (options.client ?? _heyApiClient).post< CreateRsvpResponse, CreateRsvpError, ThrowOnError >({ url: "/api/v1/events/rsvps/", ...options, headers: { "Content-Type": "application/json", ...options?.headers, }, }); }; /** * Delete Rsvp */ export const deleteRsvp = ( options: Options, ) => { return (options.client ?? _heyApiClient).delete< DeleteRsvpResponse, DeleteRsvpError, ThrowOnError >({ url: "/api/v1/events/rsvps/{rsvp_id}", ...options, }); }; /** * Read Rsvp */ export const getRsvp = ( options: Options, ) => { return (options.client ?? _heyApiClient).get< GetRsvpResponse, GetRsvpError, ThrowOnError >({ url: "/api/v1/events/rsvps/{rsvp_id}", ...options, }); }; /** * Update Rsvp */ export const updateRsvp = ( options: Options, ) => { return (options.client ?? _heyApiClient).put< UpdateRsvpResponse, UpdateRsvpError, ThrowOnError >({ url: "/api/v1/events/rsvps/{rsvp_id}", ...options, headers: { "Content-Type": "application/json", ...options?.headers, }, }); }; /** * Update Rsvp Status */ export const updateRsvpStatus = ( options: Options, ) => { return (options.client ?? _heyApiClient).patch< UpdateRsvpStatusResponse, UpdateRsvpStatusError, ThrowOnError >({ url: "/api/v1/events/rsvps/{rsvp_id}/status", ...options, headers: { "Content-Type": "application/json", ...options?.headers, }, }); }; /** * Create Event * Create a new event. */ export const createEvent = ( options: Options, ) => { return (options.client ?? _heyApiClient).post< CreateEventResponse, CreateEventError, ThrowOnError >({ security: [ { scheme: "bearer", type: "http", }, ], url: "/api/v1/events/", ...options, headers: { "Content-Type": "application/json", ...options?.headers, }, }); }; /** * Get User Events * Get all events created by the current user with pagination. */ export const getUserEvents = ( options?: Options, ) => { return (options?.client ?? _heyApiClient).get< GetUserEventsResponse, GetUserEventsError, ThrowOnError >({ security: [ { scheme: "bearer", type: "http", }, ], url: "/api/v1/events/me", ...options, }); }; /** * Get Upcoming Events * Get upcoming public events with pagination. */ export const getUpcomingEvents = ( options?: Options, ) => { return (options?.client ?? _heyApiClient).get< GetUpcomingEventsResponse, GetUpcomingEventsError, ThrowOnError >({ security: [ { scheme: "bearer", type: "http", }, ], url: "/api/v1/events/upcoming", ...options, }); }; /** * Get Public Events * Get all public events with pagination. */ export const getPublicEvents = ( options?: Options, ) => { return (options?.client ?? _heyApiClient).get< GetPublicEventsResponse, GetPublicEventsError, ThrowOnError >({ url: "/api/v1/events/public", ...options, }); }; /** * Delete Event * Delete event (soft delete by default). */ export const deleteEvent = ( options: Options, ) => { return (options.client ?? _heyApiClient).delete< DeleteEventResponse, DeleteEventError, ThrowOnError >({ security: [ { scheme: "bearer", type: "http", }, ], url: "/api/v1/events/{event_id}", ...options, }); }; /** * Get Event * Get event by ID. */ export const getEvent = ( options: Options, ) => { return (options.client ?? _heyApiClient).get< GetEventResponse, GetEventError, ThrowOnError >({ security: [ { scheme: "bearer", type: "http", }, ], url: "/api/v1/events/{event_id}", ...options, }); }; /** * Update Event * Update event. */ export const updateEvent = ( options: Options, ) => { return (options.client ?? _heyApiClient).put< UpdateEventResponse, UpdateEventError, ThrowOnError >({ security: [ { scheme: "bearer", type: "http", }, ], url: "/api/v1/events/{event_id}", ...options, headers: { "Content-Type": "application/json", ...options?.headers, }, }); }; /** * Get Event By Slug * Get event by slug. */ export const getEventBySlug = ( options: Options, ) => { return (options.client ?? _heyApiClient).get< GetEventBySlugResponse, GetEventBySlugError, ThrowOnError >({ security: [ { scheme: "bearer", type: "http", }, ], url: "/api/v1/events/by-slug/{slug}", ...options, }); }; /** * Generate Presigned Url * Generate a presigned URL for uploading a file. * * This endpoint creates a secure token that allows direct upload to the storage system. * After successful upload, the file will be accessible at the returned file_url. */ export const generatePresignedUrl = ( options: Options, ) => { return (options.client ?? _heyApiClient).post< GeneratePresignedUrlResponse, GeneratePresignedUrlError, ThrowOnError >({ security: [ { scheme: "bearer", type: "http", }, ], url: "/api/v1/uploads/presigned-url", ...options, headers: { "Content-Type": "application/json", ...options?.headers, }, }); }; /** * Upload File * Upload a file using a presigned URL token. * * This endpoint handles the actual file upload after a presigned URL is generated. * The token validates the upload permissions and destination. */ export const uploadFile = ( options: Options, ) => { return (options.client ?? _heyApiClient).post< unknown, UploadFileError, ThrowOnError >({ ...formDataBodySerializer, url: "/api/v1/uploads/{token}", ...options, headers: { "Content-Type": null, ...options?.headers, }, }); };