/** * model interface for Decision Tree question */ export interface DecisionTreeQuestion { /** * The unique identifier for the question. */ questionId: string; /** * The text of the question. */ questionText: string; /** * Indicates whether the question is mandatory. */ mandatory: boolean; } /** * model interface for Decision Tree question with response */ export interface CapturedQuestion extends DecisionTreeQuestion { /** * The response provided for the question. */ questionResponse: DecisionTreeInputValue; /** * The data type of the question response. */ dataType: QuestionType; /** * The options available for multiple choice questions. */ options?: string[]; /** * The available choices for ChoiceSet and MultiChoiceSet questions. */ choices?: Array<{ title: string; value: string; }>; /** * Optional placeholder text shown inside the input when empty. * Enriched at render time from the element's field config. */ placeholderText?: string; } export interface BaseSection { /** * The unique identifier for the section. */ sectionId: string; /** * The name of the section. */ sectionName: string; } /** * model interface for Suggested Questions Section */ export interface SuggestedQuestionSection extends BaseSection { /** * The list of questions in the section. */ questions: DecisionTreeQuestion[]; } /** * model interface for Captured Responses Section */ export interface CapturedSection extends BaseSection { /** * The list of questions responded to in the section. */ questionsResponded: CapturedQuestion[]; } /** * model interface for Decision Tree data */ export interface DecisionTreeData { /** * The unique identifier for the task session associated with this decision tree. */ taskSessionUid: string; /** * The unique identifier for the contact associated with this decision tree. */ contactId: string; /** * The unique identifier for the decision tree. */ decisionTreeId: string; /** * The title of the decision tree. */ title: string; /** * The icon representing the decision tree. */ icon: string; /** * The number of questions answered so far. */ answeredQuestions: number; /** * The total number of questions in the decision tree. */ totalNoOfQuestions: number; /** * The Current section ID being interacted with in the decision tree. */ currentSectionId: string; /** * The list of suggested questions for the decision tree. */ suggestedQuestions: SuggestedQuestionSection[]; /** * The list of captured responses for the decision tree. */ capturedResponses: CapturedSection[]; /** * Indicates whether the submit button should be shown. */ showSubmit: boolean; /** * Indicates the ID of the previous section for navigation purposes. */ previousSection?: string; sections: DecisionTreeSection[]; visitedSections: BaseSection[]; error: string | null; completeBtnTitle: string; mode?: string; interviewTreeNavigationStrategy?: string; } /** * Enumeration of supported decision tree question primitive types. */ export declare type QuestionType = 'Date' | 'String' | 'Number' | 'Boolean' | 'Text' | 'Toggle' | 'Time' | 'ChoiceSet' | 'MultiChoiceSet' | 'singleSelect' | 'multiSelect'; /** * Props for Decision Tree Capture Details component */ export interface DecisionTreeCaptureDetailsProps { payload: DecisionTreeData; } /** * Primitive values supported by decision tree inputs. */ export declare type DecisionTreeInputValue = string | number | boolean | Date | string[]; /** * Represents the root element of a decision tree definition returned from the API. * * This is the top-level payload containing metadata about the decision tree * (such as its name, type, and status) along with its full configuration. */ export interface DecisionTreeElement { name: string; type: string; description: string; notes: string | null; status: string; division: number; config: DecisionTreeConfig; } /** * Decision Tree config block */ export interface DecisionTreeConfig { title: string; icon: string; /** * Rendering mode of the decision tree — e.g. `'formMode'` or `'interviewMode'`. */ mode: string; shouldAutoFill: boolean; /** * Navigation strategy for interview mode — e.g. `'Conversation-Driven'` for responsive sequencing. */ interviewTreeNavigationStrategy: string; selectedBot: Record; selectedIntent: Record; completeBtnTitle: string; sections: DecisionTreeSection[]; } /** * A single section */ export interface DecisionTreeSection { sectionId: string; sectionTitle: string; sectionDescription: string; preCondition: SectionPreCondition; fields: DecisionTreeField[]; } /** * Condition applied at section level */ export interface SectionPreCondition { conditionType: 'Display always' | 'Display if' | 'Do not display if'; conditionValue?: CriteriaSelector; } /** * Represents a single question or input field in the decision tree. */ export interface DecisionTreeField { /** * Unique identifier for the field within the decision tree. */ fieldId?: string; /** * Runtime identifier used by the API. * Typically matches `CapturedQuestion.questionId` from backend responses. */ questionId?: string; /** * Short display name for the field as configured in the admin UI (real API key: 'name'). */ name?: string; /** * Full question text for this field (real API key: 'questionText'). * Matches the WS capturedResponses.questionText used in Interview Mode. * Preferred label source; falls back to name, then label. */ questionText?: string; /** * Legacy label field retained for backward compatibility with mock configs. */ label?: string; dataType: 'String' | 'Number' | 'Boolean' | 'Date' | 'Text' | 'Toggle' | 'Time' | 'MultipleChoice' | 'SingleChoice' | 'ChoiceSet' | 'MultiChoiceSet' | 'singleSelect' | 'multiSelect' | string; /** Whether the field is required (real API key: 'isRequired'). */ isRequired?: boolean; /** Legacy mandatory field retained for backward compatibility with mock configs. */ mandatory?: boolean; value?: DecisionTreeInputValue; options?: string[]; choices?: Array<{ title: string; value: string; }>; choiceSetOptions?: Array<{ title: string; value: string; }>; multiChoiceSetOptions?: Array<{ title: string; value: string; }>; /** Optional placeholder text shown inside the input when empty. */ placeholderText?: string; } /** * Supported comparison operators. */ export declare type ComparisonOperator = 'eq' | 'ne' | 'lt' | 'lte' | 'gt' | 'gte'; /** * A single comparison criterion against a field. */ export interface ComparisonCriteria { kind: 'comparison'; /** * Field identifier to compare. */ field: string; /** * Operator used for comparison. */ operator: ComparisonOperator; /** * Value compared against. Supports primitive scalar types. */ value: string | number | boolean; } /** * A logical grouping (AND / OR) of child criteria. */ export interface LogicalCriteria { kind: 'group'; /** * Logical gate combining the child criteria. */ gate: 'AND' | 'OR'; /** * Nested criteria (can be comparisons or further groups). */ criteria: Array; } /** * Recursive criteria selector allowing compound logical expressions like: *` a = 4 AND b != 6 OR c > 7` */ export declare type CriteriaSelector = ComparisonCriteria | LogicalCriteria;