/** * The user object represents someone interacting with the bot within a specific integration. The same person interacting with a bot in slack and messenger will be represented with two different users. */ export interface User { /** * Name of the [User](#schema_user) */ name?: string; /** * Picture url of the [User](#schema_user) */ pictureUrl?: string; /** * User data */ data?: { [k: string]: any; }; /** * Custom attributes of the user */ attributes?: { [k: string]: string; }; /** * Id of the [User](#schema_user) */ id: string; /** * Creation date of the [User](#schema_user) in ISO 8601 format */ createdAt: string; /** * Updating date of the [User](#schema_user) in ISO 8601 format */ updatedAt: string; } export interface Conversation { /** * Id of the [Conversation](#schema_conversation) */ id: string; /** * Creation date of the [Conversation](#schema_conversation) in ISO 8601 format */ createdAt: string; /** * Updating date of the [Conversation](#schema_conversation) in ISO 8601 format */ updatedAt: string; /** * The last [Message](#schema_message) sent in the [Conversation](#schema_conversation) */ lastMessage?: { /** * Id of the [Message](#schema_message) */ id: string; /** * Creation date of the [Message](#schema_message) in ISO 8601 format */ createdAt: string; /** * Payload is the content of the message. */ payload: { audioUrl: string; fileId?: string; type: "audio"; [k: string]: any; } | { title: string; subtitle?: string; imageUrl?: string; actions: { action: "postback" | "url" | "say"; label: string; value: string; [k: string]: any; }[]; type: "card"; [k: string]: any; } | { items: { title: string; subtitle?: string; imageUrl?: string; actions: { action: "postback" | "url" | "say"; label: string; value: string; [k: string]: any; }[]; [k: string]: any; }[]; type: "carousel"; [k: string]: any; } | { text: string; options: { label: string; value: string; [k: string]: any; }[]; disableFreeText?: boolean; type: "choice"; [k: string]: any; } | { text: string; options: { label: string; value: string; [k: string]: any; }[]; disableFreeText?: boolean; type: "dropdown"; [k: string]: any; } | { fileUrl: string; title?: string; fileId?: string; type: "file"; [k: string]: any; } | { imageUrl: string; fileId?: string; type: "image"; [k: string]: any; } | { latitude: number; longitude: number; address?: string; title?: string; type: "location"; [k: string]: any; } | { text: string; value?: string; type: "text"; [k: string]: any; } | { videoUrl: string; fileId?: string; type: "video"; [k: string]: any; } | { items: ({ type: "text"; payload: { text: string; value?: string; [k: string]: any; }; [k: string]: any; } | { type: "markdown"; payload: { markdown: string; [k: string]: any; }; [k: string]: any; } | { type: "image"; payload: { imageUrl: string; fileId?: string; [k: string]: any; }; [k: string]: any; } | { type: "audio"; payload: { audioUrl: string; fileId?: string; [k: string]: any; }; [k: string]: any; } | { type: "video"; payload: { videoUrl: string; fileId?: string; [k: string]: any; }; [k: string]: any; } | { type: "file"; payload: { fileUrl: string; title?: string; fileId?: string; [k: string]: any; }; [k: string]: any; } | { type: "location"; payload: { latitude: number; longitude: number; address?: string; title?: string; [k: string]: any; }; [k: string]: any; })[]; type: "bloc"; [k: string]: any; } | { markdown: string; type: "markdown"; [k: string]: any; } | { url: string; name: string; data?: any; type: "custom"; [k: string]: any; }; /** * ID of the [User](#schema_user) */ userId: string; /** * ID of the [Conversation](#schema_conversation) */ conversationId: string; /** * Metadata of the message */ metadata?: { [k: string]: any; }; /** * ID of the message this message is replying to */ replyTo?: string; /** * ID of the user who selected this message. Undefined if not selected. */ selectedBy?: string; /** * Feedback of the message */ feedback?: { value: "positive" | "negative"; comment?: string; }; }; } /** * The Message object represents a message in a [Conversation](#schema_conversation) for a specific [User](#schema_user). */ export interface Message { /** * Id of the [Message](#schema_message) */ id: string; /** * Creation date of the [Message](#schema_message) in ISO 8601 format */ createdAt: string; /** * Payload is the content of the message. */ payload: { audioUrl: string; fileId?: string; type: "audio"; [k: string]: any; } | { title: string; subtitle?: string; imageUrl?: string; actions: { action: "postback" | "url" | "say"; label: string; value: string; [k: string]: any; }[]; type: "card"; [k: string]: any; } | { items: { title: string; subtitle?: string; imageUrl?: string; actions: { action: "postback" | "url" | "say"; label: string; value: string; [k: string]: any; }[]; [k: string]: any; }[]; type: "carousel"; [k: string]: any; } | { text: string; options: { label: string; value: string; [k: string]: any; }[]; disableFreeText?: boolean; type: "choice"; [k: string]: any; } | { text: string; options: { label: string; value: string; [k: string]: any; }[]; disableFreeText?: boolean; type: "dropdown"; [k: string]: any; } | { fileUrl: string; title?: string; fileId?: string; type: "file"; [k: string]: any; } | { imageUrl: string; fileId?: string; type: "image"; [k: string]: any; } | { latitude: number; longitude: number; address?: string; title?: string; type: "location"; [k: string]: any; } | { text: string; value?: string; type: "text"; [k: string]: any; } | { videoUrl: string; fileId?: string; type: "video"; [k: string]: any; } | { items: ({ type: "text"; payload: { text: string; value?: string; [k: string]: any; }; [k: string]: any; } | { type: "markdown"; payload: { markdown: string; [k: string]: any; }; [k: string]: any; } | { type: "image"; payload: { imageUrl: string; fileId?: string; [k: string]: any; }; [k: string]: any; } | { type: "audio"; payload: { audioUrl: string; fileId?: string; [k: string]: any; }; [k: string]: any; } | { type: "video"; payload: { videoUrl: string; fileId?: string; [k: string]: any; }; [k: string]: any; } | { type: "file"; payload: { fileUrl: string; title?: string; fileId?: string; [k: string]: any; }; [k: string]: any; } | { type: "location"; payload: { latitude: number; longitude: number; address?: string; title?: string; [k: string]: any; }; [k: string]: any; })[]; type: "bloc"; [k: string]: any; } | { markdown: string; type: "markdown"; [k: string]: any; } | { url: string; name: string; data?: any; type: "custom"; [k: string]: any; }; /** * ID of the [User](#schema_user) */ userId: string; /** * ID of the [Conversation](#schema_conversation) */ conversationId: string; /** * Metadata of the message */ metadata?: { [k: string]: any; }; /** * ID of the message this message is replying to */ replyTo?: string; /** * ID of the user who selected this message. Undefined if not selected. */ selectedBy?: string; /** * Feedback of the message */ feedback?: { value: "positive" | "negative"; comment?: string; }; } export interface Event { /** * ID of the [Event](#schema_event). */ id: string; /** * Creation date of the [Event](#schema_event) in ISO 8601 format */ createdAt: string; /** * Payload is the content of the event. */ payload: { type: "custom"; data: { [k: string]: any; }; [k: string]: any; } | { type: "conversation_started"; data: { [k: string]: { [k: string]: any; }; }; [k: string]: any; }; /** * ID of the [Conversation](#schema_conversation). */ conversationId: string; /** * ID of the [User](#schema_user). */ userId: string; } export interface File { id: string; botId: string; key: string; size: number | null; contentType: string; tags: { [k: string]: string; }; createdAt: string; updatedAt: string; accessPolicies: ("integrations" | "public_content")[]; index: boolean; url: string; status: "upload_pending" | "upload_failed" | "upload_completed" | "indexing_pending" | "indexing_failed" | "indexing_completed"; failedStatusReason?: string; uploadUrl: string; } export interface Perf { duration: number; event: string; properties: { [k: string]: any; }; }