Press n or j to go to the next uncovered block, b, p or k for the previous block.
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 | 108x 108x 108x 108x 108x 108x 108x 108x 108x 108x 108x 108x 108x 108x 108x 108x 108x 108x 108x 108x 108x 108x 108x 108x 108x 108x 108x 108x 108x 108x 108x 108x 108x 108x 108x 108x 108x 108x 108x 108x 108x 108x 108x 108x 108x 108x 108x 108x 108x 108x 108x 108x 108x 108x 108x 108x 108x 108x 108x 108x 108x 108x 108x 108x 108x 108x 108x 108x 108x 108x 108x 108x 108x 108x 108x 108x 108x 108x 108x 108x 108x 108x 108x 108x 108x 108x 108x 108x 108x 108x 108x 108x 108x 108x 108x 108x 108x 108x 108x 108x 108x 108x 108x 108x 108x 108x 108x 108x 108x 108x 108x 108x 108x 108x 108x 108x 108x 108x 108x 108x 108x 108x 108x 108x 108x 108x 108x 108x 108x 108x 108x 108x 108x 108x 108x 108x 108x 108x 108x 108x 108x 108x 108x 108x 108x 108x 108x 108x 108x 108x 108x 108x 108x 108x 108x 108x 108x 108x 108x 108x 108x 108x 108x 108x 108x 108x 108x 108x 108x 108x 108x 108x 108x 108x 108x 108x 108x 108x 108x 108x 108x 108x 108x 108x 108x 108x 108x 108x 484x 484x 484x 13435x 13435x 12635x 12635x 13211x 484x 484x 108x 108x 108x 108x 108x 108x 108x 108x 108x 108x 108x 108x 108x 108x 108x 108x 98x 98x 108x 108x 108x 1497x 1497x 108x 108x 108x 582x 11046x 11046x 582x 582x 108x 108x 108x 3x 3x 3x 3x 3x 3x 3x 3x | // Flow router operator configurations
// These define the available operators for rule-based routing in flow nodes
export interface OperatorConfig {
type: string;
name: string;
operands: number; // Number of operands required (0 = no input needed, 1 = single value, 2 = two values)
categoryName?: string; // Default category name when operands is 0
visibility?: 'hidden' | 'visible'; // Whether to show in UI
filter?: string; // Feature filter requirement
}
// All available operators for flow routing
export const OPERATORS: OperatorConfig[] = [
// Text operators
{
type: 'has_any_word',
name: 'has any of the words',
operands: 1
},
{
type: 'has_all_words',
name: 'has all of the words',
operands: 1
},
{
type: 'has_phrase',
name: 'has the phrase',
operands: 1
},
{
type: 'has_only_phrase',
name: 'has only the phrase',
operands: 1
},
{
type: 'has_beginning',
name: 'starts with',
operands: 1
},
{
type: 'has_text',
name: 'has some text',
operands: 0,
categoryName: 'Has Text'
},
// Number operators
{
type: 'has_number',
name: 'has a number',
operands: 0,
categoryName: 'Has Number'
},
{
type: 'has_number_between',
name: 'has a number between',
operands: 2
},
{
type: 'has_number_lt',
name: 'has a number below',
operands: 1
},
{
type: 'has_number_lte',
name: 'has a number at or below',
operands: 1
},
{
type: 'has_number_eq',
name: 'has a number equal to',
operands: 1
},
{
type: 'has_number_gte',
name: 'has a number at or above',
operands: 1
},
{
type: 'has_number_gt',
name: 'has a number above',
operands: 1
},
// Date operators
{
type: 'has_date',
name: 'has a date',
operands: 0,
categoryName: 'Has Date'
},
{
type: 'has_date_lt',
name: 'has a date before',
operands: 1
},
{
type: 'has_date_eq',
name: 'has a date equal to',
operands: 1
},
{
type: 'has_date_gt',
name: 'has a date after',
operands: 1
},
{
type: 'has_time',
name: 'has a time',
operands: 0,
categoryName: 'Has Time'
},
// Contact data operators
{
type: 'has_phone',
name: 'has a phone number',
operands: 0,
categoryName: 'Has Phone'
},
{
type: 'has_email',
name: 'has an email',
operands: 0,
categoryName: 'Has Email'
},
// Location operators (require location feature)
{
type: 'has_state',
name: 'has state',
operands: 0,
categoryName: 'Has State',
filter: 'locations'
},
{
type: 'has_district',
name: 'has district',
operands: 1,
categoryName: 'Has District',
filter: 'locations'
},
{
type: 'has_ward',
name: 'has ward',
operands: 2,
categoryName: 'Has Ward',
filter: 'locations'
},
// Hidden/system operators
{
type: 'has_group',
name: 'is in the group',
operands: 1,
visibility: 'hidden'
},
{
type: 'has_category',
name: 'has the category',
operands: 0,
visibility: 'hidden'
},
{
type: 'has_error',
name: 'has an error',
operands: 0,
categoryName: 'Has Error',
visibility: 'hidden'
},
{
type: 'has_value',
name: 'is not empty',
operands: 0,
categoryName: 'Not Empty',
visibility: 'hidden'
},
{
type: 'has_pattern',
name: 'matches regex',
operands: 1
}
];
// Get operators suitable for wait_for_response rules
// When features are provided, includes operators whose filter matches an enabled feature
export const getWaitForResponseOperators = (
features?: string[]
): OperatorConfig[] => {
return OPERATORS.filter((op) => {
if (op.visibility === 'hidden') return false;
if (op.filter) {
return features ? features.includes(op.filter) : false;
}
return true;
});
};
// Number operator types used for digit-based routing
const DIGIT_OPERATOR_TYPES = new Set([
'has_beginning',
'has_number',
'has_number_between',
'has_number_lt',
'has_number_lte',
'has_number_eq',
'has_number_gte',
'has_number_gt',
'has_pattern'
]);
// Get operators suitable for wait_for_digits rules (number operators + regex)
export const getDigitOperators = (): OperatorConfig[] => {
return OPERATORS.filter((op) => DIGIT_OPERATOR_TYPES.has(op.type));
};
// Get operator configuration by type
export const getOperatorConfig = (type: string): OperatorConfig | undefined => {
return OPERATORS.find((op) => op.type === type);
};
// Convert operators to select options
export const operatorsToSelectOptions = (operators: OperatorConfig[]) => {
return operators.map((op) => ({
value: op.type,
name: op.name
}));
};
// Create an operator object for select components
export const createOperatorOption = (
type: string
): { value: string; name: string } => {
const config = getOperatorConfig(type);
return {
value: type,
name: config ? config.name : type
};
};
|