🐛 New sendMessage version for the new parser
Make sure old client still communicate with old parser
This commit is contained in:
@@ -142,8 +142,8 @@ test.describe.parallel('Google sheets integration', () => {
|
||||
.locator('input[placeholder="Type your email..."]')
|
||||
.press('Enter')
|
||||
await expect(
|
||||
page.locator('typebot-standard').locator('text=Your name is:')
|
||||
).toHaveText(`Your name is: Georges2 Last name`)
|
||||
page.locator('typebot-standard').locator('text=Georges2')
|
||||
).toBeVisible()
|
||||
})
|
||||
})
|
||||
|
||||
|
||||
@@ -62,7 +62,7 @@ export const ApiPreviewInstructions = (props: StackProps) => {
|
||||
lang={'shell'}
|
||||
value={`${parseApiHost(
|
||||
typebot?.customDomain
|
||||
)}/api/v1/sendMessage`}
|
||||
)}/api/v2/sendMessage`}
|
||||
/>
|
||||
<Text>with the following JSON body:</Text>
|
||||
<CodeEditor isReadOnly lang={'json'} value={startParamsBody} />
|
||||
@@ -82,7 +82,7 @@ export const ApiPreviewInstructions = (props: StackProps) => {
|
||||
lang={'shell'}
|
||||
value={`${parseApiHost(
|
||||
typebot?.customDomain
|
||||
)}/api/v1/sendMessage`}
|
||||
)}/api/v2/sendMessage`}
|
||||
/>
|
||||
<Text>With the following JSON body:</Text>
|
||||
<CodeEditor isReadOnly lang={'json'} value={replyBody} />
|
||||
|
||||
@@ -61,7 +61,7 @@ export const ApiModal = ({
|
||||
lang={'shell'}
|
||||
value={`${parseApiHost(
|
||||
typebot?.customDomain
|
||||
)}/api/v1/sendMessage`}
|
||||
)}/api/v2/sendMessage`}
|
||||
/>
|
||||
<Text>with the following JSON body:</Text>
|
||||
<CodeEditor isReadOnly lang={'json'} value={startParamsBody} />
|
||||
@@ -81,7 +81,7 @@ export const ApiModal = ({
|
||||
lang={'shell'}
|
||||
value={`${parseApiHost(
|
||||
typebot?.customDomain
|
||||
)}/api/v1/sendMessage`}
|
||||
)}/api/v2/sendMessage`}
|
||||
/>
|
||||
<Text>With the following JSON body:</Text>
|
||||
<CodeEditor isReadOnly lang={'json'} value={replyBody} />
|
||||
|
||||
@@ -43,7 +43,7 @@ export const parseReactBotProps = ({ typebot, apiHost }: BotProps) => {
|
||||
}
|
||||
|
||||
export const typebotImportCode = isCloudProdInstance()
|
||||
? `import Typebot from 'https://cdn.jsdelivr.net/npm/@typebot.io/js@0.1/dist/web.js'`
|
||||
? `import Typebot from 'https://cdn.jsdelivr.net/npm/@typebot.io/js@0.2/dist/web.js'`
|
||||
: `import Typebot from 'https://cdn.jsdelivr.net/npm/@typebot.io/js@${packageJson.version}/dist/web.js'`
|
||||
|
||||
export const parseInlineScript = (script: string) =>
|
||||
|
||||
@@ -91,6 +91,7 @@ export const startWhatsAppPreview = authenticatedProcedure
|
||||
|
||||
const { newSessionState, messages, input, clientSideActions, logs } =
|
||||
await startSession({
|
||||
version: 2,
|
||||
message: undefined,
|
||||
startParams: {
|
||||
isOnlyRegistering: !canSendDirectMessagesToUser,
|
||||
|
||||
Reference in New Issue
Block a user