feat(engine): ✨ Link typebot step
This commit is contained in:
@ -3,11 +3,19 @@ import { PublicTypebot as PublicTypebotFromPrisma } from 'db'
|
||||
|
||||
export type PublicTypebot = Omit<
|
||||
PublicTypebotFromPrisma,
|
||||
'blocks' | 'theme' | 'settings' | 'variables' | 'edges'
|
||||
| 'blocks'
|
||||
| 'theme'
|
||||
| 'settings'
|
||||
| 'variables'
|
||||
| 'edges'
|
||||
| 'createdAt'
|
||||
| 'updatedAt'
|
||||
> & {
|
||||
blocks: Block[]
|
||||
variables: Variable[]
|
||||
edges: Edge[]
|
||||
theme: Theme
|
||||
settings: Settings
|
||||
createdAt: string
|
||||
updatedAt: string
|
||||
}
|
||||
|
@ -6,17 +6,20 @@ export type LogicStep =
|
||||
| ConditionStep
|
||||
| RedirectStep
|
||||
| CodeStep
|
||||
| TypebotLinkStep
|
||||
|
||||
export type LogicStepOptions =
|
||||
| SetVariableOptions
|
||||
| RedirectOptions
|
||||
| CodeOptions
|
||||
| TypebotLinkOptions
|
||||
|
||||
export enum LogicStepType {
|
||||
SET_VARIABLE = 'Set variable',
|
||||
CONDITION = 'Condition',
|
||||
REDIRECT = 'Redirect',
|
||||
CODE = 'Code',
|
||||
TYPEBOT_LINK = 'Typebot link',
|
||||
}
|
||||
|
||||
export type SetVariableStep = StepBase & {
|
||||
@ -44,6 +47,11 @@ export type CodeStep = StepBase & {
|
||||
options: CodeOptions
|
||||
}
|
||||
|
||||
export type TypebotLinkStep = StepBase & {
|
||||
type: LogicStepType.TYPEBOT_LINK
|
||||
options: TypebotLinkOptions
|
||||
}
|
||||
|
||||
export enum LogicalOperator {
|
||||
OR = 'OR',
|
||||
AND = 'AND',
|
||||
@ -85,6 +93,11 @@ export type CodeOptions = {
|
||||
content?: string
|
||||
}
|
||||
|
||||
export type TypebotLinkOptions = {
|
||||
typebotId?: string
|
||||
blockId?: string
|
||||
}
|
||||
|
||||
export const defaultSetVariablesOptions: SetVariableOptions = {}
|
||||
|
||||
export const defaultConditionContent: ConditionContent = {
|
||||
@ -95,3 +108,5 @@ export const defaultConditionContent: ConditionContent = {
|
||||
export const defaultRedirectOptions: RedirectOptions = { isNewTab: false }
|
||||
|
||||
export const defaultCodeOptions: CodeOptions = { name: 'Code snippet' }
|
||||
|
||||
export const defaultTypebotLinkOptions: TypebotLinkOptions = {}
|
||||
|
@ -6,13 +6,21 @@ import { Variable } from './variable'
|
||||
|
||||
export type Typebot = Omit<
|
||||
TypebotFromPrisma,
|
||||
'blocks' | 'theme' | 'settings' | 'variables' | 'edges'
|
||||
| 'blocks'
|
||||
| 'theme'
|
||||
| 'settings'
|
||||
| 'variables'
|
||||
| 'edges'
|
||||
| 'createdAt'
|
||||
| 'updatedAt'
|
||||
> & {
|
||||
blocks: Block[]
|
||||
variables: Variable[]
|
||||
edges: Edge[]
|
||||
theme: Theme
|
||||
settings: Settings
|
||||
createdAt: string
|
||||
updatedAt: string
|
||||
}
|
||||
|
||||
export type Block = {
|
||||
|
Reference in New Issue
Block a user