Skip to content

Instantly share code, notes, and snippets.

@eduardomoroni
Created May 13, 2020 08:13
Show Gist options
  • Save eduardomoroni/8a35d2c8f2d4d1515684461c19819a98 to your computer and use it in GitHub Desktop.
Save eduardomoroni/8a35d2c8f2d4d1515684461c19819a98 to your computer and use it in GitHub Desktop.
Schema Draft
interface GuideBotConfiguration {
id?: string; // If you don't pass an id we're creating a new bot
name: string;
alias: string;
enabled: boolean;
type: "ROUTING";
// widgetPublicId: string; Taken from the path
configuration: {
offlineMessage: string;
steps: Array<Step>; // non empty array
}
}
interface Step {
prompt: string;
id: string;
intents: Array<Intent>; // non empty array
}
type GuideBotOperation =
| TagTransferOperation
| EndChatOperation
| StepReferenceOperation
| WidgetTransferOperation;
interface Intent {
message: string; // we gotta find better naming for that, this is what is going to be the button text
value?: string;
id: string; // Generated by the fronted
operation: GuideBotOperation;
}
interface Operation { // UI calls it option, should we call it option as well?
type: ENUM ["WidgetTransfer", "Bye", "TagTransfer", "StepReference"];
}
interface WidgetTransferOperation extends Operation {
widgetPublicId: string;
postMessage: string;
}
interface ByeOperation extends Operation {
postMessage: string;
}
interface TagTransferOperation extends Operation {
widgetPublicId?: string;
tag: string;
postMessage: string;
}
interface StepReferenceOperation extends Operation {
referred: string; // Step Id
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment