@@ -92,6 +92,7 @@ export const executeChatwootBlock = (
|
||||
outgoingEdgeId: block.outgoingEdgeId,
|
||||
clientSideActions: [
|
||||
{
|
||||
type: 'chatwoot',
|
||||
chatwoot: {
|
||||
scriptToExecute: {
|
||||
content: parseVariables(typebot.variables, { fieldToParse: 'id' })(
|
||||
|
||||
@@ -17,6 +17,7 @@ export const executeGoogleAnalyticsBlock = (
|
||||
outgoingEdgeId: block.outgoingEdgeId,
|
||||
clientSideActions: [
|
||||
{
|
||||
type: 'googleAnalytics',
|
||||
googleAnalytics,
|
||||
},
|
||||
],
|
||||
|
||||
@@ -96,6 +96,7 @@ export const createChatCompletionOpenAI = async (
|
||||
return {
|
||||
clientSideActions: [
|
||||
{
|
||||
type: 'streamOpenAiChatCompletion',
|
||||
streamOpenAiChatCompletion: {
|
||||
messages: messages as {
|
||||
content?: string
|
||||
|
||||
@@ -22,6 +22,7 @@ export const executePixelBlock = (
|
||||
outgoingEdgeId: block.outgoingEdgeId,
|
||||
clientSideActions: [
|
||||
{
|
||||
type: 'pixel',
|
||||
pixel: {
|
||||
...pixel,
|
||||
pixelId: block.options.pixelId,
|
||||
|
||||
@@ -70,6 +70,7 @@ export const executeWebhookBlock = async (
|
||||
outgoingEdgeId: block.outgoingEdgeId,
|
||||
clientSideActions: [
|
||||
{
|
||||
type: 'webhookToExecute',
|
||||
webhookToExecute: parsedWebhook,
|
||||
expectsDedicatedReply: true,
|
||||
},
|
||||
|
||||
@@ -13,6 +13,7 @@ export const executeRedirect = (
|
||||
return {
|
||||
clientSideActions: [
|
||||
{
|
||||
type: 'redirect',
|
||||
redirect: { url: formattedUrl, isNewTab: block.options.isNewTab },
|
||||
},
|
||||
],
|
||||
|
||||
@@ -21,6 +21,7 @@ export const executeScript = (
|
||||
outgoingEdgeId: block.outgoingEdgeId,
|
||||
clientSideActions: [
|
||||
{
|
||||
type: 'scriptToExecute',
|
||||
scriptToExecute: scriptToExecute,
|
||||
},
|
||||
],
|
||||
|
||||
@@ -32,6 +32,7 @@ export const executeSetVariable = (
|
||||
outgoingEdgeId: block.outgoingEdgeId,
|
||||
clientSideActions: [
|
||||
{
|
||||
type: 'setVariable',
|
||||
setVariable: {
|
||||
scriptToExecute,
|
||||
},
|
||||
|
||||
@@ -24,6 +24,7 @@ export const executeWait = (
|
||||
parsedSecondsToWaitFor || block.options?.shouldPause
|
||||
? [
|
||||
{
|
||||
type: 'wait',
|
||||
wait: { secondsToWaitFor: parsedSecondsToWaitFor ?? 0 },
|
||||
expectsDedicatedReply: block.options.shouldPause,
|
||||
},
|
||||
|
||||
@@ -70,6 +70,7 @@ export const executeForgedBlock = async (
|
||||
outgoingEdgeId: block.outgoingEdgeId,
|
||||
clientSideActions: [
|
||||
{
|
||||
type: 'stream',
|
||||
expectsDedicatedReply: true,
|
||||
stream: true,
|
||||
},
|
||||
@@ -135,6 +136,7 @@ export const executeForgedBlock = async (
|
||||
(state.typebotsQueue[0].resultId || !blockDef.isDisabledInPreview)
|
||||
) {
|
||||
clientSideActions.push({
|
||||
type: 'codeToExecute',
|
||||
codeToExecute: action?.run?.web?.parseFunction({
|
||||
options: parsedOptions,
|
||||
}),
|
||||
|
||||
@@ -36,8 +36,6 @@ import { IntegrationBlockType } from '@typebot.io/schemas/features/blocks/integr
|
||||
import { defaultTheme } from '@typebot.io/schemas/features/typebot/theme/constants'
|
||||
import { VisitedEdge } from '@typebot.io/prisma'
|
||||
import { env } from '@typebot.io/env'
|
||||
import { forgedBlocks } from '@typebot.io/forge-schemas'
|
||||
import { FunctionToExecute } from '@typebot.io/forge'
|
||||
|
||||
type StartParams =
|
||||
| ({
|
||||
@@ -61,7 +59,7 @@ export const startSession = async ({
|
||||
startParams,
|
||||
initialSessionState,
|
||||
}: Props): Promise<
|
||||
Omit<StartChatResponse, 'resultId'> & {
|
||||
Omit<StartChatResponse, 'resultId' | 'isStreamEnabled' | 'sessionId'> & {
|
||||
newSessionState: SessionState
|
||||
visitedEdges: VisitedEdge[]
|
||||
resultId?: string
|
||||
@@ -427,7 +425,7 @@ const parseStartClientSideAction = (
|
||||
)
|
||||
return
|
||||
|
||||
return { startPropsToInject }
|
||||
return { type: 'startPropsToInject', startPropsToInject }
|
||||
}
|
||||
|
||||
const sanitizeAndParseTheme = (
|
||||
|
||||
@@ -92,6 +92,7 @@ export const startWhatsAppSession = async ({
|
||||
type: 'live',
|
||||
publicId: publicTypebot.typebot.publicId as string,
|
||||
isOnlyRegistering: false,
|
||||
isStreamEnabled: false,
|
||||
},
|
||||
initialSessionState: {
|
||||
whatsApp: {
|
||||
|
||||
Reference in New Issue
Block a user