UNPKG

@hhgtech/hhg-components

Version:
320 lines (319 loc) • 9.84 kB
export declare enum NodePosition { HEAD = 0, TAIL = 1, MIDDLE = 2, CONNECT = 3, SSO = 4, MULTIPLE = 5 } export declare enum NodeType { UNDEFINED = -1, TEXT = 0, IMAGE = 1, FORM = 2, CONDITION = 3, POLL = 4, FINAL_STANDARD = 5, FINAL = 6, FINAL_THANK_YOU = 7, RATING = 8, REACTION = 9, REVIEW = 10, RESULT_POLL = 11, RESULT_RATING = 12, RESULT_REACTION = 13, OTP = 14 } export declare const NodeFinalTypes: NodeType[]; export declare enum NodeIntentType { BOT_TEXT = "bot-text", BOT_IMAGE = "bot-image", BOT_BACKGROUND_IMAGE = "bot-background-image", BOT_BUTTON = "bot-button", BOT_URL = "bot-url", BOT_RECALCULATE = "bot-recalculate", BOT_BOOKING = "bot-booking", BOT_MAIN_TITLE = "bot-main-title", BOT_MAIN_IMAGE = "bot-main-image", BOT_MAIN_BODY = "bot-main-body", BOT_MAIN_BUTTON = "bot-main-button", BOT_SUB_TITLE = "bot-sub-title", BOT_SUB_BODY = "bot-sub-body", BOT_LANDING_PAGE_URL = "bot-landing-page-url", BOT_LANDING_PAGE_BUTTON = "bot-landing-page-button", BOT_RISK_SCREEN = "bot-risk-screen", BOT_RELATED_ARTICLE = "bot-related-article", THANK_YOU_IMAGE = "thank-you-image", THANK_YOU_TITLE = "thank-you-title", THANK_YOU_BODY = "thank-you-body", TOTAL_LINE = "total-line", BOT_SUBMISSION = "bot-submission", BOT_EVENT_SUBMISSION = "bot-event-submission", BOT_SUGGESTED_SERVICE = "bot-suggested-service", /** intents fake for sso block */ SSO_INTENT = "sso-intent" } export declare enum NodeActionType { ACTION_CONDITION = "action-condition", ACTION_INTERNAL = "action-internal", ACTION_EXTERNAL = "action-external", ACTION_SSO_REDIRECT = "action-sso-redirect", ACTION_MULTIPLE_BUTTON = "action-multiple-button", USER_CHOICE_TEXT = "user-choice-text", USER_CHOICE_TEXT_BY_INPUT = "user-choice-text-by-input", USER_CHOICE_NEXT = "user-choice-next", USER_CHOICE_IMAGE = "user-choice-image", USER_SUBMIT_TEXT = "user-submit-text", USER_SUBMIT_NUMBER = "user-submit-number", USER_SUBMIT_NAME = "user-submit-name", USER_SUBMIT_PHONE = "user-submit-phone", USER_SUBMIT_EMAIL = "user-submit-email", USER_SUBMIT_DROPDOWN = "user-submit-dropdown", USER_SUBMIT_DATE = "user-submit-date", USER_SUBMIT_DOB = "user-submit-dob", USER_SUBMIT_CONFIRM = "user-submit-confirm", USER_SUBMIT_SEND = "user-submit-send", USER_SUBMIT_RESEND = "user-submit-resend", USER_SUBMIT_ADDRESS = "user-submit-address", USER_SUBMIT_ADDRESS_PROVINCE = "user-submit-address-province", USER_SUBMIT_ADDRESS_DISTRICT = "user-submit-address-district", USER_SUBMIT_ADDRESS_COMMUNE = "user-submit-address-commune", USER_SUBMIT_BMI = "user-submit-bmi", USER_SUBMIT_BMI_HIDDEN = "user-submit-bmi-hidden", USER_SUBMIT_TERMS = "user-submit-terms", USER_SUBMIT_GENDER = "user-submit-gender", USER_SUBMIT_OTP = "user-submit-otp", USER_SUBMIT_WHATSAPP = "user-submit-whatsapp", POLL_CHOICE = "poll-choice", POLL_CHOICE_TEXT_BY_INPUT = "poll-choice-text-by-input", POLL_CHOICE_IMAGE = "poll-choice-image", POLL_BUTTON = "poll-button", RATING_STAR = "rating-star", RATING_DESCRIPTION = "rating-description", RATING_BUTTON = "rating-button", LIKE_CHOICE = "like-choice", DISLIKE_CHOICE = "dislike-choice", REVIEW_CHOICE = "review-choice", REVIEW_DESCRIPTION = "review-description", REVIEW_BUTTON = "review-button", RESULT_BUTTON = "result-button", POLL_RESULT = "poll-result", USER_SUBMIT_GOOGLE_API_ADDRESS = "user-submit-google-api-address" } export declare const FULL_KEY_ADDRESS: NodeActionType[]; export declare enum NodeMultipleOptions { UNLIMITED = 0, EXACT_NUMBER = 1, RANGE = 2 } export declare const ELEMENT_CONTROL_INPUT_TYPE: { [key: string]: string; }; export type SubotFormSubmitMeta = { key: string; control: string; value: string; action_id?: string; }; export type SubotMessage = { mode?: string; bot_id?: string | number; node_id?: string; cookie_id?: string; window_id?: string; url?: string; title_url?: string; action_id?: string; action_value?: string; gtm_id?: string; ga_client_id?: string; device_id?: number; categories?: string[]; current_keys?: Array<string>; current_score?: string | number; current_selected?: Array<string>; current_polls?: { [key: string]: Array<string>; }; account_id?: number | null; is_new?: boolean; selected_actions?: { [key: string]: string; }; form_submit_meta?: Array<SubotFormSubmitMeta>; }; export interface SubotNodeIntent { id: string; type?: NodeIntentType; label?: string; url?: string; } export interface SubotNodeAction extends Omit<SubotNodeIntent, 'type'> { type?: NodeActionType; key?: string; score?: number; from?: number; to?: number; is_chosen?: boolean; percent?: number; validated_message?: string; validated_conditions?: string; } export type SubotNode = { id: string; type?: NodeType; position?: NodePosition; name?: string; x_axis?: number; y_axis?: number; is_multi_select?: boolean; multi_select_option?: NodeMultipleOptions; from?: number; to?: number; intents?: Array<SubotNodeIntent>; intents_bottom?: Array<SubotNodeIntent>; actions?: Array<SubotNodeAction>; isMobile?: boolean; }; export type SubotNodeMessage = SubotNode & { _message?: SubotMessage; }; export type SubotNodeItem = SubotNodeMessage | SubotBotItem; export interface SubotDynamicScoreItem { action_id: string; number: number; operator: '+' | '-' | 'x' | '/'; action_ids: { id: string; variableName: 'x' | 'y' | 'z' | 't'; }[]; formula: string; formula_result_name: string; } export interface SubotBotItem { id: number | string; site_id?: number | null; flow_name?: string | null; flow_uuid?: string | null; dynamic_score?: Record<string, SubotDynamicScoreItem>; landing_page_url_prefix?: string | null; landing_page_url_slug?: string | null; landing_page_image?: string | null; landing_page_icon?: string | null; landing_page_title?: string | null; landing_page_description?: string | null; landing_page_reviewer?: string | null; landing_page_review_date?: string | null; landing_page_info?: []; landing_page_disclaimer?: string | null; landing_page_meta_description?: string | null; landing_page_seo_title?: string | null; landing_page_active?: boolean | null; landing_page_sponsor_from?: string | null; landing_page_sponsor_to?: string | null; landing_page_is_sponsored?: boolean | null; landing_page_client_id?: string | number; landing_page_client?: { [key: string]: any; }; landing_page_start_button?: string; landing_page_background?: string; inline_active?: boolean; inline_headline?: string; inline_image?: string; inline_title?: string; inline_background?: string; inline_review?: string; inline_avatar?: string; inline_speciality?: string; inline_hospital_name?: string; inline_description?: string; inline_start_button?: string; first_node?: SubotNode | null; care_service_type_id?: number | null; care_service_type?: { [key: string]: any; }; care_service_type_label?: string; care_specialty_id?: number | null; care_specialty_label?: string; care_specialty?: { [key: string]: any; }; care_enable_default_banner?: boolean; affiliate_product_title?: string; affiliate_product_no_follow?: boolean; affiliate_product_open_new_tab?: boolean; affiliate_product_sponsored?: boolean; affiliate_product_sku_list?: string[]; extra_settings?: Record<string, any>; subot_field_type?: string; } export type ChatBotNodeFormSubmitData = { node_id?: string; action_id: string; action_value: string; form_submit_meta: Array<SubotFormSubmitMeta>; selected?: { [key: string]: string; }; }; export type ChatBotNodes = { node: SubotNode; current_score?: number; }; export type ChatBotResultItem = { id: string; type: string; label: string; url: string; button?: ChatBotResultItem; }; export type ChatBotResult = { intents: Array<ChatBotResultItem>; }; export type ChatBotResultMetaItem = { key: string; value: string; }; export type ChatBotResultFetchUrl = { url: string; title: string; thumbnail: string; description?: string; type: number; meta: Array<ChatBotResultMetaItem>; }; export type ChatBotResultItemWithInfo = { id: string; type: string; label: string; url: string; button?: ChatBotResultItem; info?: ChatBotResultFetchUrl; }; export type ChatBotState = { nodes: Array<SubotNode>; selecteds: Array<SubotMessage>; current_score?: number; current_selected?: Array<string>; current_keys?: Array<string>; }; export type SingleSubotApi = { title: string; english_name: string; icon: string; subot_url: string; }; export type SingleSubot = { title: string; englishName: string; icon: string; subotUrl: string; }; export declare const SubotType: { FRU: string; survey: string; ristScreener: string; voucherAcuvue: string; };