233
}
234
case 'string': {
236
const enumNames = field.enumNames;
237
const options: ChatInputOption[] = field.enum.map((value, idx) => ({ id: value, label: enumNames?.[idx] ?? value }));
238
return { ...base, kind: ChatInputQuestionKind.SingleSelect, options };
239
}
241
const options: ChatInputOption[] = field.oneOf.map(option => ({ id: option.const, label: option.title }));
242
return { ...base, kind: ChatInputQuestionKind.SingleSelect, options };
243
}
245
>
...base,
246
>
kind: ChatInputQuestionKind.Text,
247
>
format: field.format,
248
>
min: field.minLength,
249
>
max: field.maxLength,
250
>
defaultValue: field.default,
251
>
};
252
>
}
253
}
254
}