import { Redis } from "@upstash/redis"; //#region src/types/common.d.ts /** * Common types shared across the Hostex API */ /** * Common response structure for all Hostex API endpoints */ interface HostexApiResponse { /** Unique identifier for the request */ request_id: string; /** Error code. 200 indicates success */ error_code: number; /** Status message */ error_msg: string; /** Response data (present on successful requests) */ data?: T; } /** * Channel types supported by Hostex */ type ChannelType = 'airbnb' | 'booking.com' | 'agoda' | 'expedia' | 'vrbo' | 'trip.com' | 'booking_site' | 'tujia_intl' | 'hostex_direct' | 'tujia' | 'xiaozhu' | 'meituan_bnb' | 'meituan_hotel' | 'muniao' | 'fliggy' | 'zhukeyun' | 'tiktok' | 'xiaohongshu' | 'ctrip' | 'houfy'; /** * Channel types that can be used in API requests */ type ChannelTypeParam = 'airbnb' | 'booking.com' | 'agoda' | 'expedia' | 'vrbo' | 'trip.com' | 'booking_site' | 'tujia_intl' | 'houfy'; /** * The unique identifier for different channels * For example, the listing id for Airbnb is the Airbnb listing id, * and the listing id for Booking.com is the Booking.com room id - rateplan id */ type ListingId = string; /** * Pagination parameters */ interface PaginationParams { /** The starting point from which to begin returning results */ offset?: number; /** The maximum number of results to return. Maximum value is 100 */ limit?: number; } /** * Channel and listing identifier */ interface ChannelListing { /** The type of the channel */ channel_type: ChannelType; /** The listing ID */ listing_id: ListingId; /** The currency code for the reservation amounts */ currency?: string; } /** * Money amount with currency */ interface MoneyAmount { /** Currency code */ currency: string; /** Amount */ amount: number; } /** * Time with hour and minute */ interface TimeOfDay { hour: number; minute: number; } //#endregion //#region src/types/properties.d.ts /** * Property query parameters */ interface PropertiesQueryParams extends PaginationParams { /** The id of the property */ id?: number; /** Filter properties belonging to the given group id */ group_id?: number; /** Filter properties attached to the given tag id */ tag_id?: number; } /** * A group a property belongs to */ interface PropertyGroupRef { /** Unique identifier for the group */ id: number; /** Name of the group */ name: string; } /** * A tag attached to a property */ interface PropertyTagRef { /** Unique identifier for the tag */ id: number; /** Name of the tag */ name: string; /** Color of the tag, in hex format (e.g. #FD587B) */ color?: string; } /** * Property information */ interface Property { /** Unique identifier for the property */ id: number; /** Title of the property */ title: string; /** List of channels associated with the property */ channels: ChannelListing[]; /** Address of the property */ address?: string; /** Longitude of the property */ longitude?: string; /** Latitude of the property */ latitude?: string; /** IANA timezone of the property (e.g. 'America/Toronto') */ timezone?: string; /** Default check-in time (e.g. '15:00') */ default_checkin_time?: string; /** Default check-out time (e.g. '11:00') */ default_checkout_time?: string; /** Groups the property belongs to */ groups?: PropertyGroupRef[]; /** Tags attached to the property */ tags?: PropertyTagRef[]; } /** * Properties response data */ interface PropertiesData { /** List of properties */ properties: Property[]; /** Total number of properties */ total: number; } /** * Create property parameters */ interface CreatePropertyParams { /** Title of the new property. Must be unique within the operator. */ title: string; } /** * Create property response data */ interface CreatePropertyData { /** Unique identifier of the newly created property */ property_id: number; } //#endregion //#region src/types/room-types.d.ts /** * Room type query parameters */ interface RoomTypesQueryParams extends PaginationParams { /** Fetch a single room type by id */ id?: number; /** Filter room types attached to the given tag id */ tag_id?: number; } /** * Property reference in room type */ interface RoomTypeProperty { /** Unique identifier for the property */ id: number; /** The title of the property */ title: string; } /** * Room type information */ interface RoomType { /** Unique identifier for the room type */ id: number; /** Title of the room type */ title: string; /** * A list of properties associated with the room type. * The number of properties represents the maximum inventory quantity for the room type. */ properties: RoomTypeProperty[]; /** List of channels associated with the room type */ channels: ChannelListing[]; /** Tags attached to the room type */ tags?: PropertyTagRef[]; } /** * Room types response data */ interface RoomTypesData { /** List of room types */ room_types: RoomType[]; /** Total number of room types */ total: number; } /** * Create room type parameters */ interface CreateRoomTypeParams { /** Title of the new room type. Must be unique within the operator. */ title: string; /** Optional list of property ids to link to the new room type */ property_ids?: number[]; } /** * Create room type response data */ interface CreateRoomTypeData { /** Unique identifier of the newly created room type */ room_type_id: number; } //#endregion //#region src/types/reservations.d.ts /** * Reservation status */ type ReservationStatus = 'wait_accept' | 'wait_pay' | 'accepted' | 'cancelled' | 'denied' | 'timeout'; /** * Guest ID type */ type GuestIdType = 'passport' | 'id_card' | 'others'; /** * Guest gender */ type GuestGender = 'male' | 'female'; /** * Reservation query order by */ type ReservationOrderBy = 'booked_at' | 'check_in_date' | 'check_out_date' | 'cancelled_at' | 'created_at'; /** * Stay status */ type StayStatus = 'checkin_pending' | 'in_house' | 'stay_completed'; /** * ID-registration requirement level for a stay * - `not_required`: no ID required * - `required`: guest must upload an ID, no manual review * - `required_with_review`: guest must upload an ID and the host must approve it */ type IdRequiredLevel = 'not_required' | 'required' | 'required_with_review'; /** * An additional fee parsed from channel remarks (e.g. city tax) */ interface AdditionalFee { /** The name of the fee item, as provided by the channel */ name?: string; /** The currency code of the fee */ currency?: string; /** The amount of the fee */ amount?: number; } /** * An ID document image uploaded through the online check-in guide */ interface CheckinGuideImage { /** Internal ID of the image record */ id?: number; /** ID of the guest this image is linked to; null if not yet associated */ client_id?: number | null; /** Extra-large variant URL of the uploaded image */ url?: string | null; } /** * An ID document image uploaded for a specific guest */ interface GuestIdImage { /** Internal ID of the image record */ id?: number; /** Extra-large variant URL of the uploaded image */ url?: string | null; } /** * Tax amount of a reservation */ interface ReservationTax { /** The currency code */ currency?: string; /** The tax amount */ amount?: number; } /** * Guest information */ interface Guest { /** Guest ID */ id: number; /** Guest name */ name: string | null; /** Guest phone */ phone: string | null; /** Guest email */ email: string | null; /** ID type */ id_type?: GuestIdType | null; /** ID number */ id_number?: string | null; /** Gender */ gender?: GuestGender | null; /** Country (ISO 3166-1 Alpha-2) */ country?: string | null; /** Whether this is the booker */ is_booker: boolean; /** ID document images uploaded for this guest */ id_images?: GuestIdImage[]; } /** * Rate detail item */ interface RateDetail { /** Type of the rate detail */ type: string; /** Description of the rate detail */ description: string; /** Currency code */ currency: string; /** Amount */ amount: number; } /** * Reservation rates */ interface ReservationRates { /** The order rate includes commission */ total_rate?: { currency: string; amount: number; }; /** The total commission of the order */ total_commission?: { currency: string; amount: number; }; /** The reservation rate includes commission */ rate?: { currency: string; amount: number; }; /** The commission of the reservation */ commission?: { currency: string; amount: number; }; /** The rate details of the reservation */ details?: RateDetail[]; /** The taxes of the reservation; null if the reservation has no taxes */ tax?: ReservationTax | null; } /** * Check-in details */ interface CheckInDetails { /** The arrival time of the reservation */ arrival_at?: TimeOfDay | null; /** The departure time of the reservation */ departure_at?: TimeOfDay | null; /** The lock code of the reservation */ lock_code?: string | null; /** The lock code will be visible after this time (HH:mm format) */ lock_code_visible_after?: string; /** The deposit amount in the host's currency */ deposit?: number; /** ID-registration requirement for this stay (defaults to not_required) */ id_required?: IdRequiredLevel; /** The check-in guide URL */ check_in_guide_url?: string; } /** * Custom channel */ interface CustomChannel { /** ID of the custom channel */ id: number; /** Name of the custom channel */ name: string; } /** * Reservation information */ interface Reservation { /** The reservation code */ reservation_code: string; /** The stay code of the reservation */ stay_code: string; /** The reservation ID in the channel */ channel_id: string; /** The property ID */ property_id: number; /** The type of the channel */ channel_type: ChannelType; /** The listing ID */ listing_id: ListingId; /** The check-in date (YYYY-MM-DD) */ check_in_date: string; /** The check-out date (YYYY-MM-DD) */ check_out_date: string; /** The total number of guests */ number_of_guests: number; /** The number of adults */ number_of_adults?: number; /** The number of children */ number_of_children?: number; /** The number of infants */ number_of_infants?: number; /** The number of pets */ number_of_pets?: number; /** Reservation status */ status: ReservationStatus; /** The default name of the guest */ guest_name?: string | null; /** The default phone of the guest */ guest_phone?: string | null; /** The default email of the guest */ guest_email?: string | null; /** When the reservation was cancelled (ISO 8601) */ cancelled_at?: string | null; /** When the reservation was booked (ISO 8601) */ booked_at: string; /** When the reservation was created in Hostex (ISO 8601) */ created_at: string; /** The creator name of the reservation */ creator?: string; /** Rates information */ rates?: ReservationRates; /** Check-in details */ check_in_details?: CheckInDetails; /** Remarks from the Hostex Host Portal */ remarks?: string; /** Remarks from the channel */ channel_remarks?: string; /** The conversation ID */ conversation_id?: string; /** Tags from the Hostex Host Portal */ tags?: string[]; /** Custom channel */ custom_channel?: CustomChannel; /** Guest information */ guests?: Guest[]; /** Custom fields */ custom_fields?: Record | null; /** Whether the reservation is in the reservation box */ in_reservation_box?: boolean; /** Additional fees parsed from channel remarks (e.g. city tax) */ additional_fees?: AdditionalFee[]; /** ID images uploaded via the online check-in guide for this reservation */ checkin_guide_images?: CheckinGuideImage[]; } /** * Reservations query parameters */ interface ReservationsQueryParams extends PaginationParams { /** Filter by reservation code */ reservation_code?: string; /** Filter by property ID */ property_id?: number; /** Filter by status */ status?: ReservationStatus; /** Filter by check-in date start (inclusive) */ start_check_in_date?: string; /** Filter by check-in date end (inclusive) */ end_check_in_date?: string; /** Filter by check-out date start (inclusive) */ start_check_out_date?: string; /** Filter by check-out date end (inclusive) */ end_check_out_date?: string; /** Sort by field */ order_by?: ReservationOrderBy; /** Filter by channel type */ channel_type?: ChannelType; /** Filters by the reservation ID in the channel (matches the channel_id response field) */ channel_id?: string; } /** * Create reservation parameters */ interface CreateReservationParams { /** The id of the property for the reservation */ property_id: string; /** The id of the custom channel */ custom_channel_id: number; /** The check-in date (YYYY-MM-DD) */ check_in_date: string; /** The check-out date (YYYY-MM-DD) */ check_out_date: string; /** The total number of guests */ number_of_guests?: number; /** The name of the primary guest */ guest_name: string; /** The email address of the primary guest */ email?: string; /** The mobile phone number of the primary guest */ mobile?: string; /** The currency code */ currency: string; /** The total rate amount */ rate_amount: number; /** The commission amount */ commission_amount: number; /** The total amount received */ received_amount: number; /** The income method ID */ income_method_id: number; /** Additional remarks */ remarks?: string; } /** * Update check-in details parameters */ interface UpdateCheckInDetailsParams { /** The stay code */ stay_code: string; /** The lock code (set to null to remove) */ lock_code?: string | null; /** Time after which lock code is visible (HH:mm format, set to null to remove) */ lock_code_visible_after?: string | null; /** Expected arrival time (set to null to remove) */ arrival_at?: TimeOfDay | null; /** Expected departure time (set to null to remove) */ departure_at?: TimeOfDay | null; /** Deposit amount in host's currency */ deposit?: number; /** ID-registration requirement for this stay */ id_required?: IdRequiredLevel; } /** * Update reservation basic info parameters */ interface UpdateReservationBasicInfoParams { /** * The stay code the update targets (the API path is /reservations/{stay_code}) */ stay_code?: string; /** * The reservation code * @deprecated Use stay_code — the API targets the stay */ reservation_code?: string; /** Remarks for the reservation */ remarks?: string; /** The account of the creator */ creator?: string; /** The id of the custom channel */ custom_channel_id?: number; /** The check-in date (YYYY-MM-DD) */ check_in_date?: string; /** The check-out date (YYYY-MM-DD) */ check_out_date?: string; /** The total number of guests */ number_of_guests?: number; /** The name of the primary guest */ guest_name?: string; /** The mobile phone number of the guest */ mobile?: string; /** The email address of the guest */ email?: string; /** The currency code */ currency?: string; /** The total rate amount (0-999999) */ rate_amount?: number; /** The commission amount (0-999999) */ commission_amount?: number; } /** * Update stay status parameters */ interface UpdateStayStatusParams { /** The stay code */ stay_code: string; /** The new stay status */ stay_status: StayStatus; } /** * Add tag parameters */ interface AddTagParams { /** The stay code */ stay_code: string; /** The tag name to add */ tag_name: string; } /** * Remove tag parameters */ interface RemoveTagParams { /** The stay code */ stay_code: string; /** The tag name to remove */ tag_name: string; } /** * Move to box parameters */ interface MoveToBoxParams { /** The stay code to move to the box */ stay_code: string; } /** * Allocate to property parameters */ interface AllocateToPropertyParams { /** The stay code to allocate */ stay_code: string; /** The property ID to allocate to */ property_id: number; } /** * Custom fields update parameters */ interface UpdateCustomFieldsParams { /** The stay code */ stay_code: string; /** Custom fields to update (set to null to delete) */ custom_fields: Record; } /** * Custom fields response */ interface CustomFieldsData { /** Custom fields */ custom_fields: Record | null; } /** * Reservations response data */ interface ReservationsData { /** List of reservations */ reservations: Reservation[]; } /** * Custom channels response data */ interface CustomChannelsData { /** List of custom channels */ custom_channels: CustomChannel[]; } /** * Income method */ interface IncomeMethod { /** ID of the income method */ id: number; /** Name of the income method */ name: string; } /** * Income methods response data * Note: OpenAPI spec has a bug where the field is named "custom_channels" * but required field is "income_methods". We include both for compatibility. */ interface IncomeMethodsData { /** List of income methods (semantic name) */ income_methods?: IncomeMethod[]; } /** * Create reservation response data */ interface CreateReservationData { /** The created reservation */ reservation: { /** The reservation code */ reservation_code: string; }; } //#endregion //#region src/types/availabilities.d.ts /** * Availability-related types */ /** * Availability for a specific date */ interface Availability { /** The date (YYYY-MM-DD) */ date: string; /** Whether the date is available */ available: boolean; /** Remarks for the date */ remarks: string; } /** * Property availability */ interface PropertyAvailability { /** The unique identifier for the property */ id: number; /** A list of availability objects */ availabilities: Availability[]; } /** * Availabilities query parameters */ interface AvailabilitiesQueryParams { /** Property IDs (comma-separated or array). Max 100 properties */ property_ids: string | number[]; /** Start date (YYYY-MM-DD, within 1 year from now) */ start_date: string; /** End date (YYYY-MM-DD, within 3 years from now) */ end_date: string; } /** * Availabilities response data * Note: OpenAPI spec has inconsistency - required field is "properties" * but schema defines field as "listings". We support both for safety. */ interface AvailabilitiesData { /** List of property availabilities (per schema definition) */ /** List of property availabilities (per required field) */ properties?: PropertyAvailability[]; } /** * Update availabilities parameters */ interface UpdateAvailabilitiesParams { /** Property IDs to update */ property_ids: number[]; /** Start date (YYYY-MM-DD). Either this+end_date OR dates must be provided */ start_date?: string; /** End date (YYYY-MM-DD). Either this+start_date OR dates must be provided */ end_date?: string; /** List of specific dates (YYYY-MM-DD). Either this OR start_date+end_date must be provided */ dates?: string[]; /** Availability status (true = available, false = unavailable) */ available: boolean; } //#endregion //#region src/types/calendars.d.ts /** * Listing restrictions */ interface ListingRestrictions { /** Reservations for check-in on this date are not allowed */ closed_on_arrival?: boolean; /** Reservations for check-out on this date are not allowed */ closed_on_departure?: boolean; /** Min stay for reservations including this date */ min_stay_on_arrival?: number; /** Max stay for reservations including this date */ max_stay_on_arrival?: number; /** Min stay through (booking.com, agoda) */ min_stay_through?: number; /** Max stay through (booking.com) */ max_stay_through?: number; /** Min advance reservation in format 'xDxH' (booking.com) */ min_advance_reservation?: string; /** Max advance reservation in format 'xDxH' (booking.com) */ max_advance_reservation?: string; /** Exact stay required for check-in on this date (booking.com) */ exact_stay_on_arrival?: number; } /** * Calendar day information */ interface CalendarDay { /** The date (YYYY-MM-DD) */ date: string; /** The price for the date */ price: number; /** The inventory for the date */ inventory: number; /** Restrictions for the date */ restrictions?: ListingRestrictions; } /** * Listing calendar */ interface ListingCalendar { /** The listing ID */ listing_id: ListingId; /** The channel type */ channel_type: ChannelType; /** Calendar data */ calendar: CalendarDay[]; } /** * Listing reference for calendar query */ interface ListingReference { /** Channel type */ channel_type: ChannelTypeParam; /** Listing ID */ listing_id: ListingId; } /** * Calendar query parameters */ interface CalendarQueryParams { /** Start date (YYYY-MM-DD, within 1 year from now) */ start_date: string; /** End date (YYYY-MM-DD, within 3 years from now) */ end_date: string; /** List of listings to query */ listings: ListingReference[]; } /** * Calendar response data */ interface CalendarData { /** List of listing calendars */ listings: ListingCalendar[]; } /** * Inventory update item */ interface InventoryUpdate { /** Start date (YYYY-MM-DD) */ start_date: string; /** End date (YYYY-MM-DD, within 3 years from now) */ end_date: string; /** Number of available units */ inventory: number; } /** * Update listing inventories parameters */ interface UpdateListingInventoriesParams { /** Channel type */ channel_type: ChannelTypeParam; /** Listing ID */ listing_id: ListingId; /** Inventory updates */ inventories: InventoryUpdate[]; } /** * Price update item */ interface PriceUpdate { /** Start date (YYYY-MM-DD) */ start_date: string; /** End date (YYYY-MM-DD, within 3 years from now) */ end_date: string; /** Price (e.g., 100 = 100 USD, not cents) */ price: number; } /** * Update listing prices parameters */ interface UpdateListingPricesParams { /** Channel type */ channel_type: ChannelTypeParam; /** Listing ID */ listing_id: ListingId; /** Price updates */ prices: PriceUpdate[]; } /** * Restriction update item */ interface RestrictionUpdate extends ListingRestrictions { /** Start date (YYYY-MM-DD) */ start_date: string; /** End date (YYYY-MM-DD, within 3 years from now) */ end_date: string; } /** * Update listing restrictions parameters */ interface UpdateListingRestrictionsParams { /** Channel type */ channel_type: ChannelTypeParam; /** Listing ID */ listing_id: ListingId; /** Restriction updates */ restrictions: RestrictionUpdate[]; } //#endregion //#region src/types/messages.d.ts /** * Conversation guest information */ interface ConversationGuest { /** Guest name */ name: string; /** Guest email */ email?: string; /** Guest phone */ phone?: string; } /** * Conversation summary */ interface Conversation { /** The conversation ID */ id: string; /** Channel type */ channel_type: ChannelType; /** Last message timestamp (ISO 8601) */ last_message_at: string; /** Guest information */ guest: ConversationGuest; /** Property title */ property_title?: string; /** Check-in date */ check_in_date?: string; /** Check-out date */ check_out_date?: string; } /** * Conversations query parameters */ interface ConversationsQueryParams { /** Starting index */ offset?: number; /** Max results (max 100) */ limit?: number; } /** * Conversations response data */ interface ConversationsData { /** List of conversations */ conversations: Conversation[]; } /** * Activity type */ type ActivityType = 'inquiry' | 'reservation'; /** * Room type reference */ interface RoomTypeReference { /** Room type ID */ id: number; /** Room type title */ title: string; } /** * Property reference in activity */ interface ActivityProperty { /** Property ID */ id: number; /** Property title */ title: string; /** Cover image URL */ cover_url?: string | null; /** Room type */ room_type?: RoomTypeReference | null; } /** * Conversation activity */ interface ConversationActivity { /** Activity type */ activity_type: ActivityType; /** Reservation code */ reservation_code?: string | null; /** Check-in date */ check_in_date?: string | null; /** Check-out date */ check_out_date?: string | null; /** Listing ID */ listing_id?: string | null; /** Property details */ property?: ActivityProperty | null; } /** * Message display type */ type MessageDisplayType = 'Text' | 'Box' | 'FileAttachment' | 'RequestToBook' | 'BsRequestBook' | 'SpecialOffer' | 'ReservationAlteration' | 'HouseLinkCard'; /** * Message sender role */ type SenderRole = 'host' | 'guest'; /** * A document cited by HostGPT as a knowledge source */ interface MessageSourceDoc { /** Title of the source document */ title?: string; /** Quoted text fragments from this source */ fragment?: string[]; /** Same as the parent source type */ source_type?: string; /** Internal id linking back to the underlying record */ link_id?: number; } /** * Knowledge sources cited by HostGPT for a message, grouped by type */ interface MessageSource { /** Source group type (e.g. checkin_guide, automation_reply, host_knowledge) */ type?: string; /** Individual documents grouped under this source type */ docs?: MessageSourceDoc[]; } /** * Message */ interface Message { /** Message ID */ id: string; /** Sender role */ sender_role: SenderRole; /** Display type */ display_type: MessageDisplayType; /** Text content */ content: string; /** Attachment (if any) */ attachment?: unknown | null; /** When the message was created (ISO 8601) */ created_at: string; /** Display name of the sender when known (operator name, `HostGPT`, or null) */ sender_name?: string | null; /** Knowledge sources cited by HostGPT to generate this message */ sources?: MessageSource[]; } /** * Conversation details */ interface ConversationDetails { /** Conversation ID */ id: string; /** Channel type */ channel_type: ChannelType; /** Guest information */ guest: ConversationGuest; /** Activities */ activities: ConversationActivity[]; /** Notes */ note?: string; /** Messages */ messages: Message[]; } /** * Conversation details response data */ interface ConversationDetailsData extends ConversationDetails {} /** * Send message parameters */ interface SendMessageParams { /** Conversation ID */ conversation_id: string; /** Text message content */ message?: string; /** Base64 encoded JPEG image */ jpeg_base64?: string; } /** * Update conversation note parameters */ interface UpdateConversationNoteParams { /** The id of the conversation */ conversation_id: string; /** The host-side private note; empty string or null clears it */ note: string | null; } /** * Update conversation note response data */ interface UpdateConversationNoteData { /** The id of the conversation */ id: string; /** The current note value after the update (null when cleared) */ note: string | null; /** When the note was last updated (ISO 8601) */ updated_at?: string | null; } //#endregion //#region src/types/reviews.d.ts /** * Review status */ type ReviewStatus = 'pending_guest_review' | 'pending_host_review' | 'reviewed'; /** * Category-level sub-score on a review */ interface ReviewSubScore { /** The rating category (e.g. accuracy, checkin, cleanliness, communication, location, value) */ category?: string; /** The rating score (1-5 for Airbnb; 1-10 for Booking.com guest reviews) */ rating?: number; /** Structured tags associated with the category rating */ review_category_tags?: string[] | null; } /** * Review content */ interface ReviewContent { /** Rating score (0-5) */ score: number; /** Comment text */ content: string; /** When the review was created (ISO 8601) */ created_at: string; /** Category-level sub-scores; null when not available */ sub_score?: ReviewSubScore[] | null; } /** * Host reply to guest review */ interface HostReply { /** Reply text */ content: string; /** When the reply was created (ISO 8601) */ created_at: string; } /** * Review information */ interface Review { /** The reservation code */ reservation_code: string; /** The property ID */ property_id: number; /** Channel type */ channel_type: ChannelType; /** Listing ID */ listing_id: ListingId; /** Check-in date (YYYY-MM-DD) */ check_in_date: string; /** Check-out date (YYYY-MM-DD) */ check_out_date: string; /** Host's review of the guest */ host_review?: ReviewContent | null; /** Guest's review of their stay */ guest_review?: ReviewContent | null; /** Host's reply to guest review */ host_reply?: HostReply | null; } /** * Reviews query parameters */ interface ReviewsQueryParams { /** Filter by reservation code */ reservation_code?: string; /** Filter by property ID */ property_id?: number; /** Filter by review status (default: 'reviewed') */ review_status?: ReviewStatus; /** Filter by check-out date start (default: 180 days ago) */ start_check_out_date?: string; /** Filter by check-out date end (default: today) */ end_check_out_date?: string; /** Starting index (default: 0) */ offset?: number; /** Max results (max 100, default: 20) */ limit?: number; } /** * Reviews response data */ interface ReviewsData { /** List of reviews */ reviews: Review[]; } /** * Per-category sub-ratings submitted with a host review * Only effective for channels that support category ratings (currently Airbnb and Zhenguo). * Each value is between 0 and 5 (`recommend` is 0/1). */ interface ReviewCategoryRatings { /** Overall rating of the guest (0-5) */ overall_rating?: number; /** Cleanliness rating (0-5) */ cleanliness?: number; /** Communication rating (0-5) */ communication?: number; /** Respect of house rules rating (0-5) */ respect_of_house_rules?: number; /** Whether the guest is recommended (0/1) */ recommend?: number; } /** * Create/update review parameters */ interface CreateReviewParams { /** Reservation code */ reservation_code: string; /** Host review score (0-5) */ host_review_score?: number; /** Host review comment */ host_review_content?: string; /** Host reply to guest review */ host_reply_content?: string; /** Optional per-category sub-ratings submitted together with the host review */ category_ratings?: ReviewCategoryRatings; } //#endregion //#region src/types/webhooks.d.ts /** * Webhooks-related types */ /** * Base webhook payload with common fields */ interface WebhookPayloadBase { /** The type of webhook event */ event: string; /** ISO 8601 timestamp of the event */ timestamp: string; } /** * Reservation created webhook payload */ interface ReservationCreatedPayload extends WebhookPayloadBase { event: 'reservation_created'; /** Hostex reservation code */ reservation_code: string; /** Hostex stay code */ stay_code: string; } /** * Sub-event types for reservation_updated */ type ReservationUpdatedSubEvent = 'arrival_and_departure_time_updated' | 'rates_updated' | 'lock_code_updated' | 'lock_code_deleted' | 'check_in_details_updated'; /** * Reservation updated webhook payload */ interface ReservationUpdatedPayload extends WebhookPayloadBase { event: 'reservation_updated'; /** Hostex reservation code */ reservation_code: string; /** Hostex stay code */ stay_code: string; /** Optional sub-event type */ sub_event?: ReservationUpdatedSubEvent; } /** * Property availability entry */ interface AvailabilityEntry { /** Date in YYYY-MM-DD format */ date: string; /** Whether the property is available */ available: boolean; } /** * Property availability updated webhook payload */ interface PropertyAvailabilityUpdatedPayload extends WebhookPayloadBase { event: 'property_availability_updated'; /** Hostex property ID */ property_id: number; /** List of availability entries */ availabilities: AvailabilityEntry[]; } /** * Listing calendar updated webhook payload */ interface ListingCalendarUpdatedPayload extends WebhookPayloadBase { event: 'listing_calendar_updated'; /** Channel type (e.g., 'airbnb', 'booking') */ channel_type: string; /** Listing ID on the channel */ listing_id: string; /** Start date in YYYY-MM-DD format */ start_date: string; /** End date in YYYY-MM-DD format */ end_date: string; } /** * Message created webhook payload */ interface MessageCreatedPayload extends WebhookPayloadBase { event: 'message_created'; /** Conversation ID */ conversation_id: string; /** Message ID */ message_id: string; } /** * Review created webhook payload */ interface ReviewCreatedPayload extends WebhookPayloadBase { event: 'review_created'; /** Hostex reservation code */ reservation_code: string; /** Hostex stay code */ stay_code: string; } /** * Review updated webhook payload */ interface ReviewUpdatedPayload extends WebhookPayloadBase { event: 'review_updated'; /** Hostex reservation code */ reservation_code: string; /** Hostex stay code */ stay_code: string; } /** * Union type of all webhook payloads */ type WebhookPayload = ReservationCreatedPayload | ReservationUpdatedPayload | PropertyAvailabilityUpdatedPayload | ListingCalendarUpdatedPayload | MessageCreatedPayload | ReviewCreatedPayload | ReviewUpdatedPayload; /** * All possible webhook event types */ type WebhookEventType = WebhookPayload['event']; /** * Webhook information */ interface Webhook { /** Unique webhook ID */ id: number; /** Webhook URL */ url: string; /** The list of event types this webhook subscribes to */ events: WebhookEventType[]; /** Whether the webhook can be managed (deleted) */ manageable: boolean; /** When the webhook was created (ISO 8601) */ created_at: string; } /** * Webhooks response data */ interface WebhooksData { /** List of webhooks */ webhooks: Webhook[]; } /** * Create webhook parameters */ interface CreateWebhookParams { /** Webhook URL */ url: string; /** The list of event types to subscribe to; defaults to all events if omitted */ events?: WebhookEventType[]; } /** * Update webhook parameters */ interface UpdateWebhookParams { /** Webhook ID */ id: string; /** New webhook URL */ url?: string; /** Event types to subscribe to */ events?: WebhookEventType[]; } /** * Delete webhook parameters */ interface DeleteWebhookParams { /** Webhook ID */ id: string; } //#endregion //#region src/types/oauth.d.ts /** * OAuth-related types */ /** * OAuth grant type */ type OAuthGrantType = 'authorization_code' | 'refresh_token'; /** * Obtain/refresh token parameters */ interface OAuthTokenParams { /** Client ID */ client_id: string; /** Client secret */ client_secret: string; /** Grant type */ grant_type: OAuthGrantType; /** Authorization code (required if grant_type is 'authorization_code') */ code?: string; /** Refresh token (required if grant_type is 'refresh_token') */ refresh_token?: string; } /** * OAuth token response */ interface OAuthTokenData { /** Access token */ access_token: string; /** Refresh token */ refresh_token: string; /** Token expiration in seconds */ expires_in: number; } /** * Revoke token parameters */ interface RevokeTokenParams { /** Client ID */ client_id: string; /** Client secret */ client_secret: string; /** Token to revoke (access or refresh token) */ token: string; } //#endregion //#region src/types/listings.d.ts /** Channel account authorization status */ type ChannelAccountAuthStatus = 'active' | 'connecting' | 'disconnected' | 'exception' | 'unknown'; /** * A connected OTA channel account */ interface ChannelAccount { /** Internal id of the channel account */ id?: number; /** The type of the channel */ channel_type?: ChannelType; /** Login username / identifier on the channel side */ username?: string; /** Account id on the channel side (when available) */ origin_account_id?: string; /** Current authorization / connection status */ auth_status?: ChannelAccountAuthStatus; /** When the account was connected (ISO 8601 UTC) */ created_at?: string | null; } /** * Channel accounts query parameters */ interface ChannelAccountsQueryParams { /** Internal id of a specific channel account */ id?: number; /** Filter by channel type */ channel_type?: ChannelType; /** The starting point from which to begin returning results (default 0) */ offset?: number; /** The maximum number of results to return, max 100 (default 20) */ limit?: number; } /** * Channel accounts response data */ interface ChannelAccountsData { channel_accounts: ChannelAccount[]; /** Total number of matching channel accounts */ total: number; } /** Listing shelf status on the channel side */ type ListingShelfStatus = 'on' | 'off' | 'deleted' | 'unknown'; /** * A synced channel listing record (NOT the `ChannelListing` channel/listing-id pair in common.ts — * that name is taken, hence `ChannelListingRecord`) */ interface ChannelListingRecord { /** Internal id of the listing record */ id?: number; /** Channel-side listing id (matches listing_id used in other endpoints) */ listing_id?: string; /** The type of the channel */ channel_type?: ChannelType; /** Internal id of the channel account this listing belongs to */ channel_account_id?: number; /** Account id on the channel side */ origin_account_id?: string; /** URL of the listing on the channel's website */ url?: string | null; /** Listing title as shown on the channel */ title?: string; /** Cover image URL */ cover?: string | null; /** Inventory (number of units) reported by the channel */ inventory?: number; /** Listing shelf status on the channel side */ shelf_status?: ListingShelfStatus; /** Normalized channel-side listing metadata; schema varies by channel */ metadata?: Record | null; /** When the listing record was created in Hostex (ISO 8601 UTC) */ created_at?: string | null; /** Last update time of the listing record (ISO 8601 UTC) */ updated_at?: string | null; } /** * Listings query parameters */ interface ListingsQueryParams { /** Internal id of a channel account (from GET /channel_accounts) */ channel_account_id?: number; /** Channel-side listing id */ listing_id?: string; /** Filter by channel type */ channel_type?: ChannelType; /** The starting point from which to begin returning results (default 0) */ offset?: number; /** The maximum number of results to return, max 100 (default 20) */ limit?: number; } /** * Listings response data */ interface ListingsData { listings: ChannelListingRecord[]; /** Total number of matching listings */ total: number; } /** A discount rule expressed as percentage + day threshold */ interface DaysDiscount { /** Discount percentage */ discount?: number; /** Day threshold the discount applies to */ days?: number; } /** Detailed pet fee object (mutually exclusive with the flat pet_fee) */ interface AirbnbPetFee { amount?: number; charge_type?: string; charge_period?: string; } /** * Airbnb listing settings; all fields optional — only provided fields are updated */ interface AirbnbPriceAndRulesSettings { /** The listing currency code, e.g. USD */ listing_currency?: string; /** The default nightly price */ base_price?: number; /** The Friday and Saturday nightly price */ weekend_price?: number; /** The security deposit amount */ security_deposit?: number; /** The cleaning fee amount */ cleaning_fee?: number; /** The short-term cleaning fee amount */ short_term_cleaning_fee?: number; /** The pet fee amount; mutually exclusive with pet_fee_obj */ pet_fee?: number; /** The detailed pet fee; mutually exclusive with pet_fee */ pet_fee_obj?: AirbnbPetFee | null; /** The fee charged per extra guest */ extra_guest_fee?: number; /** Early bird discount rule(s) */ early_bird_discount?: DaysDiscount | DaysDiscount[]; /** Last minute discount rule(s) */ last_minute_discount?: DaysDiscount | DaysDiscount[]; /** Long term discount rule(s) */ long_term_discount?: DaysDiscount | DaysDiscount[]; /** Check-in start time: hour 8-24, 25/26 for 1am/2am next day, or 'FLEXIBLE' */ check_in_start_time?: number | string; /** Check-in end time: hour 9-26 or 'FLEXIBLE' */ check_in_end_time?: number | string; /** Check-out latest time, hour 0-23 */ check_out_before?: number; /** Whether instant booking is allowed */ instant_booking?: boolean; /** The number of guests included in the base price */ max_guests?: number; /** The default minimum number of nights */ minimum_stay?: number; /** The default maximum number of nights */ maximum_stay?: number; /** Booking lead time in hours */ advance_notice?: number; /** How far in advance (days) the calendar is bookable */ availability_window?: number; /** Turnover/preparation days between reservations */ preparation_time?: number; /** Days of week (0=Sunday..6=Saturday) on which check-in IS allowed */ days_of_week_check_in?: number[]; /** Days of week (0=Sunday..6=Saturday) on which check-out IS allowed */ days_of_week_check_out?: number[]; /** Allow request-to-book for stays exceeding maximum nights */ allow_rtb_above_max_nights?: boolean; /** The cancellation policy category */ cancellation_policy?: string | number; /** The long-term-stay cancellation policy id */ long_term_cancellation_policy?: string | number; /** Non-refundable discount percentage (0-100) */ non_refundable_price_factor?: number; /** Per-day-of-week minimum nights rule */ day_of_week_min_nights?: unknown; /** Seasonal minimum nights rules */ seasonal_min_stay?: unknown[]; /** Enable the Airbnb new listing promotion */ new_listing_promotion?: boolean; } interface UpdateAirbnbPriceAndRulesParams { /** The Airbnb listing id */ listing_id: string; /** The settings to update */ settings: AirbnbPriceAndRulesSettings; } /** Per-day-of-week nightly prices; all seven days required when provided */ interface VrboNightlyRate { sunday: number; monday: number; tuesday: number; wednesday: number; thursday: number; friday: number; saturday: number; } /** * Vrbo listing settings; all fields optional — only provided fields are updated */ interface VrboPriceAndRulesSettings { /** Default nightly price for every day of the week (takes precedence over nightly_rate) */ base_price?: number; /** Per-day-of-week nightly prices */ nightly_rate?: VrboNightlyRate; /** Security deposit amount; 0 clears it */ security_deposit?: number; /** Cleaning fee amount; 0 clears it */ cleaning_fee?: number; /** Fee charged per extra guest; 0 clears it */ extra_guest_fee?: number; /** The number of guests after which the extra guest fee applies */ extra_guest_number?: number; /** The maximum number of guests */ max_guests?: number; /** Weekly stay discount percentage (0-99) */ weekly_discount?: number; /** Monthly stay discount percentage (0-99) */ monthly_discount?: number; /** The earliest check-in time */ check_in_start_time?: number | string; /** The latest check-out time */ check_out_before?: number | string; /** Whether instant booking is allowed */ instant_booking?: boolean; /** The default minimum number of nights */ minimum_stay?: number; /** Booking lead time / advance notice */ advance_notice?: number; /** How far in advance the calendar is bookable */ availability_window?: number; } interface UpdateVrboPriceAndRulesParams { /** The Vrbo listing id */ listing_id: string; /** The settings to update */ settings: VrboPriceAndRulesSettings; } //#endregion //#region src/types/pricing-ratios.d.ts /** * Pricing ratios query parameters — exactly one of property_id / room_type_id */ interface PricingRatiosQueryParams { /** Id of the property to read ratios for (mutually exclusive with room_type_id) */ property_id?: number; /** Id of the room type to read ratios for (mutually exclusive with property_id) */ room_type_id?: number; } /** * Per-listing pricing ratio entry */ interface PricingRatioChannel { /** The type of the channel */ channel_type: ChannelType; /** The channel listing id */ listing_id: string; /** Display title of the listing on the channel */ listing_title?: string; /** Pricing ratio in percent: 100 = same as base price, >100 markup, <100 discount; -1 when readonly is true (do not use for price computation) */ ratio: number; /** True when the listing's price is controlled by the channel */ readonly: boolean; } /** * Pricing ratios response data */ interface PricingRatiosData { /** Which of property_id / room_type_id was supplied */ link_type: 'property' | 'room_type'; /** Echoes the supplied id */ link_id: number; /** One entry per OTA listing currently linked */ channels: PricingRatioChannel[]; } //#endregion //#region src/types/calendar-share-links.d.ts /** * Hostex Calendar Share Links API types */ /** Share link scope */ type CalendarShareLinkScope = 'entire' | 'partial'; /** * A public read-only calendar share link */ interface CalendarShareLink { /** Internal share link id */ id: number; /** entire = all properties; partial = only property_ids */ scope: CalendarShareLinkScope; /** Public, read-only calendar URL */ url: string; /** Property ids the link exposes (empty when scope = entire) */ property_ids: number[]; /** ISO 8601 creation timestamp */ created_at?: string | null; } /** * Calendar share links query parameters */ interface CalendarShareLinksQueryParams { /** Pagination offset (default 0) */ offset?: number; /** Page size, max 100 (default 20) */ limit?: number; /** Fetch a single share link by id */ id?: number; } /** * Calendar share links response data */ interface CalendarShareLinksData { /** Total number of share links matching the filter */ total: number; calendar_share_links: CalendarShareLink[]; } /** * Create calendar share link parameters */ interface CreateCalendarShareLinkParams { /** entire exposes every property; partial exposes only property_ids */ scope: CalendarShareLinkScope; /** Required (non-empty) when scope = partial */ property_ids?: number[]; } /** * Create calendar share link response data */ interface CreateCalendarShareLinkData { calendar_share_link: CalendarShareLink; } //#endregion //#region src/types/groups.d.ts /** * Hostex Groups API types */ /** * A property group */ interface Group { /** Unique identifier for the group */ id: number; /** Name of the group */ name: string; /** Property ids that belong to this group */ property_ids: number[]; } /** * Groups query parameters */ interface GroupsQueryParams { /** The starting point from which to begin returning results */ offset?: number; /** The maximum number of results to return, max 100 */ limit?: number; /** The id of the group */ id?: number; } /** * Groups response data */ interface GroupsData { groups: Group[]; /** Total number of groups */ total: number; } /** * Create group parameters */ interface CreateGroupParams { /** Group display name, max 50 chars, unique within the operator */ name: string; /** Optional property ids to attach to the new group */ property_ids?: number[]; } /** * Create group response data */ interface CreateGroupData { group: Group; } /** * Update group parameters */ interface UpdateGroupParams { /** The id of the group to update */ id: number; /** New display name (unique within the operator) */ name?: string; /** Replaces the group's property list */ property_ids?: number[]; } //#endregion //#region src/types/tags.d.ts /** * Hostex Tags API types (property / room type tags) */ /** Allowed tag palette colors */ type TagColor = '#FD587B' | '#1BBFA4' | '#FFA410' | '#F3D432' | '#2CBCFD' | '#7175FA' | '#EF7EDE'; /** * A property / room type tag */ interface Tag { /** Unique identifier for the tag */ id: number; /** Name of the tag */ name: string; /** Color of the tag, in hex format (e.g. #FD587B) */ color: string; /** Property ids attached with this tag */ property_ids: number[]; /** Room type ids attached with this tag */ room_type_ids: number[]; } /** * Tags query parameters */ interface TagsQueryParams { /** The starting point from which to begin returning results */ offset?: number; /** The maximum number of results to return, max 100 */ limit?: number; /** The id of the tag */ id?: number; } /** * Tags response data */ interface TagsData { tags: Tag[]; /** Total number of tags */ total: number; } /** * Create tag parameters */ interface CreateTagParams { /** Tag display name, max 15 chars, unique within the operator */ name: string; /** Hex color from the allowed palette; auto-assigned when omitted */ color?: TagColor; /** Optional property ids to attach */ property_ids?: number[]; /** Optional room type ids to attach */ room_type_ids?: number[]; } /** * Create tag response data */ interface CreateTagData { tag: Tag; } /** * Update tag parameters */ interface UpdateTagParams { /** The id of the tag to update */ id: number; /** New display name (unique within the operator) */ name?: string; /** Hex color from the allowed palette */ color?: TagColor; /** Replaces the tag's property list */ property_ids?: number[]; /** Replaces the tag's room type list */ room_type_ids?: number[]; } //#endregion //#region src/types/reservation-tags.d.ts /** * Hostex Reservation Tags API types (the tag dictionary applied to stays) */ /** * A reservation tag dictionary entry */ interface ReservationTag { /** Internal tag id */ id: number; /** Display name of the tag */ tag_name: string; /** Hex color string (e.g. #FFA416) */ color: string; /** True for system default tags shared across all operators (cannot be deleted) */ is_default: boolean; } /** * Reservation tags query parameters */ interface ReservationTagsQueryParams { /** Pagination offset (default 0) */ offset?: number; /** Page size, max 100 (default 20) */ limit?: number; /** Fetch a single tag by id */ id?: number; /** Case-insensitive substring match on tag_name */ keyword?: string; } /** * Reservation tags response data */ interface ReservationTagsData { /** Total number of tags matching the filter */ total: number; reservation_tags: ReservationTag[]; } /** * Create reservation tag parameters */ interface CreateReservationTagParams { /** Tag display name, max 15 characters */ tag_name: string; } /** * Create reservation tag response data */ interface CreateReservationTagData { reservation_tag: ReservationTag; } //#endregion //#region src/types/staffs.d.ts /** * Hostex Staffs API types */ /** * A staff member */ interface Staff { /** Unique identifier for the staff */ id: number; /** Name of the staff */ name: string; /** Mobile number */ mobile?: string; /** Email address */ email?: string; /** Note attached to the staff */ note?: string; /** Whether the staff is active */ is_active: boolean; } /** * Staffs query parameters */ interface StaffsQueryParams { /** The starting point from which to begin returning results */ offset?: number; /** The maximum number of results to return, max 100 */ limit?: number; /** The id of the staff */ id?: number; /** Filter by active state: 1 active only, 0 inactive only */ is_active?: 0 | 1; } /** * Staffs response data */ interface StaffsData { staffs: Staff[]; /** Total number of staffs */ total: number; } /** * Create staff parameters */ interface CreateStaffParams { /** Display name (max 128 characters) */ name: string; /** Mobile number; international operators use `+ ` */ mobile: string; /** Email address */ email?: string; /** Free-form note (max 500 characters) */ note?: string; /** Properties this staff can access; omit to grant all */ property_ids?: number[]; } /** * Create staff response data */ interface CreateStaffData { /** Unique identifier of the newly created staff */ staff_id: number; } /** * Update staff parameters */ interface UpdateStaffParams { /** The id of the staff to update */ id: number; name?: string; mobile?: string; email?: string; note?: string; /** Enable (true) or disable (false) the staff */ is_active?: boolean; /** Replaces the staff's property assignment list; empty array removes all */ property_ids?: number[]; } //#endregion //#region src/types/tasks.d.ts /** * Hostex Tasks API types */ /** Task category */ type TaskType = 'cleaning' | 'maintenance' | 'reception' | 'room_service' | 'other'; /** Task status */ type TaskStatus = 'pending' | 'in_progress' | 'completed' | 'cancelled'; /** Cleaning level (only meaningful for cleaning tasks) */ type TaskLevel = 'standard' | 'simple' | 'advanced'; /** * A property operations task * (Named HostexTask to avoid clashing with Task-style names in consumer codebases) */ interface HostexTask { /** Unique identifier for the task */ id: number; /** Task type */ type: TaskType; /** Task status */ status: TaskStatus; /** Property id, null if unbound */ property_id?: number | null; /** Title of the property */ property_title?: string | null; /** Linked stay code, null when not linked to a reservation */ stay_code?: string | null; /** Assigned staff id, null if unassigned */ staff_id?: number | null; /** Assigned staff name */ staff_name?: string | null; /** Expected execution date (YYYY-MM-DD) */ expected_date?: string; /** Expected execution time (HH:mm:ss); may be null */ expected_time?: string | null; /** Expected execution datetime (YYYY-MM-DD HH:mm:ss) */ expected?: string; /** Cleaning level */ level?: TaskLevel | null; /** Currency code for the fee */ currency?: string | null; /** Task fee */ fee?: number; /** Note attached to the task */ note?: string; /** Creation time (YYYY-MM-DD HH:mm:ss) */ create_time?: string | null; /** Last update time (YYYY-MM-DD HH:mm:ss) */ update_time?: string | null; } /** * Tasks query parameters */ interface TasksQueryParams { /** Internal id of a specific task */ id?: number; /** The starting point from which to begin returning results */ offset?: number; /** The maximum number of results to return, max 100 */ limit?: number; /** Start of the expected date range (YYYY-MM-DD) */ start_date?: string; /** End of the expected date range (YYYY-MM-DD) */ end_date?: string; /** Filter tasks assigned to the given staff id */ staff_id?: number; /** Filter tasks under the given property id */ property_id?: number; /** Filter tasks by type */ type?: TaskType; /** Filter tasks by status */ status?: TaskStatus; } /** * Tasks response data */ interface TasksData { tasks: HostexTask[]; /** Total number of tasks */ total: number; } /** * Create task parameters */ interface CreateTaskParams { /** Task category */ type: TaskType; /** Stay code to link the task to a reservation */ stay_code?: string; /** Property id; omit to record an unassigned task */ property_id?: number; /** Staff id to assign; omit to leave unassigned */ staff_id?: number; /** Expected execution date (YYYY-MM-DD, operator timezone) */ expected_date: string; /** Expected execution time (HH:mm:ss, operator timezone) */ expected_time?: string; /** Cleaning level (only meaningful when type=cleaning) */ level?: TaskLevel; /** Currency code for fee */ currency: string; /** Task fee (defaults to 0) */ fee?: number; /** Free-form note (max 500 characters) */ note?: string; } /** * Create task response data */ interface CreateTaskData { /** Unique identifier of the newly created task */ task_id: number; } /** * Update task parameters */ interface UpdateTaskParams { /** The id of the task to update */ id: number; type?: TaskType; /** Pass 0 to detach the task from any property */ property_id?: number; /** Pass 0 to unassign the task */ staff_id?: number; /** Expected execution date (YYYY-MM-DD, operator timezone) */ expected_date?: string; /** Expected execution time (HH:mm:ss, operator timezone) */ expected_time?: string; level?: TaskLevel; status?: TaskStatus; currency?: string; fee?: number; note?: string; } //#endregion //#region src/types/transactions.d.ts /** * Hostex Incomes & Expenses (Transactions) API types */ /** A dictionary entry (income/expense item or method) */ interface FinanceDictionaryEntry { /** The id of the entry */ id: number; /** The name of the entry */ name: string; } /** * Income items response data */ interface IncomeItemsData { income_items: FinanceDictionaryEntry[]; } /** * Expense items response data */ interface ExpenseItemsData { expense_items: FinanceDictionaryEntry[]; } /** * Expense methods response data */ interface ExpenseMethodsData { expense_methods: FinanceDictionaryEntry[]; } /** Transaction direction */ type TransactionDirection = 'income' | 'expense'; /** Transaction payment status */ type TransactionStatus = 'paid' | 'outstanding'; /** What a transaction entry is linked to */ type TransactionLinkType = 'property' | 'reservation' | 'operator'; /** * An income / expense entry */ interface Transaction { /** Unique identifier of the entry */ id: number; /** income = money received, expense = money spent */ direction: TransactionDirection; /** Absolute amount, always non-negative */ amount: number; /** The currency code of the entry */ currency: string; /** Payment status */ status?: TransactionStatus; /** When the action took place (ISO 8601 UTC) */ action_at?: string | null; /** Item categorization id (income_items or expense_items by direction) */ item_id?: number | null; /** Human-readable item name */ item_name?: string | null; /** Payment method id (income_methods or expense_methods by direction) */ payment_method_id?: number | null; /** Human-readable payment method name */ payment_method_name?: string | null; /** Free-form note */ note?: string; /** Creator display name, or `System` */ operator_name?: string; /** What the entry is linked to */ link_type?: TransactionLinkType; /** Related property id, if any */ property_id?: number | null; /** Related property title */ property_title?: string | null; /** Linked stay_code, null when not reservation-linked */ stay_code?: string | null; /** Creation time (ISO 8601 UTC) */ created_at?: string; /** Last update time (ISO 8601 UTC) */ updated_at?: string; } /** * Transactions query parameters */ interface TransactionsQueryParams { /** Internal id of a specific entry */ id?: number; /** Start of the action time range, inclusive (YYYY-MM-DD) */ start_date?: string; /** End of the action time range, inclusive (YYYY-MM-DD) */ end_date?: string; /** The starting point from which to begin returning results */ offset?: number; /** The maximum number of results to return, max 100 */ limit?: number; /** Filter entries linked to the given property id */ property_id?: number; /** Filter entries linked to the given stay */ stay_code?: string; /** Filter by direction */ direction?: TransactionDirection; /** Filter by item categorization id */ item_id?: number; /** Filter by payment method id */ payment_method_id?: number; /** Filter by currency code */ currency?: string; /** Substring match on the entry note */ keyword?: string; } /** * Transactions response data */ interface TransactionsData { transactions: Transaction[]; /** Total number of entries matching the filters */ total: number; } /** * Create transaction parameters */ interface CreateTransactionParams { /** Property to record against; mutually exclusive with stay_code */ property_id?: number; /** Stay to record against; mutually exclusive with property_id */ stay_code?: string; /** income = money received, expense = money spent */ direction: TransactionDirection; /** Absolute amount; always positive, sign derived from direction */ amount: number; /** Currency code; required unless stay_code is provided */ currency?: string; /** Item categorization id (from income_items / expense_items by direction) */ item_id: number; /** Payment method id (from income_methods / expense_methods by direction) */ payment_method_id: number; /** When the action took place (ISO 8601); defaults to now */ action_at?: string; /** Free-form note (max 500 characters) */ note?: string; } /** * Create transaction response data */ interface CreateTransactionData { /** Unique identifier of the newly created entry */ transaction_id: number; } /** * Update transaction parameters */ interface UpdateTransactionParams { /** The id of the entry to update */ id: number; /** New absolute amount (always positive) */ amount?: number; /** New item categorization id */ item_id?: number; /** New payment method id */ payment_method_id?: number; /** New action time (ISO 8601) */ action_at?: string; /** New free-form note (max 500 characters) */ note?: string; } //#endregion //#region src/types/knowledge-bases.d.ts /** * Hostex Knowledge Bases API types (HostGPT knowledge) */ /** Property scope type */ type KnowledgeBasePropertyScopeType = 'all' | 'by_property' | 'by_group' | 'by_room_type'; /** Channel scope type */ type KnowledgeBaseChannelScopeType = 'all' | 'by_channel'; /** Processing status of a knowledge base entry */ type KnowledgeBaseProcessStatus = 'waiting' | 'processing' | 'done' | 'failed'; /** * Property scope of a knowledge base entry */ interface KnowledgeBasePropertyScope { /** Scope type */ type: KnowledgeBasePropertyScopeType; /** Scope ids: [-1] for all; property/group/room-type ids per type */ ids: number[]; } /** * Channel scope of a knowledge base entry */ interface KnowledgeBaseChannelScope { /** Scope type */ type: KnowledgeBaseChannelScopeType; /** Channel names; ['unlimited'] for all */ channels: string[]; } /** * A content block of a knowledge base entry */ interface KnowledgeBaseContent { /** The content text */ text: string; /** The subtitle for this content block */ sub_title: string; } /** * A knowledge base list entry */ interface KnowledgeBaseSummary { /** Unique identifier */ id: number; /** Property scope */ scope_property: KnowledgeBasePropertyScope; /** Channel scope */ scope_channel: KnowledgeBaseChannelScope; /** Whether the entry is enabled */ is_enable: boolean; /** Title of the entry */ title: string; /** Processing status */ process_status: KnowledgeBaseProcessStatus; } /** * Full knowledge base detail */ interface KnowledgeBaseDetail extends KnowledgeBaseSummary { /** All content entries */ contents: KnowledgeBaseContent[]; } /** * Knowledge bases query parameters */ interface KnowledgeBasesQueryParams { /** Zero-based index of the first row (default 0) */ offset?: number; /** Maximum rows to return, 1-100 (default 10) */ limit?: number; /** Comma-separated property ids (e.g. "1,2,3") */ property_ids?: string; /** Comma-separated channel names (e.g. "airbnb,booking.com") */ channel_types?: string; } /** * Knowledge bases response data */ interface KnowledgeBasesData { /** Total number of entries */ total: number; knowledge_bases: KnowledgeBaseSummary[]; } /** * Create knowledge base parameters */ interface CreateKnowledgeBaseParams { /** The property scope configuration */ scope_property: KnowledgeBasePropertyScope; /** The channel scope configuration */ scope_channel: KnowledgeBaseChannelScope; /** The content entries */ contents: KnowledgeBaseContent[]; /** Optional title */ title?: string; /** Whether the entry is enabled */ is_enable: boolean; } /** * Update knowledge base parameters */ interface UpdateKnowledgeBaseParams extends CreateKnowledgeBaseParams { /** The id of the entry to update */ id: number; } //#endregion //#region src/types/automation.d.ts /** Kind of scheduled automation action */ type AutomationActionType = 'message' | 'review'; /** * A scheduled automation action */ interface AutomationAction { /** Automation plan id */ id: number; /** Action kind */ type: AutomationActionType; /** Human-readable title */ name: string; /** Recipient hint from the plan detail */ send_to: string; /** Linked stay code, or null if not tied to a stay */ stay_code: string | null; /** Hostex property id for this plan */ property_id: number; /** Property display title */ property_title: string; /** When the action is scheduled to run (operator's local timezone) */ scheduled_at: string; /** The channel type of the linked thread */ channel_type: ChannelType | null; } /** * Automation actions query parameters */ interface AutomationActionsQueryParams { /** Kind of scheduled action (required) */ type: AutomationActionType; /** Optional text matched against the plan detail payload */ keyword?: string; /** The code of the stay */ stay_code?: string; /** Comma-separated property ids (e.g. "1,2,3") */ property_ids?: string; /** Include only actions scheduled at or after this time (inclusive) */ start_time?: string; /** Include only actions scheduled at or before this time (inclusive) */ end_time?: string; /** Comma-separated channel names (e.g. "airbnb,agoda") */ channel_types?: string; /** Zero-based index of the first row (default 0) */ offset?: number; /** Maximum rows to return, 1-100 (default 20) */ limit?: number; } /** * Automation actions response data */ interface AutomationActionsData { /** Scheduled actions, ordered by scheduled_at */ actions: AutomationAction[]; /** Total number of matching actions */ total: number; } //#endregion //#region src/utils/retry.d.ts /** * Retry logic utilities */ /** * Retry options */ interface RetryOptions { /** Maximum number of retry attempts */ maxAttempts?: number; /** Initial delay in milliseconds */ initialDelay?: number; /** Maximum delay in milliseconds */ maxDelay?: number; /** Backoff multiplier */ backoffMultiplier?: number; /** Custom retry condition */ shouldRetry?: (error: unknown, attempt: number) => boolean; } //#endregion //#region src/rate-limiter/rate-limiter.d.ts interface RateLimiterRedisConfig { url: string; token: string; } interface RateLimiterLogger { warn: (message: string, ...args: unknown[]) => void; error: (message: string, ...args: unknown[]) => void; } interface RateLimiterConfig { redis: RateLimiterRedisConfig; hostId?: string; timeoutMs?: number; safetyMargin?: number; logger?: RateLimiterLogger; } declare class RateLimiter { private readonly redis; private readonly hostId; private readonly timeoutMs; private readonly safetyMargin; private readonly logger?; constructor(configOrRedis: RateLimiterConfig | Redis, options?: { hostId?: string; timeoutMs?: number; safetyMargin?: number; logger?: RateLimiterLogger; }); /** * Create a RateLimiter using an existing @upstash/redis instance. * Use this to share the Redis connection with other parts of the app. */ static fromRedisInstance(redis: Redis, options?: { hostId?: string; timeoutMs?: number; safetyMargin?: number; logger?: RateLimiterLogger; }): RateLimiter; /** * Acquire rate limit capacity for a request. * Blocks (polls) until capacity is available or timeout is reached. * Fails closed if Redis is unavailable — throws RateLimitTimeoutError to prevent * unthrottled requests from overwhelming the upstream API. */ acquire(method: string, url: string): Promise; /** * Optimistic add-then-check-rollback. * 1. ZADD our entry to all relevant sorted sets * 2. ZCARD to count entries in each window (includes our entry) * 3. If any window exceeds limit → ZREM our entry from all sets (rollback) */ private tryAcquire; private getChecks; /** * Clean up test keys. Only use in tests. */ cleanup(hostId: string): Promise; } //#endregion //#region src/client/index.d.ts /** * Client configuration options */ interface HostexApiClientConfig { /** Hostex access token */ accessToken: string; /** API base URL (default: https://api.hostex.io/v3) */ baseUrl?: string; /** Request timeout in milliseconds (default: 30000) */ timeout?: number; /** Retry options */ retry?: RetryOptions; /** Throttle options for mutation requests to avoid rate limiting */ throttle?: { /** Minimum delay in ms between mutation requests (POST/PUT/PATCH/DELETE). Default: 0 (no throttle) */ minDelayMs?: number; }; /** Rate limiter — either config to create one, or a pre-built RateLimiter instance */ rateLimiter?: RateLimiterConfig | RateLimiter; } /** * Hostex API Client */ declare class HostexApiClient { private readonly axios; private readonly retryOptions; private readonly throttleMinDelayMs; private readonly rateLimiter?; private lastMutationTime; private throttleQueue; constructor(config: HostexApiClientConfig); private static readonly MUTATION_METHODS; private static readonly RATE_LIMIT_RETRY_DELAY_MS; /** * Setup axios interceptors for throttling and error handling */ private setupInterceptors; /** * Check if an error is a rate limit ("Too Many Attempts") error */ private isRateLimitError; /** * Make a request with retry logic */ private request; /** * Query properties * @see https://docs.hostex.io/reference/query-properties */ getProperties(params?: PropertiesQueryParams): Promise; /** * Get all properties (handles pagination automatically) */ getAllProperties(): Promise; /** * Create a property * @see https://docs.hostex.io/reference/create-property */ createProperty(params: CreatePropertyParams): Promise>; /** * Query room types * @see https://docs.hostex.io/reference/query-room-types */ getRoomTypes(params?: RoomTypesQueryParams): Promise; /** * Get all room types (handles pagination automatically) */ getAllRoomTypes(): Promise; /** * Create a room type * @see https://docs.hostex.io/reference/create-roomtype */ createRoomType(params: CreateRoomTypeParams): Promise>; /** * Query reservations * @see https://docs.hostex.io/reference/query-reservations */ getReservations(params?: ReservationsQueryParams): Promise; /** * Create a reservation (direct booking) * @see https://docs.hostex.io/reference/create-reservation */ createReservation(params: CreateReservationParams): Promise>; /** * Cancel a reservation (direct booking only) * @see https://docs.hostex.io/reference/cancel-reservation */ cancelReservation(reservationCode: string): Promise; /** * Approve a pending reservation request * The reservation must be in `wait_accept` status. * @see https://docs.hostex.io/reference/approve-reservation */ approveReservation(reservationCode: string): Promise; /** * Decline a pending reservation request * The reservation must be in `wait_accept` status. * @see https://docs.hostex.io/reference/decline-reservation */ declineReservation(reservationCode: string): Promise; /** * Update reservation basic info * @see https://docs.hostex.io/reference/update-reservation-basic-info */ updateReservationBasicInfo(params: UpdateReservationBasicInfoParams): Promise; /** * Update check-in details for a stay * @see https://docs.hostex.io/reference/update-check-in-details */ updateCheckInDetails(params: UpdateCheckInDetailsParams): Promise; /** * Update stay status * @see https://docs.hostex.io/reference/update-stay-status */ updateStayStatus(params: UpdateStayStatusParams): Promise; /** * Add a tag to a reservation * @see https://docs.hostex.io/reference/add-tag */ addTag(params: AddTagParams): Promise; /** * Remove a tag from a reservation * @see https://docs.hostex.io/reference/remove-tag */ removeTag(params: RemoveTagParams): Promise; /** * Move a stay to the reservation box * @see https://docs.hostex.io/reference/move-reservation-to-box */ moveToBox(params: MoveToBoxParams): Promise; /** * Allocate a reservation to a property * @see https://docs.hostex.io/reference/allocate-reservation */ allocateToProperty(params: AllocateToPropertyParams): Promise; /** * Query custom fields for a stay * @see https://docs.hostex.io/reference/query-custom-fields */ getCustomFields(stayCode: string): Promise; /** * Update custom fields for a stay * @see https://docs.hostex.io/reference/update-custom-fields */ updateCustomFields(params: UpdateCustomFieldsParams): Promise; /** * Query custom channels * @see https://docs.hostex.io/reference/query-custom-channels */ getCustomChannels(): Promise; /** * Query income methods * @see https://docs.hostex.io/reference/query-income-methods */ getIncomeMethods(): Promise; /** * Query property availabilities * @see https://docs.hostex.io/reference/query-availabilities */ getAvailabilities(params: AvailabilitiesQueryParams): Promise; /** * Update property availabilities * @see https://docs.hostex.io/reference/update-availabilities */ updateAvailabilities(params: UpdateAvailabilitiesParams): Promise; /** * Query listing calendars * @see https://docs.hostex.io/reference/query-listing-calendars */ getListingCalendars(params: CalendarQueryParams): Promise; /** * Update listing inventories * @see https://docs.hostex.io/reference/update-listing-inventories */ updateListingInventories(params: UpdateListingInventoriesParams): Promise; /** * Update listing prices * @see https://docs.hostex.io/reference/update-listing-prices */ updateListingPrices(params: UpdateListingPricesParams): Promise; /** * Update listing restrictions * @see https://docs.hostex.io/reference/update-listing-restrictions */ updateListingRestrictions(params: UpdateListingRestrictionsParams): Promise; /** * Query channel accounts * @see https://docs.hostex.io/reference/query-channel-accounts */ getChannelAccounts(params?: ChannelAccountsQueryParams): Promise; /** * Query channel listings * @see https://docs.hostex.io/reference/query-listings */ getListings(params?: ListingsQueryParams): Promise; /** * Update Airbnb listing price and rules * @see https://docs.hostex.io/reference/update-airbnb-listing-price-and-rules */ updateAirbnbPriceAndRules(params: UpdateAirbnbPriceAndRulesParams): Promise; /** * Update Vrbo listing price and rules * @see https://docs.hostex.io/reference/update-vrbo-listing-price-and-rules */ updateVrboPriceAndRules(params: UpdateVrboPriceAndRulesParams): Promise; /** * Query pricing ratios for a property or room type * @see https://docs.hostex.io/reference/query-pricing-ratios */ getPricingRatios(params: PricingRatiosQueryParams): Promise; /** * Query calendar share links * @see https://docs.hostex.io/reference/query-calendar-share-links */ getCalendarShareLinks(params?: CalendarShareLinksQueryParams): Promise; /** * Create a calendar share link * @see https://docs.hostex.io/reference/create-calendar-share-link */ createCalendarShareLink(params: CreateCalendarShareLinkParams): Promise>; /** * Delete a calendar share link * @see https://docs.hostex.io/reference/delete-calendar-share-link */ deleteCalendarShareLink(id: number): Promise; /** * Query conversations * @see https://docs.hostex.io/reference/query-conversations */ getConversations(params?: ConversationsQueryParams): Promise; /** * Get conversation details * @see https://docs.hostex.io/reference/get-conversation-details */ getConversationDetails(conversationId: string): Promise; /** * Send a message * @see https://docs.hostex.io/reference/send-message */ sendMessage(params: SendMessageParams): Promise; /** * Update the host-side private note on a conversation * @see https://docs.hostex.io/reference/update-conversation-note */ updateConversationNote(params: UpdateConversationNoteParams): Promise>; /** * Query reviews * @see https://docs.hostex.io/reference/query-reviews */ getReviews(params?: ReviewsQueryParams): Promise; /** * Create or update a review * @see https://docs.hostex.io/reference/create-review */ createReview(params: CreateReviewParams): Promise; /** * Query groups * @see https://docs.hostex.io/reference/query-groups */ getGroups(params?: GroupsQueryParams): Promise; /** * Create a group * @see https://docs.hostex.io/reference/create-group */ createGroup(params: CreateGroupParams): Promise>; /** * Update a group * @see https://docs.hostex.io/reference/update-group */ updateGroup(params: UpdateGroupParams): Promise; /** * Delete a group * @see https://docs.hostex.io/reference/delete-group */ deleteGroup(id: number): Promise; /** * Query tags * @see https://docs.hostex.io/reference/query-tags */ getTags(params?: TagsQueryParams): Promise; /** * Create a tag * @see https://docs.hostex.io/reference/create-tag */ createTag(params: CreateTagParams): Promise>; /** * Update a tag * @see https://docs.hostex.io/reference/update-tag */ updateTag(params: UpdateTagParams): Promise; /** * Delete a tag * @see https://docs.hostex.io/reference/delete-tag */ deleteTag(id: number): Promise; /** * Query reservation tags * @see https://docs.hostex.io/reference/query-reservation-tags */ getReservationTags(params?: ReservationTagsQueryParams): Promise; /** * Create a reservation tag * @see https://docs.hostex.io/reference/create-reservation-tag */ createReservationTag(params: CreateReservationTagParams): Promise>; /** * Delete a reservation tag * @see https://docs.hostex.io/reference/delete-reservation-tag */ deleteReservationTag(id: number): Promise; /** * Query staffs * @see https://docs.hostex.io/reference/query-staffs */ getStaffs(params?: StaffsQueryParams): Promise; /** * Create a staff * @see https://docs.hostex.io/reference/create-staff */ createStaff(params: CreateStaffParams): Promise>; /** * Update a staff * @see https://docs.hostex.io/reference/update-staff */ updateStaff(params: UpdateStaffParams): Promise; /** * Delete a staff * @see https://docs.hostex.io/reference/delete-staff */ deleteStaff(id: number): Promise; /** * Query tasks * @see https://docs.hostex.io/reference/query-tasks */ getTasks(params?: TasksQueryParams): Promise; /** * Create a task * @see https://docs.hostex.io/reference/create-task */ createTask(params: CreateTaskParams): Promise>; /** * Update a task * @see https://docs.hostex.io/reference/update-task */ updateTask(params: UpdateTaskParams): Promise; /** * Delete a task * @see https://docs.hostex.io/reference/delete-task */ deleteTask(id: number): Promise; /** * Query income items * @see https://docs.hostex.io/reference/query-income-items */ getIncomeItems(): Promise; /** * Query expense items * @see https://docs.hostex.io/reference/query-expense-items */ getExpenseItems(): Promise; /** * Query expense methods * @see https://docs.hostex.io/reference/query-expense-methods */ getExpenseMethods(): Promise; /** * Query incomes & expenses * @see https://docs.hostex.io/reference/query-transactions */ getTransactions(params?: TransactionsQueryParams): Promise; /** * Create a transaction (income or expense entry) * @see https://docs.hostex.io/reference/create-transaction */ createTransaction(params: CreateTransactionParams): Promise>; /** * Update a transaction * @see https://docs.hostex.io/reference/update-transaction */ updateTransaction(params: UpdateTransactionParams): Promise; /** * Delete a transaction * @see https://docs.hostex.io/reference/delete-transaction */ deleteTransaction(id: number): Promise; /** * Query knowledge bases * @see https://docs.hostex.io/reference/query-knowledge-bases */ getKnowledgeBases(params?: KnowledgeBasesQueryParams): Promise; /** * Get knowledge base detail * @see https://docs.hostex.io/reference/get-knowledge-base-detail */ getKnowledgeBaseDetail(id: number): Promise; /** * Create a knowledge base entry * @see https://docs.hostex.io/reference/create-knowledge-base */ createKnowledgeBase(params: CreateKnowledgeBaseParams): Promise; /** * Update a knowledge base entry * @see https://docs.hostex.io/reference/update-knowledge-base */ updateKnowledgeBase(params: UpdateKnowledgeBaseParams): Promise; /** * Delete a knowledge base entry * @see https://docs.hostex.io/reference/delete-knowledge-base */ deleteKnowledgeBase(id: number): Promise; /** * Query upcoming automation actions * @see https://docs.hostex.io/reference/query-automation-actions */ getAutomationActions(params: AutomationActionsQueryParams): Promise; /** * Delete an upcoming automation action * @see https://docs.hostex.io/reference/delete-automation-action */ deleteAutomationAction(planId: number): Promise; /** * Execute an automation action immediately * @see https://docs.hostex.io/reference/execute-automation-action */ executeAutomationAction(planId: number): Promise; /** * Query webhooks * @see https://docs.hostex.io/reference/query-webhooks */ getWebhooks(): Promise; /** * Create a webhook * @see https://docs.hostex.io/reference/create-webhook */ createWebhook(params: CreateWebhookParams): Promise; /** * Update a webhook * @see https://docs.hostex.io/reference/update-webhook */ updateWebhook(params: UpdateWebhookParams): Promise; /** * Delete a webhook * @see https://docs.hostex.io/reference/delete-webhook */ deleteWebhook(params: DeleteWebhookParams): Promise; /** * Obtain or refresh an access token * @see https://docs.hostex.io/reference/obtain-token */ obtainToken(params: OAuthTokenParams): Promise; /** * Revoke a token * @see https://docs.hostex.io/reference/revoke-token */ revokeToken(params: RevokeTokenParams): Promise; } //#endregion //#region src/utils/error.d.ts /** * Hostex API error */ declare class HostexApiError extends Error { readonly errorCode: number; readonly requestId?: string | undefined; readonly statusCode?: number | undefined; readonly response?: unknown | undefined; constructor(message: string, errorCode: number, requestId?: string | undefined, statusCode?: number | undefined, response?: unknown | undefined); /** * Check if this is a specific Hostex error code */ isErrorCode(code: number): boolean; /** * Check if this is a network/timeout error */ isNetworkError(): boolean; /** * Check if this is an authentication error */ isAuthError(): boolean; /** * Check if this is a rate limit error */ isRateLimitError(): boolean; /** * Convert to JSON */ toJSON(): object; } /** * Thrown when a request times out waiting for rate limit capacity */ declare class RateLimitTimeoutError extends HostexApiError { readonly endpointCategory: string; readonly timeoutMs: number; constructor(endpointCategory: string, timeoutMs: number); } //#endregion export { ActivityProperty, ActivityType, AddTagParams, AdditionalFee, AirbnbPetFee, AirbnbPriceAndRulesSettings, AllocateToPropertyParams, AutomationAction, AutomationActionType, AutomationActionsData, AutomationActionsQueryParams, AvailabilitiesData, AvailabilitiesQueryParams, Availability, AvailabilityEntry, CalendarData, CalendarDay, CalendarQueryParams, CalendarShareLink, CalendarShareLinkScope, CalendarShareLinksData, CalendarShareLinksQueryParams, ChannelAccount, ChannelAccountAuthStatus, ChannelAccountsData, ChannelAccountsQueryParams, ChannelListing, ChannelListingRecord, ChannelType, ChannelTypeParam, CheckInDetails, CheckinGuideImage, Conversation, ConversationActivity, ConversationDetails, ConversationDetailsData, ConversationGuest, ConversationsData, ConversationsQueryParams, CreateCalendarShareLinkData, CreateCalendarShareLinkParams, CreateGroupData, CreateGroupParams, CreateKnowledgeBaseParams, CreatePropertyData, CreatePropertyParams, CreateReservationData, CreateReservationParams, CreateReservationTagData, CreateReservationTagParams, CreateReviewParams, CreateRoomTypeData, CreateRoomTypeParams, CreateStaffData, CreateStaffParams, CreateTagData, CreateTagParams, CreateTaskData, CreateTaskParams, CreateTransactionData, CreateTransactionParams, CreateWebhookParams, CustomChannel, CustomChannelsData, CustomFieldsData, DaysDiscount, DeleteWebhookParams, ExpenseItemsData, ExpenseMethodsData, FinanceDictionaryEntry, Group, GroupsData, GroupsQueryParams, Guest, GuestGender, GuestIdImage, GuestIdType, HostReply, HostexApiClient, type HostexApiClientConfig, HostexApiError, HostexApiResponse, HostexTask, IdRequiredLevel, IncomeItemsData, IncomeMethod, IncomeMethodsData, InventoryUpdate, KnowledgeBaseChannelScope, KnowledgeBaseChannelScopeType, KnowledgeBaseContent, KnowledgeBaseDetail, KnowledgeBaseProcessStatus, KnowledgeBasePropertyScope, KnowledgeBasePropertyScopeType, KnowledgeBaseSummary, KnowledgeBasesData, KnowledgeBasesQueryParams, ListingCalendar, ListingCalendarUpdatedPayload, ListingId, ListingReference, ListingRestrictions, ListingShelfStatus, ListingsData, ListingsQueryParams, Message, MessageCreatedPayload, MessageDisplayType, MessageSource, MessageSourceDoc, MoneyAmount, MoveToBoxParams, OAuthGrantType, OAuthTokenData, OAuthTokenParams, PaginationParams, PriceUpdate, PricingRatioChannel, PricingRatiosData, PricingRatiosQueryParams, PropertiesData, PropertiesQueryParams, Property, PropertyAvailability, PropertyAvailabilityUpdatedPayload, PropertyGroupRef, PropertyTagRef, RateDetail, RateLimitTimeoutError, RateLimiter, type RateLimiterConfig, type RateLimiterLogger, type RateLimiterRedisConfig, RemoveTagParams, Reservation, ReservationCreatedPayload, ReservationOrderBy, ReservationRates, ReservationStatus, ReservationTag, ReservationTagsData, ReservationTagsQueryParams, ReservationTax, ReservationUpdatedPayload, ReservationUpdatedSubEvent, ReservationsData, ReservationsQueryParams, RestrictionUpdate, type RetryOptions, Review, ReviewCategoryRatings, ReviewContent, ReviewCreatedPayload, ReviewStatus, ReviewSubScore, ReviewUpdatedPayload, ReviewsData, ReviewsQueryParams, RevokeTokenParams, RoomType, RoomTypeProperty, RoomTypeReference, RoomTypesData, RoomTypesQueryParams, SendMessageParams, SenderRole, Staff, StaffsData, StaffsQueryParams, StayStatus, Tag, TagColor, TagsData, TagsQueryParams, TaskLevel, TaskStatus, TaskType, TasksData, TasksQueryParams, TimeOfDay, Transaction, TransactionDirection, TransactionLinkType, TransactionStatus, TransactionsData, TransactionsQueryParams, UpdateAirbnbPriceAndRulesParams, UpdateAvailabilitiesParams, UpdateCheckInDetailsParams, UpdateConversationNoteData, UpdateConversationNoteParams, UpdateCustomFieldsParams, UpdateGroupParams, UpdateKnowledgeBaseParams, UpdateListingInventoriesParams, UpdateListingPricesParams, UpdateListingRestrictionsParams, UpdateReservationBasicInfoParams, UpdateStaffParams, UpdateStayStatusParams, UpdateTagParams, UpdateTaskParams, UpdateTransactionParams, UpdateVrboPriceAndRulesParams, UpdateWebhookParams, VrboNightlyRate, VrboPriceAndRulesSettings, Webhook, WebhookEventType, WebhookPayload, WebhookPayloadBase, WebhooksData }; //# sourceMappingURL=index.d.mts.map