Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
public static create(dialogId: string, config?: CallDialogConfiguration): CallDialog {
const dialog = new CallDialog();
dialog.dialogId = dialogId;
if (config) {
if (config.options) { dialog.options = config.options }
if (config.property) { dialog.property = config.property }
Dialog.configure(dialog, config);
}
return dialog;
}
}
static create(entityName: string, property: string, config?: DialogConfiguration): MapEntity {
const dialog = new MapEntity();
dialog.entityName= entityName;
dialog.property = property;
if (config) {
Dialog.configure(dialog, config);
}
return dialog;
}
}
static create(expression: (state: DialogContextState) => Promise, config?: DialogConfiguration): SetProperty {
const dialog = new SetProperty();
dialog.expression = expression;
if (config) {
Dialog.configure(dialog, config);
}
return dialog;
}
}
static create(config?: GotoDialogConfiguration): GotoDialog {
const dialog = new GotoDialog();
if (config) {
if (config.dialogId) { dialog.dialogId = config.dialogId }
if (config.options) { dialog.options = config.options }
Dialog.configure(dialog, config);
}
return dialog;
}
}
static create(listProperty: string, messageTemplate: string, itemTemplate?: string, config?: DialogConfiguration): SendList {
itemTemplate = itemTemplate || '- {item}\n';
if (messageTemplate.indexOf('{list}') < 0) {
messageTemplate += '\n\n{list}';
}
if (itemTemplate.indexOf('{item') < 0) {
itemTemplate += ' {item}\n';
}
const dialog = new SendList();
dialog.listProperty = listProperty;
dialog.messageTemplate.value = messageTemplate;
dialog.itemTemplate.value = itemTemplate;
if (config) {
Dialog.configure(dialog, config);
}
return dialog;
}
}