@ -61,7 +61,7 @@ export const executeChatwootBlock = (
|
||||
{
|
||||
lastBubbleBlockId,
|
||||
chatwoot: {
|
||||
codeToExecute: {
|
||||
scriptToExecute: {
|
||||
content: parseVariables(variables, { fieldToParse: 'id' })(
|
||||
chatwootCode
|
||||
),
|
||||
|
@ -1 +0,0 @@
|
||||
export { executeCode } from './utils/executeCode'
|
@ -4,11 +4,11 @@ import {
|
||||
parseCorrectValueType,
|
||||
extractVariablesFromText,
|
||||
} from '@/features/variables'
|
||||
import { CodeBlock, SessionState } from 'models'
|
||||
import { ScriptBlock, SessionState } from 'models'
|
||||
|
||||
export const executeCode = (
|
||||
export const executeScript = (
|
||||
{ typebot: { variables } }: SessionState,
|
||||
block: CodeBlock,
|
||||
block: ScriptBlock,
|
||||
lastBubbleBlockId?: string
|
||||
): ExecuteLogicResponse => {
|
||||
if (!block.options.content) return { outgoingEdgeId: block.outgoingEdgeId }
|
||||
@ -27,7 +27,7 @@ export const executeCode = (
|
||||
outgoingEdgeId: block.outgoingEdgeId,
|
||||
clientSideActions: [
|
||||
{
|
||||
codeToExecute: {
|
||||
scriptToExecute: {
|
||||
content,
|
||||
args,
|
||||
},
|
@ -1,4 +1,3 @@
|
||||
import { executeCode } from '@/features/blocks/logic/code/api'
|
||||
import { executeCondition } from '@/features/blocks/logic/condition/api'
|
||||
import { executeRedirect } from '@/features/blocks/logic/redirect/api'
|
||||
import { executeSetVariable } from '@/features/blocks/logic/setVariable/api'
|
||||
@ -6,6 +5,7 @@ import { executeTypebotLink } from '@/features/blocks/logic/typebotLink/api'
|
||||
import { executeWait } from '@/features/blocks/logic/wait/api/utils/executeWait'
|
||||
import { LogicBlock, LogicBlockType, SessionState } from 'models'
|
||||
import { ExecuteLogicResponse } from '../../types'
|
||||
import { executeScript } from '@/features/blocks/logic/script/executeScript'
|
||||
|
||||
export const executeLogic =
|
||||
(state: SessionState, lastBubbleBlockId?: string) =>
|
||||
@ -17,8 +17,8 @@ export const executeLogic =
|
||||
return executeCondition(state, block)
|
||||
case LogicBlockType.REDIRECT:
|
||||
return executeRedirect(state, block, lastBubbleBlockId)
|
||||
case LogicBlockType.CODE:
|
||||
return executeCode(state, block, lastBubbleBlockId)
|
||||
case LogicBlockType.SCRIPT:
|
||||
return executeScript(state, block, lastBubbleBlockId)
|
||||
case LogicBlockType.TYPEBOT_LINK:
|
||||
return executeTypebotLink(state, block)
|
||||
case LogicBlockType.WAIT:
|
||||
|
Reference in New Issue
Block a user