/** * Hostex Knowledge Bases API types (HostGPT knowledge) */ /** Property scope type */ export type KnowledgeBasePropertyScopeType = 'all' | 'by_property' | 'by_group' | 'by_room_type'; /** Channel scope type */ export type KnowledgeBaseChannelScopeType = 'all' | 'by_channel'; /** Processing status of a knowledge base entry */ export type KnowledgeBaseProcessStatus = 'waiting' | 'processing' | 'done' | 'failed'; /** * Property scope of a knowledge base entry */ export 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 */ export interface KnowledgeBaseChannelScope { /** Scope type */ type: KnowledgeBaseChannelScopeType; /** Channel names; ['unlimited'] for all */ channels: string[]; } /** * A content block of a knowledge base entry */ export interface KnowledgeBaseContent { /** The content text */ text: string; /** The subtitle for this content block */ sub_title: string; } /** * A knowledge base list entry */ export 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 */ export interface KnowledgeBaseDetail extends KnowledgeBaseSummary { /** All content entries */ contents: KnowledgeBaseContent[]; } /** * Knowledge bases query parameters */ export 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 */ export interface KnowledgeBasesData { /** Total number of entries */ total: number; knowledge_bases: KnowledgeBaseSummary[]; } /** * Create knowledge base parameters */ export 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 */ export interface UpdateKnowledgeBaseParams extends CreateKnowledgeBaseParams { /** The id of the entry to update */ id: number; }