📦 Update cuid to cuid2
This commit is contained in:
@@ -57,7 +57,7 @@
|
|||||||
"canvas-confetti": "1.6.0",
|
"canvas-confetti": "1.6.0",
|
||||||
"chakra-react-select": "^4.4.3",
|
"chakra-react-select": "^4.4.3",
|
||||||
"codemirror": "6.0.1",
|
"codemirror": "6.0.1",
|
||||||
"cuid": "3.0.0",
|
"@paralleldrive/cuid2": "2.0.1",
|
||||||
"deep-object-diff": "1.1.9",
|
"deep-object-diff": "1.1.9",
|
||||||
"dequal": "2.0.3",
|
"dequal": "2.0.3",
|
||||||
"emails": "workspace:*",
|
"emails": "workspace:*",
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { Box, Button, Fade, Flex, IconButton, Stack } from '@chakra-ui/react'
|
import { Box, Button, Fade, Flex, IconButton, Stack } from '@chakra-ui/react'
|
||||||
import { TrashIcon, PlusIcon } from '@/components/icons'
|
import { TrashIcon, PlusIcon } from '@/components/icons'
|
||||||
import cuid from 'cuid'
|
import { createId } from '@paralleldrive/cuid2'
|
||||||
import React, { useState } from 'react'
|
import React, { useState } from 'react'
|
||||||
|
|
||||||
type ItemWithId<T> = T & { id: string }
|
type ItemWithId<T> = T & { id: string }
|
||||||
@@ -32,7 +32,7 @@ export const TableList = <T,>({
|
|||||||
const [showDeleteIndex, setShowDeleteIndex] = useState<number | null>(null)
|
const [showDeleteIndex, setShowDeleteIndex] = useState<number | null>(null)
|
||||||
|
|
||||||
const createItem = () => {
|
const createItem = () => {
|
||||||
const id = cuid()
|
const id = createId()
|
||||||
const newItem = { id } as ItemWithId<T>
|
const newItem = { id } as ItemWithId<T>
|
||||||
setItems([...items, newItem])
|
setItems([...items, newItem])
|
||||||
onItemsChange([...items, newItem])
|
onItemsChange([...items, newItem])
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ import {
|
|||||||
} from '@chakra-ui/react'
|
} from '@chakra-ui/react'
|
||||||
import { EditIcon, PlusIcon, TrashIcon } from '@/components/icons'
|
import { EditIcon, PlusIcon, TrashIcon } from '@/components/icons'
|
||||||
import { useTypebot } from '@/features/editor/providers/TypebotProvider/TypebotProvider'
|
import { useTypebot } from '@/features/editor/providers/TypebotProvider/TypebotProvider'
|
||||||
import cuid from 'cuid'
|
import { createId } from '@paralleldrive/cuid2'
|
||||||
import { Variable } from 'models'
|
import { Variable } from 'models'
|
||||||
import React, { useState, useRef, ChangeEvent, useEffect } from 'react'
|
import React, { useState, useRef, ChangeEvent, useEffect } from 'react'
|
||||||
import { byId, isDefined, isNotDefined } from 'utils'
|
import { byId, isDefined, isNotDefined } from 'utils'
|
||||||
@@ -90,7 +90,7 @@ export const VariableSearchInput = ({
|
|||||||
|
|
||||||
const handleCreateNewVariableClick = () => {
|
const handleCreateNewVariableClick = () => {
|
||||||
if (!inputValue || inputValue === '') return
|
if (!inputValue || inputValue === '') return
|
||||||
const id = 'v' + cuid()
|
const id = 'v' + createId()
|
||||||
onSelectVariable({ id, name: inputValue })
|
onSelectVariable({ id, name: inputValue })
|
||||||
createVariable({ id, name: inputValue })
|
createVariable({ id, name: inputValue })
|
||||||
inputRef.current?.blur()
|
inputRef.current?.blur()
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { getTestAsset } from '@/test/utils/playwright'
|
import { getTestAsset } from '@/test/utils/playwright'
|
||||||
import test, { expect } from '@playwright/test'
|
import test, { expect } from '@playwright/test'
|
||||||
import cuid from 'cuid'
|
import { createId } from '@paralleldrive/cuid2'
|
||||||
import {
|
import {
|
||||||
importTypebotInDatabase,
|
importTypebotInDatabase,
|
||||||
injectFakeResults,
|
injectFakeResults,
|
||||||
@@ -8,7 +8,7 @@ import {
|
|||||||
import { starterWorkspaceId } from 'utils/playwright/databaseSetup'
|
import { starterWorkspaceId } from 'utils/playwright/databaseSetup'
|
||||||
|
|
||||||
test('analytics are not available for non-pro workspaces', async ({ page }) => {
|
test('analytics are not available for non-pro workspaces', async ({ page }) => {
|
||||||
const typebotId = cuid()
|
const typebotId = createId()
|
||||||
await importTypebotInDatabase(
|
await importTypebotInDatabase(
|
||||||
getTestAsset('typebots/results/submissionHeader.json'),
|
getTestAsset('typebots/results/submissionHeader.json'),
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ import {
|
|||||||
createClaimableCustomPlan,
|
createClaimableCustomPlan,
|
||||||
} from '@/test/utils/databaseActions'
|
} from '@/test/utils/databaseActions'
|
||||||
import test, { expect } from '@playwright/test'
|
import test, { expect } from '@playwright/test'
|
||||||
import cuid from 'cuid'
|
import { createId } from '@paralleldrive/cuid2'
|
||||||
import { Plan } from 'db'
|
import { Plan } from 'db'
|
||||||
import {
|
import {
|
||||||
createTypebots,
|
createTypebots,
|
||||||
@@ -12,10 +12,10 @@ import {
|
|||||||
injectFakeResults,
|
injectFakeResults,
|
||||||
} from 'utils/playwright/databaseActions'
|
} from 'utils/playwright/databaseActions'
|
||||||
|
|
||||||
const usageWorkspaceId = cuid()
|
const usageWorkspaceId = createId()
|
||||||
const usageTypebotId = cuid()
|
const usageTypebotId = createId()
|
||||||
const planChangeWorkspaceId = cuid()
|
const planChangeWorkspaceId = createId()
|
||||||
const enterpriseWorkspaceId = cuid()
|
const enterpriseWorkspaceId = createId()
|
||||||
|
|
||||||
test.beforeAll(async () => {
|
test.beforeAll(async () => {
|
||||||
await createWorkspaces([
|
await createWorkspaces([
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ import test, { expect } from '@playwright/test'
|
|||||||
import { createTypebots } from 'utils/playwright/databaseActions'
|
import { createTypebots } from 'utils/playwright/databaseActions'
|
||||||
import { parseDefaultGroupWithBlock } from 'utils/playwright/databaseHelpers'
|
import { parseDefaultGroupWithBlock } from 'utils/playwright/databaseHelpers'
|
||||||
import { BubbleBlockType, defaultAudioBubbleContent } from 'models'
|
import { BubbleBlockType, defaultAudioBubbleContent } from 'models'
|
||||||
import cuid from 'cuid'
|
import { createId } from '@paralleldrive/cuid2'
|
||||||
import { getTestAsset } from '@/test/utils/playwright'
|
import { getTestAsset } from '@/test/utils/playwright'
|
||||||
import { typebotViewer } from 'utils/playwright/testHelpers'
|
import { typebotViewer } from 'utils/playwright/testHelpers'
|
||||||
|
|
||||||
@@ -10,7 +10,7 @@ const audioSampleUrl =
|
|||||||
'https://www.soundhelix.com/examples/mp3/SoundHelix-Song-1.mp3'
|
'https://www.soundhelix.com/examples/mp3/SoundHelix-Song-1.mp3'
|
||||||
|
|
||||||
test('should work as expected', async ({ page }) => {
|
test('should work as expected', async ({ page }) => {
|
||||||
const typebotId = cuid()
|
const typebotId = createId()
|
||||||
await createTypebots([
|
await createTypebots([
|
||||||
{
|
{
|
||||||
id: typebotId,
|
id: typebotId,
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import test, { expect } from '@playwright/test'
|
import test, { expect } from '@playwright/test'
|
||||||
import { BubbleBlockType, defaultEmbedBubbleContent } from 'models'
|
import { BubbleBlockType, defaultEmbedBubbleContent } from 'models'
|
||||||
import cuid from 'cuid'
|
import { createId } from '@paralleldrive/cuid2'
|
||||||
import { createTypebots } from 'utils/playwright/databaseActions'
|
import { createTypebots } from 'utils/playwright/databaseActions'
|
||||||
import { parseDefaultGroupWithBlock } from 'utils/playwright/databaseHelpers'
|
import { parseDefaultGroupWithBlock } from 'utils/playwright/databaseHelpers'
|
||||||
import { typebotViewer } from 'utils/playwright/testHelpers'
|
import { typebotViewer } from 'utils/playwright/testHelpers'
|
||||||
@@ -11,7 +11,7 @@ const siteSrc = 'https://app.cal.com/baptistearno/15min'
|
|||||||
test.describe.parallel('Embed bubble block', () => {
|
test.describe.parallel('Embed bubble block', () => {
|
||||||
test.describe('Content settings', () => {
|
test.describe('Content settings', () => {
|
||||||
test('should import and parse embed correctly', async ({ page }) => {
|
test('should import and parse embed correctly', async ({ page }) => {
|
||||||
const typebotId = cuid()
|
const typebotId = createId()
|
||||||
await createTypebots([
|
await createTypebots([
|
||||||
{
|
{
|
||||||
id: typebotId,
|
id: typebotId,
|
||||||
@@ -31,7 +31,7 @@ test.describe.parallel('Embed bubble block', () => {
|
|||||||
|
|
||||||
test.describe('Preview', () => {
|
test.describe('Preview', () => {
|
||||||
test('should display embed correctly', async ({ page }) => {
|
test('should display embed correctly', async ({ page }) => {
|
||||||
const typebotId = cuid()
|
const typebotId = createId()
|
||||||
await createTypebots([
|
await createTypebots([
|
||||||
{
|
{
|
||||||
id: typebotId,
|
id: typebotId,
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ import test, { expect } from '@playwright/test'
|
|||||||
import { createTypebots } from 'utils/playwright/databaseActions'
|
import { createTypebots } from 'utils/playwright/databaseActions'
|
||||||
import { parseDefaultGroupWithBlock } from 'utils/playwright/databaseHelpers'
|
import { parseDefaultGroupWithBlock } from 'utils/playwright/databaseHelpers'
|
||||||
import { BubbleBlockType, defaultImageBubbleContent } from 'models'
|
import { BubbleBlockType, defaultImageBubbleContent } from 'models'
|
||||||
import cuid from 'cuid'
|
import { createId } from '@paralleldrive/cuid2'
|
||||||
import { typebotViewer } from 'utils/playwright/testHelpers'
|
import { typebotViewer } from 'utils/playwright/testHelpers'
|
||||||
import { getTestAsset } from '@/test/utils/playwright'
|
import { getTestAsset } from '@/test/utils/playwright'
|
||||||
|
|
||||||
@@ -12,7 +12,7 @@ const unsplashImageSrc =
|
|||||||
test.describe.parallel('Image bubble block', () => {
|
test.describe.parallel('Image bubble block', () => {
|
||||||
test.describe('Content settings', () => {
|
test.describe('Content settings', () => {
|
||||||
test('should upload image file correctly', async ({ page }) => {
|
test('should upload image file correctly', async ({ page }) => {
|
||||||
const typebotId = cuid()
|
const typebotId = createId()
|
||||||
await createTypebots([
|
await createTypebots([
|
||||||
{
|
{
|
||||||
id: typebotId,
|
id: typebotId,
|
||||||
@@ -34,7 +34,7 @@ test.describe.parallel('Image bubble block', () => {
|
|||||||
})
|
})
|
||||||
|
|
||||||
test('should import image link correctly', async ({ page }) => {
|
test('should import image link correctly', async ({ page }) => {
|
||||||
const typebotId = cuid()
|
const typebotId = createId()
|
||||||
await createTypebots([
|
await createTypebots([
|
||||||
{
|
{
|
||||||
id: typebotId,
|
id: typebotId,
|
||||||
@@ -57,7 +57,7 @@ test.describe.parallel('Image bubble block', () => {
|
|||||||
})
|
})
|
||||||
|
|
||||||
test('should import gifs correctly', async ({ page }) => {
|
test('should import gifs correctly', async ({ page }) => {
|
||||||
const typebotId = cuid()
|
const typebotId = createId()
|
||||||
await createTypebots([
|
await createTypebots([
|
||||||
{
|
{
|
||||||
id: typebotId,
|
id: typebotId,
|
||||||
@@ -102,7 +102,7 @@ test.describe.parallel('Image bubble block', () => {
|
|||||||
|
|
||||||
test.describe('Preview', () => {
|
test.describe('Preview', () => {
|
||||||
test('should display correctly', async ({ page }) => {
|
test('should display correctly', async ({ page }) => {
|
||||||
const typebotId = cuid()
|
const typebotId = createId()
|
||||||
await createTypebots([
|
await createTypebots([
|
||||||
{
|
{
|
||||||
id: typebotId,
|
id: typebotId,
|
||||||
|
|||||||
@@ -2,12 +2,12 @@ import test, { expect } from '@playwright/test'
|
|||||||
import { createTypebots } from 'utils/playwright/databaseActions'
|
import { createTypebots } from 'utils/playwright/databaseActions'
|
||||||
import { parseDefaultGroupWithBlock } from 'utils/playwright/databaseHelpers'
|
import { parseDefaultGroupWithBlock } from 'utils/playwright/databaseHelpers'
|
||||||
import { BubbleBlockType, defaultTextBubbleContent } from 'models'
|
import { BubbleBlockType, defaultTextBubbleContent } from 'models'
|
||||||
import cuid from 'cuid'
|
import { createId } from '@paralleldrive/cuid2'
|
||||||
import { typebotViewer } from 'utils/playwright/testHelpers'
|
import { typebotViewer } from 'utils/playwright/testHelpers'
|
||||||
|
|
||||||
test.describe('Text bubble block', () => {
|
test.describe('Text bubble block', () => {
|
||||||
test('rich text features should work', async ({ page }) => {
|
test('rich text features should work', async ({ page }) => {
|
||||||
const typebotId = cuid()
|
const typebotId = createId()
|
||||||
await createTypebots([
|
await createTypebots([
|
||||||
{
|
{
|
||||||
id: typebotId,
|
id: typebotId,
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ import {
|
|||||||
defaultVideoBubbleContent,
|
defaultVideoBubbleContent,
|
||||||
VideoBubbleContentType,
|
VideoBubbleContentType,
|
||||||
} from 'models'
|
} from 'models'
|
||||||
import cuid from 'cuid'
|
import { createId } from '@paralleldrive/cuid2'
|
||||||
import { typebotViewer } from 'utils/playwright/testHelpers'
|
import { typebotViewer } from 'utils/playwright/testHelpers'
|
||||||
|
|
||||||
const videoSrc =
|
const videoSrc =
|
||||||
@@ -17,7 +17,7 @@ const vimeoVideoSrc = 'https://vimeo.com/649301125'
|
|||||||
test.describe.parallel('Video bubble block', () => {
|
test.describe.parallel('Video bubble block', () => {
|
||||||
test.describe('Content settings', () => {
|
test.describe('Content settings', () => {
|
||||||
test('should import video url correctly', async ({ page }) => {
|
test('should import video url correctly', async ({ page }) => {
|
||||||
const typebotId = cuid()
|
const typebotId = createId()
|
||||||
await createTypebots([
|
await createTypebots([
|
||||||
{
|
{
|
||||||
id: typebotId,
|
id: typebotId,
|
||||||
@@ -41,7 +41,7 @@ test.describe.parallel('Video bubble block', () => {
|
|||||||
|
|
||||||
test.describe('Preview', () => {
|
test.describe('Preview', () => {
|
||||||
test('should display video correctly', async ({ page }) => {
|
test('should display video correctly', async ({ page }) => {
|
||||||
const typebotId = cuid()
|
const typebotId = createId()
|
||||||
await createTypebots([
|
await createTypebots([
|
||||||
{
|
{
|
||||||
id: typebotId,
|
id: typebotId,
|
||||||
@@ -63,7 +63,7 @@ test.describe.parallel('Video bubble block', () => {
|
|||||||
})
|
})
|
||||||
|
|
||||||
test('should display youtube video correctly', async ({ page }) => {
|
test('should display youtube video correctly', async ({ page }) => {
|
||||||
const typebotId = cuid()
|
const typebotId = createId()
|
||||||
await createTypebots([
|
await createTypebots([
|
||||||
{
|
{
|
||||||
id: typebotId,
|
id: typebotId,
|
||||||
@@ -87,7 +87,7 @@ test.describe.parallel('Video bubble block', () => {
|
|||||||
})
|
})
|
||||||
|
|
||||||
test('should display vimeo video correctly', async ({ page }) => {
|
test('should display vimeo video correctly', async ({ page }) => {
|
||||||
const typebotId = cuid()
|
const typebotId = createId()
|
||||||
await createTypebots([
|
await createTypebots([
|
||||||
{
|
{
|
||||||
id: typebotId,
|
id: typebotId,
|
||||||
|
|||||||
@@ -5,13 +5,13 @@ import {
|
|||||||
} from 'utils/playwright/databaseActions'
|
} from 'utils/playwright/databaseActions'
|
||||||
import { parseDefaultGroupWithBlock } from 'utils/playwright/databaseHelpers'
|
import { parseDefaultGroupWithBlock } from 'utils/playwright/databaseHelpers'
|
||||||
import { defaultChoiceInputOptions, InputBlockType, ItemType } from 'models'
|
import { defaultChoiceInputOptions, InputBlockType, ItemType } from 'models'
|
||||||
import cuid from 'cuid'
|
import { createId } from '@paralleldrive/cuid2'
|
||||||
import { typebotViewer } from 'utils/playwright/testHelpers'
|
import { typebotViewer } from 'utils/playwright/testHelpers'
|
||||||
import { getTestAsset } from '@/test/utils/playwright'
|
import { getTestAsset } from '@/test/utils/playwright'
|
||||||
|
|
||||||
test.describe.parallel('Buttons input block', () => {
|
test.describe.parallel('Buttons input block', () => {
|
||||||
test('can edit button items', async ({ page }) => {
|
test('can edit button items', async ({ page }) => {
|
||||||
const typebotId = cuid()
|
const typebotId = createId()
|
||||||
await createTypebots([
|
await createTypebots([
|
||||||
{
|
{
|
||||||
id: typebotId,
|
id: typebotId,
|
||||||
@@ -75,7 +75,7 @@ test.describe.parallel('Buttons input block', () => {
|
|||||||
})
|
})
|
||||||
|
|
||||||
test('Variable buttons should work', async ({ page }) => {
|
test('Variable buttons should work', async ({ page }) => {
|
||||||
const typebotId = cuid()
|
const typebotId = createId()
|
||||||
await importTypebotInDatabase(
|
await importTypebotInDatabase(
|
||||||
getTestAsset('typebots/inputs/variableButton.json'),
|
getTestAsset('typebots/inputs/variableButton.json'),
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -3,11 +3,11 @@ import { createTypebots } from 'utils/playwright/databaseActions'
|
|||||||
import { parseDefaultGroupWithBlock } from 'utils/playwright/databaseHelpers'
|
import { parseDefaultGroupWithBlock } from 'utils/playwright/databaseHelpers'
|
||||||
import { defaultDateInputOptions, InputBlockType } from 'models'
|
import { defaultDateInputOptions, InputBlockType } from 'models'
|
||||||
import { typebotViewer } from 'utils/playwright/testHelpers'
|
import { typebotViewer } from 'utils/playwright/testHelpers'
|
||||||
import cuid from 'cuid'
|
import { createId } from '@paralleldrive/cuid2'
|
||||||
|
|
||||||
test.describe('Date input block', () => {
|
test.describe('Date input block', () => {
|
||||||
test('options should work', async ({ page }) => {
|
test('options should work', async ({ page }) => {
|
||||||
const typebotId = cuid()
|
const typebotId = createId()
|
||||||
await createTypebots([
|
await createTypebots([
|
||||||
{
|
{
|
||||||
id: typebotId,
|
id: typebotId,
|
||||||
|
|||||||
@@ -3,11 +3,11 @@ import { createTypebots } from 'utils/playwright/databaseActions'
|
|||||||
import { parseDefaultGroupWithBlock } from 'utils/playwright/databaseHelpers'
|
import { parseDefaultGroupWithBlock } from 'utils/playwright/databaseHelpers'
|
||||||
import { defaultEmailInputOptions, InputBlockType } from 'models'
|
import { defaultEmailInputOptions, InputBlockType } from 'models'
|
||||||
import { typebotViewer } from 'utils/playwright/testHelpers'
|
import { typebotViewer } from 'utils/playwright/testHelpers'
|
||||||
import cuid from 'cuid'
|
import { createId } from '@paralleldrive/cuid2'
|
||||||
|
|
||||||
test.describe('Email input block', () => {
|
test.describe('Email input block', () => {
|
||||||
test('options should work', async ({ page }) => {
|
test('options should work', async ({ page }) => {
|
||||||
const typebotId = cuid()
|
const typebotId = createId()
|
||||||
await createTypebots([
|
await createTypebots([
|
||||||
{
|
{
|
||||||
id: typebotId,
|
id: typebotId,
|
||||||
|
|||||||
@@ -3,14 +3,14 @@ import { createTypebots } from 'utils/playwright/databaseActions'
|
|||||||
import { parseDefaultGroupWithBlock } from 'utils/playwright/databaseHelpers'
|
import { parseDefaultGroupWithBlock } from 'utils/playwright/databaseHelpers'
|
||||||
import { defaultFileInputOptions, InputBlockType } from 'models'
|
import { defaultFileInputOptions, InputBlockType } from 'models'
|
||||||
import { typebotViewer } from 'utils/playwright/testHelpers'
|
import { typebotViewer } from 'utils/playwright/testHelpers'
|
||||||
import cuid from 'cuid'
|
import { createId } from '@paralleldrive/cuid2'
|
||||||
import { freeWorkspaceId } from 'utils/playwright/databaseSetup'
|
import { freeWorkspaceId } from 'utils/playwright/databaseSetup'
|
||||||
import { getTestAsset } from '@/test/utils/playwright'
|
import { getTestAsset } from '@/test/utils/playwright'
|
||||||
|
|
||||||
test.describe.configure({ mode: 'parallel' })
|
test.describe.configure({ mode: 'parallel' })
|
||||||
|
|
||||||
test('options should work', async ({ page }) => {
|
test('options should work', async ({ page }) => {
|
||||||
const typebotId = cuid()
|
const typebotId = createId()
|
||||||
await createTypebots([
|
await createTypebots([
|
||||||
{
|
{
|
||||||
id: typebotId,
|
id: typebotId,
|
||||||
@@ -59,7 +59,7 @@ test('options should work', async ({ page }) => {
|
|||||||
|
|
||||||
test.describe('Free workspace', () => {
|
test.describe('Free workspace', () => {
|
||||||
test("shouldn't be able to publish typebot", async ({ page }) => {
|
test("shouldn't be able to publish typebot", async ({ page }) => {
|
||||||
const typebotId = cuid()
|
const typebotId = createId()
|
||||||
await createTypebots([
|
await createTypebots([
|
||||||
{
|
{
|
||||||
id: typebotId,
|
id: typebotId,
|
||||||
|
|||||||
@@ -3,11 +3,11 @@ import { createTypebots } from 'utils/playwright/databaseActions'
|
|||||||
import { parseDefaultGroupWithBlock } from 'utils/playwright/databaseHelpers'
|
import { parseDefaultGroupWithBlock } from 'utils/playwright/databaseHelpers'
|
||||||
import { defaultNumberInputOptions, InputBlockType } from 'models'
|
import { defaultNumberInputOptions, InputBlockType } from 'models'
|
||||||
import { typebotViewer } from 'utils/playwright/testHelpers'
|
import { typebotViewer } from 'utils/playwright/testHelpers'
|
||||||
import cuid from 'cuid'
|
import { createId } from '@paralleldrive/cuid2'
|
||||||
|
|
||||||
test.describe('Number input block', () => {
|
test.describe('Number input block', () => {
|
||||||
test('options should work', async ({ page }) => {
|
test('options should work', async ({ page }) => {
|
||||||
const typebotId = cuid()
|
const typebotId = createId()
|
||||||
await createTypebots([
|
await createTypebots([
|
||||||
{
|
{
|
||||||
id: typebotId,
|
id: typebotId,
|
||||||
|
|||||||
@@ -2,13 +2,13 @@ import test, { expect } from '@playwright/test'
|
|||||||
import { createTypebots } from 'utils/playwright/databaseActions'
|
import { createTypebots } from 'utils/playwright/databaseActions'
|
||||||
import { parseDefaultGroupWithBlock } from 'utils/playwright/databaseHelpers'
|
import { parseDefaultGroupWithBlock } from 'utils/playwright/databaseHelpers'
|
||||||
import { defaultPaymentInputOptions, InputBlockType } from 'models'
|
import { defaultPaymentInputOptions, InputBlockType } from 'models'
|
||||||
import cuid from 'cuid'
|
import { createId } from '@paralleldrive/cuid2'
|
||||||
import { typebotViewer } from 'utils/playwright/testHelpers'
|
import { typebotViewer } from 'utils/playwright/testHelpers'
|
||||||
import { stripePaymentForm } from '@/test/utils/selectorUtils'
|
import { stripePaymentForm } from '@/test/utils/selectorUtils'
|
||||||
|
|
||||||
test.describe('Payment input block', () => {
|
test.describe('Payment input block', () => {
|
||||||
test('Can configure Stripe account', async ({ page }) => {
|
test('Can configure Stripe account', async ({ page }) => {
|
||||||
const typebotId = cuid()
|
const typebotId = createId()
|
||||||
await createTypebots([
|
await createTypebots([
|
||||||
{
|
{
|
||||||
id: typebotId,
|
id: typebotId,
|
||||||
|
|||||||
@@ -3,11 +3,11 @@ import { createTypebots } from 'utils/playwright/databaseActions'
|
|||||||
import { parseDefaultGroupWithBlock } from 'utils/playwright/databaseHelpers'
|
import { parseDefaultGroupWithBlock } from 'utils/playwright/databaseHelpers'
|
||||||
import { defaultPhoneInputOptions, InputBlockType } from 'models'
|
import { defaultPhoneInputOptions, InputBlockType } from 'models'
|
||||||
import { typebotViewer } from 'utils/playwright/testHelpers'
|
import { typebotViewer } from 'utils/playwright/testHelpers'
|
||||||
import cuid from 'cuid'
|
import { createId } from '@paralleldrive/cuid2'
|
||||||
|
|
||||||
test.describe('Phone input block', () => {
|
test.describe('Phone input block', () => {
|
||||||
test('options should work', async ({ page }) => {
|
test('options should work', async ({ page }) => {
|
||||||
const typebotId = cuid()
|
const typebotId = createId()
|
||||||
await createTypebots([
|
await createTypebots([
|
||||||
{
|
{
|
||||||
id: typebotId,
|
id: typebotId,
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ import { createTypebots } from 'utils/playwright/databaseActions'
|
|||||||
import { parseDefaultGroupWithBlock } from 'utils/playwright/databaseHelpers'
|
import { parseDefaultGroupWithBlock } from 'utils/playwright/databaseHelpers'
|
||||||
import { defaultRatingInputOptions, InputBlockType } from 'models'
|
import { defaultRatingInputOptions, InputBlockType } from 'models'
|
||||||
import { typebotViewer } from 'utils/playwright/testHelpers'
|
import { typebotViewer } from 'utils/playwright/testHelpers'
|
||||||
import cuid from 'cuid'
|
import { createId } from '@paralleldrive/cuid2'
|
||||||
|
|
||||||
const boxSvg = `<svg
|
const boxSvg = `<svg
|
||||||
xmlns="http://www.w3.org/2000/svg"
|
xmlns="http://www.w3.org/2000/svg"
|
||||||
@@ -19,7 +19,7 @@ const boxSvg = `<svg
|
|||||||
</svg>`
|
</svg>`
|
||||||
|
|
||||||
test('options should work', async ({ page }) => {
|
test('options should work', async ({ page }) => {
|
||||||
const typebotId = cuid()
|
const typebotId = createId()
|
||||||
await createTypebots([
|
await createTypebots([
|
||||||
{
|
{
|
||||||
id: typebotId,
|
id: typebotId,
|
||||||
|
|||||||
@@ -3,11 +3,11 @@ import { createTypebots } from 'utils/playwright/databaseActions'
|
|||||||
import { parseDefaultGroupWithBlock } from 'utils/playwright/databaseHelpers'
|
import { parseDefaultGroupWithBlock } from 'utils/playwright/databaseHelpers'
|
||||||
import { defaultTextInputOptions, InputBlockType } from 'models'
|
import { defaultTextInputOptions, InputBlockType } from 'models'
|
||||||
import { typebotViewer } from 'utils/playwright/testHelpers'
|
import { typebotViewer } from 'utils/playwright/testHelpers'
|
||||||
import cuid from 'cuid'
|
import { createId } from '@paralleldrive/cuid2'
|
||||||
|
|
||||||
test.describe.parallel('Text input block', () => {
|
test.describe.parallel('Text input block', () => {
|
||||||
test('options should work', async ({ page }) => {
|
test('options should work', async ({ page }) => {
|
||||||
const typebotId = cuid()
|
const typebotId = createId()
|
||||||
await createTypebots([
|
await createTypebots([
|
||||||
{
|
{
|
||||||
id: typebotId,
|
id: typebotId,
|
||||||
|
|||||||
@@ -3,11 +3,11 @@ import { createTypebots } from 'utils/playwright/databaseActions'
|
|||||||
import { parseDefaultGroupWithBlock } from 'utils/playwright/databaseHelpers'
|
import { parseDefaultGroupWithBlock } from 'utils/playwright/databaseHelpers'
|
||||||
import { defaultUrlInputOptions, InputBlockType } from 'models'
|
import { defaultUrlInputOptions, InputBlockType } from 'models'
|
||||||
import { typebotViewer } from 'utils/playwright/testHelpers'
|
import { typebotViewer } from 'utils/playwright/testHelpers'
|
||||||
import cuid from 'cuid'
|
import { createId } from '@paralleldrive/cuid2'
|
||||||
|
|
||||||
test.describe('Url input block', () => {
|
test.describe('Url input block', () => {
|
||||||
test('options should work', async ({ page }) => {
|
test('options should work', async ({ page }) => {
|
||||||
const typebotId = cuid()
|
const typebotId = createId()
|
||||||
await createTypebots([
|
await createTypebots([
|
||||||
{
|
{
|
||||||
id: typebotId,
|
id: typebotId,
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
import test, { expect } from '@playwright/test'
|
import test, { expect } from '@playwright/test'
|
||||||
import { createTypebots } from 'utils/playwright/databaseActions'
|
import { createTypebots } from 'utils/playwright/databaseActions'
|
||||||
import { parseDefaultGroupWithBlock } from 'utils/playwright/databaseHelpers'
|
import { parseDefaultGroupWithBlock } from 'utils/playwright/databaseHelpers'
|
||||||
import cuid from 'cuid'
|
import { createId } from '@paralleldrive/cuid2'
|
||||||
import { defaultChatwootOptions, IntegrationBlockType } from 'models'
|
import { defaultChatwootOptions, IntegrationBlockType } from 'models'
|
||||||
|
|
||||||
const typebotId = cuid()
|
const typebotId = createId()
|
||||||
|
|
||||||
const chatwootTestWebsiteToken = 'tueXiiqEmrWUCZ4NUyoR7nhE'
|
const chatwootTestWebsiteToken = 'tueXiiqEmrWUCZ4NUyoR7nhE'
|
||||||
|
|
||||||
|
|||||||
@@ -2,11 +2,11 @@ import test from '@playwright/test'
|
|||||||
import { createTypebots } from 'utils/playwright/databaseActions'
|
import { createTypebots } from 'utils/playwright/databaseActions'
|
||||||
import { parseDefaultGroupWithBlock } from 'utils/playwright/databaseHelpers'
|
import { parseDefaultGroupWithBlock } from 'utils/playwright/databaseHelpers'
|
||||||
import { defaultGoogleAnalyticsOptions, IntegrationBlockType } from 'models'
|
import { defaultGoogleAnalyticsOptions, IntegrationBlockType } from 'models'
|
||||||
import cuid from 'cuid'
|
import { createId } from '@paralleldrive/cuid2'
|
||||||
|
|
||||||
test.describe('Google Analytics block', () => {
|
test.describe('Google Analytics block', () => {
|
||||||
test('its configuration should work', async ({ page }) => {
|
test('its configuration should work', async ({ page }) => {
|
||||||
const typebotId = cuid()
|
const typebotId = createId()
|
||||||
await createTypebots([
|
await createTypebots([
|
||||||
{
|
{
|
||||||
id: typebotId,
|
id: typebotId,
|
||||||
|
|||||||
@@ -1,12 +1,12 @@
|
|||||||
import test, { expect, Page } from '@playwright/test'
|
import test, { expect, Page } from '@playwright/test'
|
||||||
import { importTypebotInDatabase } from 'utils/playwright/databaseActions'
|
import { importTypebotInDatabase } from 'utils/playwright/databaseActions'
|
||||||
import { typebotViewer } from 'utils/playwright/testHelpers'
|
import { typebotViewer } from 'utils/playwright/testHelpers'
|
||||||
import cuid from 'cuid'
|
import { createId } from '@paralleldrive/cuid2'
|
||||||
import { getTestAsset } from '@/test/utils/playwright'
|
import { getTestAsset } from '@/test/utils/playwright'
|
||||||
|
|
||||||
test.describe.parallel('Google sheets integration', () => {
|
test.describe.parallel('Google sheets integration', () => {
|
||||||
test('Insert row should work', async ({ page }) => {
|
test('Insert row should work', async ({ page }) => {
|
||||||
const typebotId = cuid()
|
const typebotId = createId()
|
||||||
await importTypebotInDatabase(
|
await importTypebotInDatabase(
|
||||||
getTestAsset('typebots/integrations/googleSheets.json'),
|
getTestAsset('typebots/integrations/googleSheets.json'),
|
||||||
{
|
{
|
||||||
@@ -55,7 +55,7 @@ test.describe.parallel('Google sheets integration', () => {
|
|||||||
})
|
})
|
||||||
|
|
||||||
test('Update row should work', async ({ page }) => {
|
test('Update row should work', async ({ page }) => {
|
||||||
const typebotId = cuid()
|
const typebotId = createId()
|
||||||
await importTypebotInDatabase(
|
await importTypebotInDatabase(
|
||||||
getTestAsset('typebots/integrations/googleSheets.json'),
|
getTestAsset('typebots/integrations/googleSheets.json'),
|
||||||
{
|
{
|
||||||
@@ -104,7 +104,7 @@ test.describe.parallel('Google sheets integration', () => {
|
|||||||
})
|
})
|
||||||
|
|
||||||
test('Get row should work', async ({ page }) => {
|
test('Get row should work', async ({ page }) => {
|
||||||
const typebotId = cuid()
|
const typebotId = createId()
|
||||||
await importTypebotInDatabase(
|
await importTypebotInDatabase(
|
||||||
getTestAsset('typebots/integrations/googleSheetsGet.json'),
|
getTestAsset('typebots/integrations/googleSheetsGet.json'),
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
import test, { expect } from '@playwright/test'
|
import test, { expect } from '@playwright/test'
|
||||||
import { importTypebotInDatabase } from 'utils/playwright/databaseActions'
|
import { importTypebotInDatabase } from 'utils/playwright/databaseActions'
|
||||||
import { typebotViewer } from 'utils/playwright/testHelpers'
|
import { typebotViewer } from 'utils/playwright/testHelpers'
|
||||||
import cuid from 'cuid'
|
import { createId } from '@paralleldrive/cuid2'
|
||||||
import { getTestAsset } from '@/test/utils/playwright'
|
import { getTestAsset } from '@/test/utils/playwright'
|
||||||
|
|
||||||
const typebotId = cuid()
|
const typebotId = createId()
|
||||||
|
|
||||||
test.describe('Send email block', () => {
|
test.describe('Send email block', () => {
|
||||||
test('its configuration should work', async ({ page }) => {
|
test('its configuration should work', async ({ page }) => {
|
||||||
|
|||||||
@@ -4,13 +4,13 @@ import {
|
|||||||
importTypebotInDatabase,
|
importTypebotInDatabase,
|
||||||
} from 'utils/playwright/databaseActions'
|
} from 'utils/playwright/databaseActions'
|
||||||
import { HttpMethod } from 'models'
|
import { HttpMethod } from 'models'
|
||||||
import cuid from 'cuid'
|
import { createId } from '@paralleldrive/cuid2'
|
||||||
import { getTestAsset } from '@/test/utils/playwright'
|
import { getTestAsset } from '@/test/utils/playwright'
|
||||||
import { apiToken } from 'utils/playwright/databaseSetup'
|
import { apiToken } from 'utils/playwright/databaseSetup'
|
||||||
|
|
||||||
test.describe('Builder', () => {
|
test.describe('Builder', () => {
|
||||||
test('easy configuration should work', async ({ page }) => {
|
test('easy configuration should work', async ({ page }) => {
|
||||||
const typebotId = cuid()
|
const typebotId = createId()
|
||||||
await importTypebotInDatabase(
|
await importTypebotInDatabase(
|
||||||
getTestAsset('typebots/integrations/easyConfigWebhook.json'),
|
getTestAsset('typebots/integrations/easyConfigWebhook.json'),
|
||||||
{
|
{
|
||||||
@@ -31,7 +31,7 @@ test.describe('Builder', () => {
|
|||||||
})
|
})
|
||||||
|
|
||||||
test('its configuration should work', async ({ page }) => {
|
test('its configuration should work', async ({ page }) => {
|
||||||
const typebotId = cuid()
|
const typebotId = createId()
|
||||||
await importTypebotInDatabase(
|
await importTypebotInDatabase(
|
||||||
getTestAsset('typebots/integrations/webhook.json'),
|
getTestAsset('typebots/integrations/webhook.json'),
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ import { byId, isNotDefined } from 'utils'
|
|||||||
import { PlusIcon } from '@/components/icons'
|
import { PlusIcon } from '@/components/icons'
|
||||||
import { ConditionItemForm } from './ConditionItemForm'
|
import { ConditionItemForm } from './ConditionItemForm'
|
||||||
import { useGraph } from '@/features/graph'
|
import { useGraph } from '@/features/graph'
|
||||||
import cuid from 'cuid'
|
import { createId } from '@paralleldrive/cuid2'
|
||||||
|
|
||||||
type Props = {
|
type Props = {
|
||||||
item: ConditionItem
|
item: ConditionItem
|
||||||
@@ -55,7 +55,7 @@ export const ConditionItemNode = ({ item, isMouseOver, indices }: Props) => {
|
|||||||
const handlePlusClick = (event: React.MouseEvent) => {
|
const handlePlusClick = (event: React.MouseEvent) => {
|
||||||
event.stopPropagation()
|
event.stopPropagation()
|
||||||
const itemIndex = indices.itemIndex + 1
|
const itemIndex = indices.itemIndex + 1
|
||||||
const newItemId = cuid()
|
const newItemId = createId()
|
||||||
createItem(
|
createItem(
|
||||||
{
|
{
|
||||||
blockId: item.blockId,
|
blockId: item.blockId,
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
import test, { expect } from '@playwright/test'
|
import test, { expect } from '@playwright/test'
|
||||||
import { typebotViewer } from 'utils/playwright/testHelpers'
|
import { typebotViewer } from 'utils/playwright/testHelpers'
|
||||||
import { importTypebotInDatabase } from 'utils/playwright/databaseActions'
|
import { importTypebotInDatabase } from 'utils/playwright/databaseActions'
|
||||||
import cuid from 'cuid'
|
import { createId } from '@paralleldrive/cuid2'
|
||||||
import { getTestAsset } from '@/test/utils/playwright'
|
import { getTestAsset } from '@/test/utils/playwright'
|
||||||
|
|
||||||
const typebotId = cuid()
|
const typebotId = createId()
|
||||||
|
|
||||||
test.describe('Condition block', () => {
|
test.describe('Condition block', () => {
|
||||||
test('its configuration should work', async ({ page }) => {
|
test('its configuration should work', async ({ page }) => {
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
import test, { expect } from '@playwright/test'
|
import test, { expect } from '@playwright/test'
|
||||||
import { typebotViewer } from 'utils/playwright/testHelpers'
|
import { typebotViewer } from 'utils/playwright/testHelpers'
|
||||||
import { importTypebotInDatabase } from 'utils/playwright/databaseActions'
|
import { importTypebotInDatabase } from 'utils/playwright/databaseActions'
|
||||||
import cuid from 'cuid'
|
import { createId } from '@paralleldrive/cuid2'
|
||||||
import { getTestAsset } from '@/test/utils/playwright'
|
import { getTestAsset } from '@/test/utils/playwright'
|
||||||
|
|
||||||
const typebotId = cuid()
|
const typebotId = createId()
|
||||||
|
|
||||||
test.describe('Redirect block', () => {
|
test.describe('Redirect block', () => {
|
||||||
test('its configuration should work', async ({ page, context }) => {
|
test('its configuration should work', async ({ page, context }) => {
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
import test, { expect } from '@playwright/test'
|
import test, { expect } from '@playwright/test'
|
||||||
import { typebotViewer } from 'utils/playwright/testHelpers'
|
import { typebotViewer } from 'utils/playwright/testHelpers'
|
||||||
import { importTypebotInDatabase } from 'utils/playwright/databaseActions'
|
import { importTypebotInDatabase } from 'utils/playwright/databaseActions'
|
||||||
import cuid from 'cuid'
|
import { createId } from '@paralleldrive/cuid2'
|
||||||
import { getTestAsset } from '@/test/utils/playwright'
|
import { getTestAsset } from '@/test/utils/playwright'
|
||||||
|
|
||||||
const typebotId = cuid()
|
const typebotId = createId()
|
||||||
|
|
||||||
test.describe('Script block', () => {
|
test.describe('Script block', () => {
|
||||||
test('script should trigger', async ({ page }) => {
|
test('script should trigger', async ({ page }) => {
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
import test, { expect } from '@playwright/test'
|
import test, { expect } from '@playwright/test'
|
||||||
import { typebotViewer } from 'utils/playwright/testHelpers'
|
import { typebotViewer } from 'utils/playwright/testHelpers'
|
||||||
import { importTypebotInDatabase } from 'utils/playwright/databaseActions'
|
import { importTypebotInDatabase } from 'utils/playwright/databaseActions'
|
||||||
import cuid from 'cuid'
|
import { createId } from '@paralleldrive/cuid2'
|
||||||
import { getTestAsset } from '@/test/utils/playwright'
|
import { getTestAsset } from '@/test/utils/playwright'
|
||||||
|
|
||||||
const typebotId = cuid()
|
const typebotId = createId()
|
||||||
|
|
||||||
test.describe('Set variable block', () => {
|
test.describe('Set variable block', () => {
|
||||||
test('its configuration should work', async ({ page }) => {
|
test('its configuration should work', async ({ page }) => {
|
||||||
|
|||||||
@@ -1,12 +1,12 @@
|
|||||||
import test, { expect } from '@playwright/test'
|
import test, { expect } from '@playwright/test'
|
||||||
import { typebotViewer } from 'utils/playwright/testHelpers'
|
import { typebotViewer } from 'utils/playwright/testHelpers'
|
||||||
import { importTypebotInDatabase } from 'utils/playwright/databaseActions'
|
import { importTypebotInDatabase } from 'utils/playwright/databaseActions'
|
||||||
import cuid from 'cuid'
|
import { createId } from '@paralleldrive/cuid2'
|
||||||
import { getTestAsset } from '@/test/utils/playwright'
|
import { getTestAsset } from '@/test/utils/playwright'
|
||||||
|
|
||||||
test('should be configurable', async ({ page }) => {
|
test('should be configurable', async ({ page }) => {
|
||||||
const typebotId = cuid()
|
const typebotId = createId()
|
||||||
const linkedTypebotId = cuid()
|
const linkedTypebotId = createId()
|
||||||
await importTypebotInDatabase(
|
await importTypebotInDatabase(
|
||||||
getTestAsset('typebots/logic/linkTypebots/1.json'),
|
getTestAsset('typebots/logic/linkTypebots/1.json'),
|
||||||
{ id: typebotId, name: 'My link typebot 1' }
|
{ id: typebotId, name: 'My link typebot 1' }
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
import test, { expect } from '@playwright/test'
|
import test, { expect } from '@playwright/test'
|
||||||
import { typebotViewer } from 'utils/playwright/testHelpers'
|
import { typebotViewer } from 'utils/playwright/testHelpers'
|
||||||
import { importTypebotInDatabase } from 'utils/playwright/databaseActions'
|
import { importTypebotInDatabase } from 'utils/playwright/databaseActions'
|
||||||
import cuid from 'cuid'
|
import { createId } from '@paralleldrive/cuid2'
|
||||||
import { getTestAsset } from '@/test/utils/playwright'
|
import { getTestAsset } from '@/test/utils/playwright'
|
||||||
|
|
||||||
const typebotId = cuid()
|
const typebotId = createId()
|
||||||
|
|
||||||
test.describe('Wait block', () => {
|
test.describe('Wait block', () => {
|
||||||
test('wait should trigger', async ({ page }) => {
|
test('wait should trigger', async ({ page }) => {
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import test, { expect } from '@playwright/test'
|
import test, { expect } from '@playwright/test'
|
||||||
import cuid from 'cuid'
|
import { createId } from '@paralleldrive/cuid2'
|
||||||
import { CollaborationType, Plan, WorkspaceRole } from 'db'
|
import { CollaborationType, Plan, WorkspaceRole } from 'db'
|
||||||
import prisma from '@/lib/prisma'
|
import prisma from '@/lib/prisma'
|
||||||
import { InputBlockType, defaultTextInputOptions } from 'models'
|
import { InputBlockType, defaultTextInputOptions } from 'models'
|
||||||
@@ -13,8 +13,8 @@ import { createFolder } from '@/test/utils/databaseActions'
|
|||||||
|
|
||||||
test.describe('Typebot owner', () => {
|
test.describe('Typebot owner', () => {
|
||||||
test('Can invite collaborators', async ({ page }) => {
|
test('Can invite collaborators', async ({ page }) => {
|
||||||
const typebotId = cuid()
|
const typebotId = createId()
|
||||||
const guestWorkspaceId = cuid()
|
const guestWorkspaceId = createId()
|
||||||
await prisma.workspace.create({
|
await prisma.workspace.create({
|
||||||
data: {
|
data: {
|
||||||
id: guestWorkspaceId,
|
id: guestWorkspaceId,
|
||||||
@@ -66,8 +66,8 @@ test.describe('Typebot owner', () => {
|
|||||||
|
|
||||||
test.describe('Guest with read access', () => {
|
test.describe('Guest with read access', () => {
|
||||||
test('should have shared typebots displayed', async ({ page }) => {
|
test('should have shared typebots displayed', async ({ page }) => {
|
||||||
const typebotId = cuid()
|
const typebotId = createId()
|
||||||
const guestWorkspaceId = cuid()
|
const guestWorkspaceId = createId()
|
||||||
await prisma.workspace.create({
|
await prisma.workspace.create({
|
||||||
data: {
|
data: {
|
||||||
id: guestWorkspaceId,
|
id: guestWorkspaceId,
|
||||||
@@ -124,8 +124,8 @@ test.describe('Guest with read access', () => {
|
|||||||
|
|
||||||
test.describe('Guest with write access', () => {
|
test.describe('Guest with write access', () => {
|
||||||
test('should have shared typebots displayed', async ({ page }) => {
|
test('should have shared typebots displayed', async ({ page }) => {
|
||||||
const typebotId = cuid()
|
const typebotId = createId()
|
||||||
const guestWorkspaceId = cuid()
|
const guestWorkspaceId = createId()
|
||||||
await prisma.workspace.create({
|
await prisma.workspace.create({
|
||||||
data: {
|
data: {
|
||||||
id: guestWorkspaceId,
|
id: guestWorkspaceId,
|
||||||
|
|||||||
@@ -1,12 +1,12 @@
|
|||||||
import test, { expect } from '@playwright/test'
|
import test, { expect } from '@playwright/test'
|
||||||
import { InputBlockType, defaultTextInputOptions } from 'models'
|
import { InputBlockType, defaultTextInputOptions } from 'models'
|
||||||
import cuid from 'cuid'
|
import { createId } from '@paralleldrive/cuid2'
|
||||||
import { createTypebots } from 'utils/playwright/databaseActions'
|
import { createTypebots } from 'utils/playwright/databaseActions'
|
||||||
import { parseDefaultGroupWithBlock } from 'utils/playwright/databaseHelpers'
|
import { parseDefaultGroupWithBlock } from 'utils/playwright/databaseHelpers'
|
||||||
import { starterWorkspaceId } from 'utils/playwright/databaseSetup'
|
import { starterWorkspaceId } from 'utils/playwright/databaseSetup'
|
||||||
|
|
||||||
test('should be able to connect custom domain', async ({ page }) => {
|
test('should be able to connect custom domain', async ({ page }) => {
|
||||||
const typebotId = cuid()
|
const typebotId = createId()
|
||||||
await createTypebots([
|
await createTypebots([
|
||||||
{
|
{
|
||||||
id: typebotId,
|
id: typebotId,
|
||||||
@@ -43,7 +43,7 @@ test('should be able to connect custom domain', async ({ page }) => {
|
|||||||
|
|
||||||
test.describe('Starter workspace', () => {
|
test.describe('Starter workspace', () => {
|
||||||
test("Add my domain shouldn't be available", async ({ page }) => {
|
test("Add my domain shouldn't be available", async ({ page }) => {
|
||||||
const typebotId = cuid()
|
const typebotId = createId()
|
||||||
await createTypebots([
|
await createTypebots([
|
||||||
{
|
{
|
||||||
id: typebotId,
|
id: typebotId,
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import cuid from 'cuid'
|
import { createId } from '@paralleldrive/cuid2'
|
||||||
import {
|
import {
|
||||||
defaultSettings,
|
defaultSettings,
|
||||||
defaultTheme,
|
defaultTheme,
|
||||||
@@ -33,8 +33,8 @@ export const parseNewTypebot = ({
|
|||||||
ownerAvatarUrl?: string
|
ownerAvatarUrl?: string
|
||||||
isBrandingEnabled?: boolean
|
isBrandingEnabled?: boolean
|
||||||
}): NewTypebotProps => {
|
}): NewTypebotProps => {
|
||||||
const startGroupId = cuid()
|
const startGroupId = createId()
|
||||||
const startBlockId = cuid()
|
const startBlockId = createId()
|
||||||
const startBlock: StartBlock = {
|
const startBlock: StartBlock = {
|
||||||
groupId: startGroupId,
|
groupId: startGroupId,
|
||||||
id: startBlockId,
|
id: startBlockId,
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import { createFolders } from '@/test/utils/databaseActions'
|
import { createFolders } from '@/test/utils/databaseActions'
|
||||||
import { deleteButtonInConfirmDialog } from '@/test/utils/selectorUtils'
|
import { deleteButtonInConfirmDialog } from '@/test/utils/selectorUtils'
|
||||||
import test, { expect } from '@playwright/test'
|
import test, { expect } from '@playwright/test'
|
||||||
import cuid from 'cuid'
|
import { createId } from '@paralleldrive/cuid2'
|
||||||
import { createTypebots } from 'utils/playwright/databaseActions'
|
import { createTypebots } from 'utils/playwright/databaseActions'
|
||||||
|
|
||||||
test('folders navigation should work', async ({ page }) => {
|
test('folders navigation should work', async ({ page }) => {
|
||||||
@@ -47,7 +47,7 @@ test('folders and typebots should be deletable', async ({ page }) => {
|
|||||||
})
|
})
|
||||||
|
|
||||||
test('folders and typebots should be movable', async ({ page }) => {
|
test('folders and typebots should be movable', async ({ page }) => {
|
||||||
const droppableFolderId = cuid()
|
const droppableFolderId = createId()
|
||||||
await createFolders([{ id: droppableFolderId, name: 'Droppable folder' }])
|
await createFolders([{ id: droppableFolderId, name: 'Droppable folder' }])
|
||||||
await createTypebots([{ name: 'Draggable typebot' }])
|
await createTypebots([{ name: 'Draggable typebot' }])
|
||||||
await page.goto('/typebots')
|
await page.goto('/typebots')
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { duplicateWebhookQueries } from '@/features/blocks/integrations/webhook'
|
import { duplicateWebhookQueries } from '@/features/blocks/integrations/webhook'
|
||||||
import cuid from 'cuid'
|
import { createId } from '@paralleldrive/cuid2'
|
||||||
import { Plan, Prisma } from 'db'
|
import { Plan, Prisma } from 'db'
|
||||||
import {
|
import {
|
||||||
ChoiceInputBlock,
|
ChoiceInputBlock,
|
||||||
@@ -50,7 +50,7 @@ const duplicateTypebot = (
|
|||||||
.filter(isWebhookBlock)
|
.filter(isWebhookBlock)
|
||||||
.map((s) => ({ id: s.webhookId }))
|
.map((s) => ({ id: s.webhookId }))
|
||||||
)
|
)
|
||||||
const id = cuid()
|
const id = createId()
|
||||||
return {
|
return {
|
||||||
typebot: {
|
typebot: {
|
||||||
...typebot,
|
...typebot,
|
||||||
@@ -131,6 +131,6 @@ const duplicateTypebot = (
|
|||||||
|
|
||||||
const generateOldNewIdsMapping = (itemWithId: { id: string }[]) => {
|
const generateOldNewIdsMapping = (itemWithId: { id: string }[]) => {
|
||||||
const idsMapping: Map<string, string> = new Map()
|
const idsMapping: Map<string, string> = new Map()
|
||||||
itemWithId.forEach((item) => idsMapping.set(item.id, cuid()))
|
itemWithId.forEach((item) => idsMapping.set(item.id, createId()))
|
||||||
return idsMapping
|
return idsMapping
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import test, { expect } from '@playwright/test'
|
import test, { expect } from '@playwright/test'
|
||||||
import { defaultTextInputOptions, InputBlockType } from 'models'
|
import { defaultTextInputOptions, InputBlockType } from 'models'
|
||||||
import cuid from 'cuid'
|
import { createId } from '@paralleldrive/cuid2'
|
||||||
import {
|
import {
|
||||||
createTypebots,
|
createTypebots,
|
||||||
importTypebotInDatabase,
|
importTypebotInDatabase,
|
||||||
@@ -17,7 +17,7 @@ import { getTestAsset } from '@/test/utils/playwright'
|
|||||||
test.describe.configure({ mode: 'parallel' })
|
test.describe.configure({ mode: 'parallel' })
|
||||||
|
|
||||||
test('Edges connection should work', async ({ page }) => {
|
test('Edges connection should work', async ({ page }) => {
|
||||||
const typebotId = cuid()
|
const typebotId = createId()
|
||||||
await createTypebots([
|
await createTypebots([
|
||||||
{
|
{
|
||||||
id: typebotId,
|
id: typebotId,
|
||||||
@@ -68,7 +68,7 @@ test('Edges connection should work', async ({ page }) => {
|
|||||||
expect(total).toBe(1)
|
expect(total).toBe(1)
|
||||||
})
|
})
|
||||||
test('Drag and drop blocks and items should work', async ({ page }) => {
|
test('Drag and drop blocks and items should work', async ({ page }) => {
|
||||||
const typebotId = cuid()
|
const typebotId = createId()
|
||||||
await importTypebotInDatabase(
|
await importTypebotInDatabase(
|
||||||
getTestAsset('typebots/editor/buttonsDnd.json'),
|
getTestAsset('typebots/editor/buttonsDnd.json'),
|
||||||
{
|
{
|
||||||
@@ -120,7 +120,7 @@ test('Drag and drop blocks and items should work', async ({ page }) => {
|
|||||||
)
|
)
|
||||||
})
|
})
|
||||||
test('Undo / Redo and Zoom buttons should work', async ({ page }) => {
|
test('Undo / Redo and Zoom buttons should work', async ({ page }) => {
|
||||||
const typebotId = cuid()
|
const typebotId = createId()
|
||||||
await createTypebots([
|
await createTypebots([
|
||||||
{
|
{
|
||||||
id: typebotId,
|
id: typebotId,
|
||||||
@@ -162,7 +162,7 @@ test('Undo / Redo and Zoom buttons should work', async ({ page }) => {
|
|||||||
})
|
})
|
||||||
|
|
||||||
test('Rename and icon change should work', async ({ page }) => {
|
test('Rename and icon change should work', async ({ page }) => {
|
||||||
const typebotId = cuid()
|
const typebotId = createId()
|
||||||
await createTypebots([
|
await createTypebots([
|
||||||
{
|
{
|
||||||
id: typebotId,
|
id: typebotId,
|
||||||
@@ -189,7 +189,7 @@ test('Rename and icon change should work', async ({ page }) => {
|
|||||||
})
|
})
|
||||||
|
|
||||||
test('Preview from group should work', async ({ page }) => {
|
test('Preview from group should work', async ({ page }) => {
|
||||||
const typebotId = cuid()
|
const typebotId = createId()
|
||||||
await importTypebotInDatabase(
|
await importTypebotInDatabase(
|
||||||
getTestAsset('typebots/editor/previewFromGroup.json'),
|
getTestAsset('typebots/editor/previewFromGroup.json'),
|
||||||
{
|
{
|
||||||
@@ -214,7 +214,7 @@ test('Preview from group should work', async ({ page }) => {
|
|||||||
})
|
})
|
||||||
|
|
||||||
test('Published typebot menu should work', async ({ page }) => {
|
test('Published typebot menu should work', async ({ page }) => {
|
||||||
const typebotId = cuid()
|
const typebotId = createId()
|
||||||
await createTypebots([
|
await createTypebots([
|
||||||
{
|
{
|
||||||
id: typebotId,
|
id: typebotId,
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ import { WritableDraft } from 'immer/dist/types/types-external'
|
|||||||
import { SetTypebot } from '../TypebotProvider'
|
import { SetTypebot } from '../TypebotProvider'
|
||||||
import produce from 'immer'
|
import produce from 'immer'
|
||||||
import { cleanUpEdgeDraft, deleteEdgeDraft } from './edges'
|
import { cleanUpEdgeDraft, deleteEdgeDraft } from './edges'
|
||||||
import cuid from 'cuid'
|
import { createId } from '@paralleldrive/cuid2'
|
||||||
import { byId, isWebhookBlock, blockHasItems } from 'utils'
|
import { byId, isWebhookBlock, blockHasItems } from 'utils'
|
||||||
import { duplicateItemDraft } from './items'
|
import { duplicateItemDraft } from './items'
|
||||||
import { parseNewBlock } from '@/features/graph/utils'
|
import { parseNewBlock } from '@/features/graph/utils'
|
||||||
@@ -141,7 +141,7 @@ const moveBlockToGroup = (
|
|||||||
export const duplicateBlockDraft =
|
export const duplicateBlockDraft =
|
||||||
(groupId: string) =>
|
(groupId: string) =>
|
||||||
(block: Block): Block => {
|
(block: Block): Block => {
|
||||||
const blockId = cuid()
|
const blockId = createId()
|
||||||
if (blockHasItems(block))
|
if (blockHasItems(block))
|
||||||
return {
|
return {
|
||||||
...block,
|
...block,
|
||||||
@@ -155,7 +155,7 @@ export const duplicateBlockDraft =
|
|||||||
...block,
|
...block,
|
||||||
groupId,
|
groupId,
|
||||||
id: blockId,
|
id: blockId,
|
||||||
webhookId: cuid(),
|
webhookId: createId(),
|
||||||
outgoingEdgeId: undefined,
|
outgoingEdgeId: undefined,
|
||||||
}
|
}
|
||||||
return {
|
return {
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ import { WritableDraft } from 'immer/dist/types/types-external'
|
|||||||
import { SetTypebot } from '../TypebotProvider'
|
import { SetTypebot } from '../TypebotProvider'
|
||||||
import { produce } from 'immer'
|
import { produce } from 'immer'
|
||||||
import { byId, isDefined, blockHasItems } from 'utils'
|
import { byId, isDefined, blockHasItems } from 'utils'
|
||||||
import cuid from 'cuid'
|
import { createId } from '@paralleldrive/cuid2'
|
||||||
|
|
||||||
export type EdgesActions = {
|
export type EdgesActions = {
|
||||||
createEdge: (edge: Omit<Edge, 'id'>) => void
|
createEdge: (edge: Omit<Edge, 'id'>) => void
|
||||||
@@ -24,7 +24,7 @@ export const edgesAction = (setTypebot: SetTypebot): EdgesActions => ({
|
|||||||
produce(typebot, (typebot) => {
|
produce(typebot, (typebot) => {
|
||||||
const newEdge = {
|
const newEdge = {
|
||||||
...edge,
|
...edge,
|
||||||
id: cuid(),
|
id: createId(),
|
||||||
}
|
}
|
||||||
removeExistingEdge(typebot, edge)
|
removeExistingEdge(typebot, edge)
|
||||||
typebot.edges.push(newEdge)
|
typebot.edges.push(newEdge)
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import cuid from 'cuid'
|
import { createId } from '@paralleldrive/cuid2'
|
||||||
import { produce } from 'immer'
|
import { produce } from 'immer'
|
||||||
import { Group, DraggableBlock, DraggableBlockType, BlockIndices } from 'models'
|
import { Group, DraggableBlock, DraggableBlockType, BlockIndices } from 'models'
|
||||||
import { SetTypebot } from '../TypebotProvider'
|
import { SetTypebot } from '../TypebotProvider'
|
||||||
@@ -56,7 +56,7 @@ const groupsActions = (setTypebot: SetTypebot): GroupsActions => ({
|
|||||||
setTypebot((typebot) =>
|
setTypebot((typebot) =>
|
||||||
produce(typebot, (typebot) => {
|
produce(typebot, (typebot) => {
|
||||||
const group = typebot.groups[groupIndex]
|
const group = typebot.groups[groupIndex]
|
||||||
const id = cuid()
|
const id = createId()
|
||||||
const newGroup: Group = {
|
const newGroup: Group = {
|
||||||
...group,
|
...group,
|
||||||
title: `${group.title} copy`,
|
title: `${group.title} copy`,
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ import { SetTypebot } from '../TypebotProvider'
|
|||||||
import produce from 'immer'
|
import produce from 'immer'
|
||||||
import { cleanUpEdgeDraft } from './edges'
|
import { cleanUpEdgeDraft } from './edges'
|
||||||
import { byId, blockHasItems } from 'utils'
|
import { byId, blockHasItems } from 'utils'
|
||||||
import cuid from 'cuid'
|
import { createId } from '@paralleldrive/cuid2'
|
||||||
import { WritableDraft } from 'immer/dist/types/types-external'
|
import { WritableDraft } from 'immer/dist/types/types-external'
|
||||||
|
|
||||||
type NewItem = Pick<Item, 'blockId' | 'outgoingEdgeId' | 'type'> & Partial<Item>
|
type NewItem = Pick<Item, 'blockId' | 'outgoingEdgeId' | 'type'> & Partial<Item>
|
||||||
@@ -34,7 +34,7 @@ const createItem = (
|
|||||||
if (item.type === ItemType.CONDITION) {
|
if (item.type === ItemType.CONDITION) {
|
||||||
const newItem = {
|
const newItem = {
|
||||||
...item,
|
...item,
|
||||||
id: 'id' in item && item.id ? item.id : cuid(),
|
id: 'id' in item && item.id ? item.id : createId(),
|
||||||
content: item.content ?? defaultConditionContent,
|
content: item.content ?? defaultConditionContent,
|
||||||
}
|
}
|
||||||
block.items.splice(itemIndex, 0, newItem)
|
block.items.splice(itemIndex, 0, newItem)
|
||||||
@@ -46,7 +46,7 @@ const createItem = (
|
|||||||
if (item.type === ItemType.BUTTON) {
|
if (item.type === ItemType.BUTTON) {
|
||||||
const newItem = {
|
const newItem = {
|
||||||
...item,
|
...item,
|
||||||
id: 'id' in item && item.id ? item.id : cuid(),
|
id: 'id' in item && item.id ? item.id : createId(),
|
||||||
content: item.content,
|
content: item.content,
|
||||||
}
|
}
|
||||||
block.items.splice(itemIndex, 0, newItem)
|
block.items.splice(itemIndex, 0, newItem)
|
||||||
@@ -122,7 +122,7 @@ const itemsAction = (setTypebot: SetTypebot): ItemsActions => ({
|
|||||||
|
|
||||||
const duplicateItemDraft = (blockId: string) => (item: Item) => ({
|
const duplicateItemDraft = (blockId: string) => (item: Item) => ({
|
||||||
...item,
|
...item,
|
||||||
id: cuid(),
|
id: createId(),
|
||||||
blockId,
|
blockId,
|
||||||
outgoingEdgeId: undefined,
|
outgoingEdgeId: undefined,
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ import { useTypebot } from '@/features/editor'
|
|||||||
import { DraggableBlockType, PublicTypebot, Typebot } from 'models'
|
import { DraggableBlockType, PublicTypebot, Typebot } from 'models'
|
||||||
import { useDebounce } from 'use-debounce'
|
import { useDebounce } from 'use-debounce'
|
||||||
import GraphElements from './GraphElements'
|
import GraphElements from './GraphElements'
|
||||||
import cuid from 'cuid'
|
import { createId } from '@paralleldrive/cuid2'
|
||||||
import { useUser } from '@/features/account'
|
import { useUser } from '@/features/account'
|
||||||
import { ZoomButtons } from './ZoomButtons'
|
import { ZoomButtons } from './ZoomButtons'
|
||||||
import { AnswersCount } from '@/features/analytics'
|
import { AnswersCount } from '@/features/analytics'
|
||||||
@@ -96,7 +96,7 @@ export const Graph = ({
|
|||||||
{ x: e.clientX, y: e.clientY },
|
{ x: e.clientX, y: e.clientY },
|
||||||
graphPosition
|
graphPosition
|
||||||
)
|
)
|
||||||
const id = cuid()
|
const id = createId()
|
||||||
updateGroupCoordinates(id, coordinates)
|
updateGroupCoordinates(id, coordinates)
|
||||||
createGroup({
|
createGroup({
|
||||||
id,
|
id,
|
||||||
|
|||||||
@@ -48,7 +48,7 @@ import {
|
|||||||
} from './providers'
|
} from './providers'
|
||||||
import { roundCorners } from 'svg-round-corners'
|
import { roundCorners } from 'svg-round-corners'
|
||||||
import { AnchorsPositionProps } from './components/Edges/Edge'
|
import { AnchorsPositionProps } from './components/Edges/Edge'
|
||||||
import cuid from 'cuid'
|
import { createId } from '@paralleldrive/cuid2'
|
||||||
import {
|
import {
|
||||||
isBubbleBlockType,
|
isBubbleBlockType,
|
||||||
blockTypeHasOption,
|
blockTypeHasOption,
|
||||||
@@ -359,7 +359,7 @@ export const parseNewBlock = (
|
|||||||
type: DraggableBlockType,
|
type: DraggableBlockType,
|
||||||
groupId: string
|
groupId: string
|
||||||
): DraggableBlock => {
|
): DraggableBlock => {
|
||||||
const id = cuid()
|
const id = createId()
|
||||||
return {
|
return {
|
||||||
id,
|
id,
|
||||||
groupId,
|
groupId,
|
||||||
@@ -368,7 +368,7 @@ export const parseNewBlock = (
|
|||||||
options: blockTypeHasOption(type)
|
options: blockTypeHasOption(type)
|
||||||
? parseDefaultBlockOptions(type)
|
? parseDefaultBlockOptions(type)
|
||||||
: undefined,
|
: undefined,
|
||||||
webhookId: blockTypeHasWebhook(type) ? cuid() : undefined,
|
webhookId: blockTypeHasWebhook(type) ? createId() : undefined,
|
||||||
items: blockTypeHasItems(type) ? parseDefaultItems(type, id) : undefined,
|
items: blockTypeHasItems(type) ? parseDefaultItems(type, id) : undefined,
|
||||||
} as DraggableBlock
|
} as DraggableBlock
|
||||||
}
|
}
|
||||||
@@ -379,11 +379,11 @@ const parseDefaultItems = (
|
|||||||
): Item[] => {
|
): Item[] => {
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case InputBlockType.CHOICE:
|
case InputBlockType.CHOICE:
|
||||||
return [{ id: cuid(), blockId, type: ItemType.BUTTON }]
|
return [{ id: createId(), blockId, type: ItemType.BUTTON }]
|
||||||
case LogicBlockType.CONDITION:
|
case LogicBlockType.CONDITION:
|
||||||
return [
|
return [
|
||||||
{
|
{
|
||||||
id: cuid(),
|
id: createId(),
|
||||||
blockId,
|
blockId,
|
||||||
type: ItemType.CONDITION,
|
type: ItemType.CONDITION,
|
||||||
content: defaultConditionContent,
|
content: defaultConditionContent,
|
||||||
|
|||||||
@@ -1,12 +1,12 @@
|
|||||||
import test, { expect } from '@playwright/test'
|
import test, { expect } from '@playwright/test'
|
||||||
import cuid from 'cuid'
|
import { createId } from '@paralleldrive/cuid2'
|
||||||
import { defaultTextInputOptions, InputBlockType } from 'models'
|
import { defaultTextInputOptions, InputBlockType } from 'models'
|
||||||
import { createTypebots } from 'utils/playwright/databaseActions'
|
import { createTypebots } from 'utils/playwright/databaseActions'
|
||||||
import { parseDefaultGroupWithBlock } from 'utils/playwright/databaseHelpers'
|
import { parseDefaultGroupWithBlock } from 'utils/playwright/databaseHelpers'
|
||||||
|
|
||||||
test('should not be able to submit taken url ID', async ({ page }) => {
|
test('should not be able to submit taken url ID', async ({ page }) => {
|
||||||
const takenTypebotId = cuid()
|
const takenTypebotId = createId()
|
||||||
const typebotId = cuid()
|
const typebotId = createId()
|
||||||
await createTypebots([
|
await createTypebots([
|
||||||
{
|
{
|
||||||
id: takenTypebotId,
|
id: takenTypebotId,
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import cuid from 'cuid'
|
import { createId } from '@paralleldrive/cuid2'
|
||||||
import { PublicTypebot, Typebot } from 'models'
|
import { PublicTypebot, Typebot } from 'models'
|
||||||
import { dequal } from 'dequal'
|
import { dequal } from 'dequal'
|
||||||
import { omit } from 'utils'
|
import { omit } from 'utils'
|
||||||
@@ -31,7 +31,7 @@ export const parsePublicTypebotToTypebot = (
|
|||||||
export const parseTypebotToPublicTypebot = (
|
export const parseTypebotToPublicTypebot = (
|
||||||
typebot: Typebot
|
typebot: Typebot
|
||||||
): PublicTypebot => ({
|
): PublicTypebot => ({
|
||||||
id: cuid(),
|
id: createId(),
|
||||||
typebotId: typebot.id,
|
typebotId: typebot.id,
|
||||||
groups: typebot.groups,
|
groups: typebot.groups,
|
||||||
edges: typebot.edges,
|
edges: typebot.edges,
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import { getTestAsset } from '@/test/utils/playwright'
|
import { getTestAsset } from '@/test/utils/playwright'
|
||||||
import { deleteButtonInConfirmDialog } from '@/test/utils/selectorUtils'
|
import { deleteButtonInConfirmDialog } from '@/test/utils/selectorUtils'
|
||||||
import test, { expect, Page } from '@playwright/test'
|
import test, { expect, Page } from '@playwright/test'
|
||||||
import cuid from 'cuid'
|
import { createId } from '@paralleldrive/cuid2'
|
||||||
import { readFileSync } from 'fs'
|
import { readFileSync } from 'fs'
|
||||||
import { parse } from 'papaparse'
|
import { parse } from 'papaparse'
|
||||||
import {
|
import {
|
||||||
@@ -9,7 +9,7 @@ import {
|
|||||||
injectFakeResults,
|
injectFakeResults,
|
||||||
} from 'utils/playwright/databaseActions'
|
} from 'utils/playwright/databaseActions'
|
||||||
|
|
||||||
const typebotId = cuid()
|
const typebotId = createId()
|
||||||
|
|
||||||
test.beforeEach(async () => {
|
test.beforeEach(async () => {
|
||||||
await importTypebotInDatabase(
|
await importTypebotInDatabase(
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { getTestAsset } from '@/test/utils/playwright'
|
import { getTestAsset } from '@/test/utils/playwright'
|
||||||
import test, { expect } from '@playwright/test'
|
import test, { expect } from '@playwright/test'
|
||||||
import cuid from 'cuid'
|
import { createId } from '@paralleldrive/cuid2'
|
||||||
import { defaultTextInputOptions } from 'models'
|
import { defaultTextInputOptions } from 'models'
|
||||||
import { importTypebotInDatabase } from 'utils/playwright/databaseActions'
|
import { importTypebotInDatabase } from 'utils/playwright/databaseActions'
|
||||||
import { freeWorkspaceId } from 'utils/playwright/databaseSetup'
|
import { freeWorkspaceId } from 'utils/playwright/databaseSetup'
|
||||||
@@ -9,7 +9,7 @@ import { typebotViewer } from 'utils/playwright/testHelpers'
|
|||||||
test.describe.parallel('Settings page', () => {
|
test.describe.parallel('Settings page', () => {
|
||||||
test.describe('General', () => {
|
test.describe('General', () => {
|
||||||
test('should reflect change in real-time', async ({ page }) => {
|
test('should reflect change in real-time', async ({ page }) => {
|
||||||
const typebotId = cuid()
|
const typebotId = createId()
|
||||||
await importTypebotInDatabase(getTestAsset('typebots/settings.json'), {
|
await importTypebotInDatabase(getTestAsset('typebots/settings.json'), {
|
||||||
id: typebotId,
|
id: typebotId,
|
||||||
})
|
})
|
||||||
@@ -47,7 +47,7 @@ test.describe.parallel('Settings page', () => {
|
|||||||
|
|
||||||
test.describe('Typing emulation', () => {
|
test.describe('Typing emulation', () => {
|
||||||
test('should be fillable', async ({ page }) => {
|
test('should be fillable', async ({ page }) => {
|
||||||
const typebotId = cuid()
|
const typebotId = createId()
|
||||||
await importTypebotInDatabase(getTestAsset('typebots/settings.json'), {
|
await importTypebotInDatabase(getTestAsset('typebots/settings.json'), {
|
||||||
id: typebotId,
|
id: typebotId,
|
||||||
})
|
})
|
||||||
@@ -68,7 +68,7 @@ test.describe.parallel('Settings page', () => {
|
|||||||
test('should be fillable', async ({ page }) => {
|
test('should be fillable', async ({ page }) => {
|
||||||
const favIconUrl = 'https://www.baptistearno.com/favicon.png'
|
const favIconUrl = 'https://www.baptistearno.com/favicon.png'
|
||||||
const imageUrl = 'https://www.baptistearno.com/images/site-preview.png'
|
const imageUrl = 'https://www.baptistearno.com/images/site-preview.png'
|
||||||
const typebotId = cuid()
|
const typebotId = createId()
|
||||||
await importTypebotInDatabase(getTestAsset('typebots/settings.json'), {
|
await importTypebotInDatabase(getTestAsset('typebots/settings.json'), {
|
||||||
id: typebotId,
|
id: typebotId,
|
||||||
})
|
})
|
||||||
@@ -114,7 +114,7 @@ test.describe.parallel('Settings page', () => {
|
|||||||
|
|
||||||
test.describe('Free workspace', () => {
|
test.describe('Free workspace', () => {
|
||||||
test("can't remove branding", async ({ page }) => {
|
test("can't remove branding", async ({ page }) => {
|
||||||
const typebotId = cuid()
|
const typebotId = createId()
|
||||||
await importTypebotInDatabase(getTestAsset('typebots/settings.json'), {
|
await importTypebotInDatabase(getTestAsset('typebots/settings.json'), {
|
||||||
id: typebotId,
|
id: typebotId,
|
||||||
workspaceId: freeWorkspaceId,
|
workspaceId: freeWorkspaceId,
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { getTestAsset } from '@/test/utils/playwright'
|
import { getTestAsset } from '@/test/utils/playwright'
|
||||||
import test, { expect } from '@playwright/test'
|
import test, { expect } from '@playwright/test'
|
||||||
import cuid from 'cuid'
|
import { createId } from '@paralleldrive/cuid2'
|
||||||
import { importTypebotInDatabase } from 'utils/playwright/databaseActions'
|
import { importTypebotInDatabase } from 'utils/playwright/databaseActions'
|
||||||
import { typebotViewer } from 'utils/playwright/testHelpers'
|
import { typebotViewer } from 'utils/playwright/testHelpers'
|
||||||
|
|
||||||
@@ -12,7 +12,7 @@ const guestAvatarUrl =
|
|||||||
test.describe.parallel('Theme page', () => {
|
test.describe.parallel('Theme page', () => {
|
||||||
test.describe('General', () => {
|
test.describe('General', () => {
|
||||||
test('should reflect change in real-time', async ({ page }) => {
|
test('should reflect change in real-time', async ({ page }) => {
|
||||||
const typebotId = cuid()
|
const typebotId = createId()
|
||||||
const chatContainer = typebotViewer(page).locator(
|
const chatContainer = typebotViewer(page).locator(
|
||||||
'[data-testid="container"]'
|
'[data-testid="container"]'
|
||||||
)
|
)
|
||||||
@@ -165,7 +165,7 @@ test.describe.parallel('Theme page', () => {
|
|||||||
|
|
||||||
test.describe('Custom CSS', () => {
|
test.describe('Custom CSS', () => {
|
||||||
test('should reflect change in real-time', async ({ page }) => {
|
test('should reflect change in real-time', async ({ page }) => {
|
||||||
const typebotId = cuid()
|
const typebotId = createId()
|
||||||
await importTypebotInDatabase(getTestAsset('typebots/theme.json'), {
|
await importTypebotInDatabase(getTestAsset('typebots/theme.json'), {
|
||||||
id: typebotId,
|
id: typebotId,
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import test, { expect } from '@playwright/test'
|
import test, { expect } from '@playwright/test'
|
||||||
import cuid from 'cuid'
|
import { createId } from '@paralleldrive/cuid2'
|
||||||
import { defaultTextInputOptions, InputBlockType } from 'models'
|
import { defaultTextInputOptions, InputBlockType } from 'models'
|
||||||
import { createTypebots } from 'utils/playwright/databaseActions'
|
import { createTypebots } from 'utils/playwright/databaseActions'
|
||||||
import {
|
import {
|
||||||
@@ -9,8 +9,8 @@ import {
|
|||||||
import { parseDefaultGroupWithBlock } from 'utils/playwright/databaseHelpers'
|
import { parseDefaultGroupWithBlock } from 'utils/playwright/databaseHelpers'
|
||||||
import { mockSessionResponsesToOtherUser } from 'utils/playwright/testHelpers'
|
import { mockSessionResponsesToOtherUser } from 'utils/playwright/testHelpers'
|
||||||
|
|
||||||
const proTypebotId = cuid()
|
const proTypebotId = createId()
|
||||||
const starterTypebotId = cuid()
|
const starterTypebotId = createId()
|
||||||
|
|
||||||
test.beforeAll(async () => {
|
test.beforeAll(async () => {
|
||||||
await createTypebots([
|
await createTypebots([
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
// Forked from https://github.com/nextauthjs/adapters/blob/main/packages/prisma/src/index.ts
|
// Forked from https://github.com/nextauthjs/adapters/blob/main/packages/prisma/src/index.ts
|
||||||
import { PrismaClient, Prisma, WorkspaceRole, Session } from 'db'
|
import { PrismaClient, Prisma, WorkspaceRole, Session } from 'db'
|
||||||
import type { Adapter, AdapterUser } from 'next-auth/adapters'
|
import type { Adapter, AdapterUser } from 'next-auth/adapters'
|
||||||
import cuid from 'cuid'
|
import { createId } from '@paralleldrive/cuid2'
|
||||||
import { got } from 'got'
|
import { got } from 'got'
|
||||||
import { generateId } from 'utils'
|
import { generateId } from 'utils'
|
||||||
import { parseWorkspaceDefaultPlan } from '@/features/workspace'
|
import { parseWorkspaceDefaultPlan } from '@/features/workspace'
|
||||||
@@ -14,7 +14,7 @@ import {
|
|||||||
export function CustomAdapter(p: PrismaClient): Adapter {
|
export function CustomAdapter(p: PrismaClient): Adapter {
|
||||||
return {
|
return {
|
||||||
createUser: async (data: Omit<AdapterUser, 'id'>) => {
|
createUser: async (data: Omit<AdapterUser, 'id'>) => {
|
||||||
const user = { id: cuid(), email: data.email as string }
|
const user = { id: createId(), email: data.email as string }
|
||||||
const { invitations, workspaceInvitations } = await getNewUserInvitations(
|
const { invitations, workspaceInvitations } = await getNewUserInvitations(
|
||||||
p,
|
p,
|
||||||
user.email
|
user.email
|
||||||
|
|||||||
@@ -20,7 +20,7 @@
|
|||||||
"aws-sdk": "2.1304.0",
|
"aws-sdk": "2.1304.0",
|
||||||
"bot-engine": "workspace:*",
|
"bot-engine": "workspace:*",
|
||||||
"cors": "2.8.5",
|
"cors": "2.8.5",
|
||||||
"cuid": "3.0.0",
|
"@paralleldrive/cuid2": "2.0.1",
|
||||||
"db": "workspace:*",
|
"db": "workspace:*",
|
||||||
"google-spreadsheet": "3.3.0",
|
"google-spreadsheet": "3.3.0",
|
||||||
"got": "12.5.3",
|
"got": "12.5.3",
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import test, { expect } from '@playwright/test'
|
import test, { expect } from '@playwright/test'
|
||||||
import cuid from 'cuid'
|
import { createId } from '@paralleldrive/cuid2'
|
||||||
import { parse } from 'papaparse'
|
import { parse } from 'papaparse'
|
||||||
import { readFileSync } from 'fs'
|
import { readFileSync } from 'fs'
|
||||||
import { isDefined } from 'utils'
|
import { isDefined } from 'utils'
|
||||||
@@ -15,7 +15,7 @@ import { Plan } from 'db'
|
|||||||
const THREE_GIGABYTES = 3 * 1024 * 1024 * 1024
|
const THREE_GIGABYTES = 3 * 1024 * 1024 * 1024
|
||||||
|
|
||||||
test('should work as expected', async ({ page, browser }) => {
|
test('should work as expected', async ({ page, browser }) => {
|
||||||
const typebotId = cuid()
|
const typebotId = createId()
|
||||||
await importTypebotInDatabase(getTestAsset('typebots/fileUpload.json'), {
|
await importTypebotInDatabase(getTestAsset('typebots/fileUpload.json'), {
|
||||||
id: typebotId,
|
id: typebotId,
|
||||||
publicId: `${typebotId}-public`,
|
publicId: `${typebotId}-public`,
|
||||||
@@ -79,8 +79,8 @@ test('should work as expected', async ({ page, browser }) => {
|
|||||||
})
|
})
|
||||||
|
|
||||||
test.describe('Storage limit is reached', () => {
|
test.describe('Storage limit is reached', () => {
|
||||||
const typebotId = cuid()
|
const typebotId = createId()
|
||||||
const workspaceId = cuid()
|
const workspaceId = createId()
|
||||||
|
|
||||||
test.beforeAll(async () => {
|
test.beforeAll(async () => {
|
||||||
await createWorkspaces([{ id: workspaceId, plan: Plan.STARTER }])
|
await createWorkspaces([{ id: workspaceId, plan: Plan.STARTER }])
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import test, { expect } from '@playwright/test'
|
import test, { expect } from '@playwright/test'
|
||||||
import cuid from 'cuid'
|
import { createId } from '@paralleldrive/cuid2'
|
||||||
import { parse } from 'papaparse'
|
import { parse } from 'papaparse'
|
||||||
import { readFileSync } from 'fs'
|
import { readFileSync } from 'fs'
|
||||||
import { isDefined } from 'utils'
|
import { isDefined } from 'utils'
|
||||||
@@ -14,7 +14,7 @@ import { Plan } from 'db'
|
|||||||
const THREE_GIGABYTES = 3 * 1024 * 1024 * 1024
|
const THREE_GIGABYTES = 3 * 1024 * 1024 * 1024
|
||||||
|
|
||||||
test('should work as expected', async ({ page, browser }) => {
|
test('should work as expected', async ({ page, browser }) => {
|
||||||
const typebotId = cuid()
|
const typebotId = createId()
|
||||||
await importTypebotInDatabase(getTestAsset('typebots/fileUpload.json'), {
|
await importTypebotInDatabase(getTestAsset('typebots/fileUpload.json'), {
|
||||||
id: typebotId,
|
id: typebotId,
|
||||||
publicId: `${typebotId}-public`,
|
publicId: `${typebotId}-public`,
|
||||||
@@ -76,8 +76,8 @@ test('should work as expected', async ({ page, browser }) => {
|
|||||||
})
|
})
|
||||||
|
|
||||||
test.describe('Storage limit is reached', () => {
|
test.describe('Storage limit is reached', () => {
|
||||||
const typebotId = cuid()
|
const typebotId = createId()
|
||||||
const workspaceId = cuid()
|
const workspaceId = createId()
|
||||||
|
|
||||||
test.beforeAll(async () => {
|
test.beforeAll(async () => {
|
||||||
await createWorkspaces([{ id: workspaceId, plan: Plan.STARTER }])
|
await createWorkspaces([{ id: workspaceId, plan: Plan.STARTER }])
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
import test, { expect } from '@playwright/test'
|
import test, { expect } from '@playwright/test'
|
||||||
import cuid from 'cuid'
|
import { createId } from '@paralleldrive/cuid2'
|
||||||
import { createTypebots } from 'utils/playwright/databaseActions'
|
import { createTypebots } from 'utils/playwright/databaseActions'
|
||||||
import { parseDefaultGroupWithBlock } from 'utils/playwright/databaseHelpers'
|
import { parseDefaultGroupWithBlock } from 'utils/playwright/databaseHelpers'
|
||||||
import { defaultChatwootOptions, IntegrationBlockType } from 'models'
|
import { defaultChatwootOptions, IntegrationBlockType } from 'models'
|
||||||
import { typebotViewer } from 'utils/playwright/testHelpers'
|
import { typebotViewer } from 'utils/playwright/testHelpers'
|
||||||
|
|
||||||
const typebotId = cuid()
|
const typebotId = createId()
|
||||||
|
|
||||||
const chatwootTestWebsiteToken = 'tueXiiqEmrWUCZ4NUyoR7nhE'
|
const chatwootTestWebsiteToken = 'tueXiiqEmrWUCZ4NUyoR7nhE'
|
||||||
|
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
import test, { expect } from '@playwright/test'
|
import test, { expect } from '@playwright/test'
|
||||||
import cuid from 'cuid'
|
import { createId } from '@paralleldrive/cuid2'
|
||||||
import { createTypebots } from 'utils/playwright/databaseActions'
|
import { createTypebots } from 'utils/playwright/databaseActions'
|
||||||
import { parseDefaultGroupWithBlock } from 'utils/playwright/databaseHelpers'
|
import { parseDefaultGroupWithBlock } from 'utils/playwright/databaseHelpers'
|
||||||
import { defaultChatwootOptions, IntegrationBlockType } from 'models'
|
import { defaultChatwootOptions, IntegrationBlockType } from 'models'
|
||||||
|
|
||||||
const typebotId = cuid()
|
const typebotId = createId()
|
||||||
|
|
||||||
const chatwootTestWebsiteToken = 'tueXiiqEmrWUCZ4NUyoR7nhE'
|
const chatwootTestWebsiteToken = 'tueXiiqEmrWUCZ4NUyoR7nhE'
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import test, { expect } from '@playwright/test'
|
import test, { expect } from '@playwright/test'
|
||||||
import { createSmtpCredentials } from '../../../../test/utils/databaseActions'
|
import { createSmtpCredentials } from '../../../../test/utils/databaseActions'
|
||||||
import cuid from 'cuid'
|
import { createId } from '@paralleldrive/cuid2'
|
||||||
import { SmtpCredentialsData } from 'models'
|
import { SmtpCredentialsData } from 'models'
|
||||||
import { importTypebotInDatabase } from 'utils/playwright/databaseActions'
|
import { importTypebotInDatabase } from 'utils/playwright/databaseActions'
|
||||||
import { typebotViewer } from 'utils/playwright/testHelpers'
|
import { typebotViewer } from 'utils/playwright/testHelpers'
|
||||||
@@ -27,7 +27,7 @@ test.beforeAll(async () => {
|
|||||||
})
|
})
|
||||||
|
|
||||||
test('should send an email', async ({ page }) => {
|
test('should send an email', async ({ page }) => {
|
||||||
const typebotId = cuid()
|
const typebotId = createId()
|
||||||
await importTypebotInDatabase(getTestAsset('typebots/sendEmail.json'), {
|
await importTypebotInDatabase(getTestAsset('typebots/sendEmail.json'), {
|
||||||
id: typebotId,
|
id: typebotId,
|
||||||
publicId: `${typebotId}-public`,
|
publicId: `${typebotId}-public`,
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import test, { expect } from '@playwright/test'
|
import test, { expect } from '@playwright/test'
|
||||||
import { createSmtpCredentials } from '../../../../test/utils/databaseActions'
|
import { createSmtpCredentials } from '../../../../test/utils/databaseActions'
|
||||||
import cuid from 'cuid'
|
import { createId } from '@paralleldrive/cuid2'
|
||||||
import { SmtpCredentialsData } from 'models'
|
import { SmtpCredentialsData } from 'models'
|
||||||
import { importTypebotInDatabase } from 'utils/playwright/databaseActions'
|
import { importTypebotInDatabase } from 'utils/playwright/databaseActions'
|
||||||
import { getTestAsset } from '@/test/utils/playwright'
|
import { getTestAsset } from '@/test/utils/playwright'
|
||||||
@@ -26,7 +26,7 @@ test.beforeAll(async () => {
|
|||||||
})
|
})
|
||||||
|
|
||||||
test('should send an email', async ({ page }) => {
|
test('should send an email', async ({ page }) => {
|
||||||
const typebotId = cuid()
|
const typebotId = createId()
|
||||||
await importTypebotInDatabase(getTestAsset('typebots/sendEmail.json'), {
|
await importTypebotInDatabase(getTestAsset('typebots/sendEmail.json'), {
|
||||||
id: typebotId,
|
id: typebotId,
|
||||||
publicId: `${typebotId}-public`,
|
publicId: `${typebotId}-public`,
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import test, { expect } from '@playwright/test'
|
import test, { expect } from '@playwright/test'
|
||||||
import cuid from 'cuid'
|
import { createId } from '@paralleldrive/cuid2'
|
||||||
import { HttpMethod, Typebot } from 'models'
|
import { HttpMethod, Typebot } from 'models'
|
||||||
import {
|
import {
|
||||||
createWebhook,
|
createWebhook,
|
||||||
@@ -12,7 +12,7 @@ import { apiToken } from 'utils/playwright/databaseSetup'
|
|||||||
import { getTestAsset } from '@/test/utils/playwright'
|
import { getTestAsset } from '@/test/utils/playwright'
|
||||||
|
|
||||||
test.describe('Bot', () => {
|
test.describe('Bot', () => {
|
||||||
const typebotId = cuid()
|
const typebotId = createId()
|
||||||
|
|
||||||
test.beforeEach(async () => {
|
test.beforeEach(async () => {
|
||||||
await importTypebotInDatabase(getTestAsset('typebots/webhook.json'), {
|
await importTypebotInDatabase(getTestAsset('typebots/webhook.json'), {
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import test, { expect } from '@playwright/test'
|
import test, { expect } from '@playwright/test'
|
||||||
import cuid from 'cuid'
|
import { createId } from '@paralleldrive/cuid2'
|
||||||
import { HttpMethod } from 'models'
|
import { HttpMethod } from 'models'
|
||||||
import {
|
import {
|
||||||
createWebhook,
|
createWebhook,
|
||||||
@@ -9,7 +9,7 @@ import {
|
|||||||
} from 'utils/playwright/databaseActions'
|
} from 'utils/playwright/databaseActions'
|
||||||
import { getTestAsset } from '@/test/utils/playwright'
|
import { getTestAsset } from '@/test/utils/playwright'
|
||||||
|
|
||||||
const typebotId = cuid()
|
const typebotId = createId()
|
||||||
|
|
||||||
test.beforeEach(async () => {
|
test.beforeEach(async () => {
|
||||||
await importTypebotInDatabase(getTestAsset('typebots/webhook.json'), {
|
await importTypebotInDatabase(getTestAsset('typebots/webhook.json'), {
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { getTestAsset } from '@/test/utils/playwright'
|
import { getTestAsset } from '@/test/utils/playwright'
|
||||||
import test, { expect } from '@playwright/test'
|
import test, { expect } from '@playwright/test'
|
||||||
import cuid from 'cuid'
|
import { createId } from '@paralleldrive/cuid2'
|
||||||
import prisma from '@/lib/prisma'
|
import prisma from '@/lib/prisma'
|
||||||
import { HttpMethod, SendMessageInput } from 'models'
|
import { HttpMethod, SendMessageInput } from 'models'
|
||||||
import {
|
import {
|
||||||
@@ -16,7 +16,7 @@ test.afterEach(async () => {
|
|||||||
})
|
})
|
||||||
|
|
||||||
test('API chat execution should work on preview bot', async ({ request }) => {
|
test('API chat execution should work on preview bot', async ({ request }) => {
|
||||||
const typebotId = cuid()
|
const typebotId = createId()
|
||||||
const publicId = `${typebotId}-public`
|
const publicId = `${typebotId}-public`
|
||||||
await importTypebotInDatabase(getTestAsset('typebots/chat/main.json'), {
|
await importTypebotInDatabase(getTestAsset('typebots/chat/main.json'), {
|
||||||
id: typebotId,
|
id: typebotId,
|
||||||
@@ -52,7 +52,7 @@ test('API chat execution should work on preview bot', async ({ request }) => {
|
|||||||
})
|
})
|
||||||
|
|
||||||
test('API chat execution should work on published bot', async ({ request }) => {
|
test('API chat execution should work on published bot', async ({ request }) => {
|
||||||
const typebotId = cuid()
|
const typebotId = createId()
|
||||||
const publicId = `${typebotId}-public`
|
const publicId = `${typebotId}-public`
|
||||||
await importTypebotInDatabase(getTestAsset('typebots/chat/main.json'), {
|
await importTypebotInDatabase(getTestAsset('typebots/chat/main.json'), {
|
||||||
id: typebotId,
|
id: typebotId,
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { getTestAsset } from '@/test/utils/playwright'
|
import { getTestAsset } from '@/test/utils/playwright'
|
||||||
import test, { expect } from '@playwright/test'
|
import test, { expect } from '@playwright/test'
|
||||||
import cuid from 'cuid'
|
import { createId } from '@paralleldrive/cuid2'
|
||||||
import {
|
import {
|
||||||
importTypebotInDatabase,
|
importTypebotInDatabase,
|
||||||
injectFakeResults,
|
injectFakeResults,
|
||||||
@@ -9,7 +9,7 @@ import { apiToken } from 'utils/playwright/databaseSetup'
|
|||||||
import { typebotViewer } from 'utils/playwright/testHelpers'
|
import { typebotViewer } from 'utils/playwright/testHelpers'
|
||||||
|
|
||||||
test('Big groups should work as expected', async ({ page }) => {
|
test('Big groups should work as expected', async ({ page }) => {
|
||||||
const typebotId = cuid()
|
const typebotId = createId()
|
||||||
await importTypebotInDatabase(getTestAsset('typebots/hugeGroup.json'), {
|
await importTypebotInDatabase(getTestAsset('typebots/hugeGroup.json'), {
|
||||||
id: typebotId,
|
id: typebotId,
|
||||||
publicId: `${typebotId}-public`,
|
publicId: `${typebotId}-public`,
|
||||||
@@ -32,7 +32,7 @@ test('Big groups should work as expected', async ({ page }) => {
|
|||||||
})
|
})
|
||||||
|
|
||||||
test('can list results with API', async ({ request }) => {
|
test('can list results with API', async ({ request }) => {
|
||||||
const typebotId = cuid()
|
const typebotId = createId()
|
||||||
await importTypebotInDatabase(getTestAsset('typebots/api.json'), {
|
await importTypebotInDatabase(getTestAsset('typebots/api.json'), {
|
||||||
id: typebotId,
|
id: typebotId,
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
import { getTestAsset } from '@/test/utils/playwright'
|
import { getTestAsset } from '@/test/utils/playwright'
|
||||||
import test, { expect } from '@playwright/test'
|
import test, { expect } from '@playwright/test'
|
||||||
import cuid from 'cuid'
|
import { createId } from '@paralleldrive/cuid2'
|
||||||
import { importTypebotInDatabase } from 'utils/playwright/databaseActions'
|
import { importTypebotInDatabase } from 'utils/playwright/databaseActions'
|
||||||
|
|
||||||
test('Big groups should work as expected', async ({ page }) => {
|
test('Big groups should work as expected', async ({ page }) => {
|
||||||
const typebotId = cuid()
|
const typebotId = createId()
|
||||||
await importTypebotInDatabase(getTestAsset('typebots/hugeGroup.json'), {
|
await importTypebotInDatabase(getTestAsset('typebots/hugeGroup.json'), {
|
||||||
id: typebotId,
|
id: typebotId,
|
||||||
publicId: `${typebotId}-public`,
|
publicId: `${typebotId}-public`,
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import test, { expect } from '@playwright/test'
|
import test, { expect } from '@playwright/test'
|
||||||
import cuid from 'cuid'
|
import { createId } from '@paralleldrive/cuid2'
|
||||||
import {
|
import {
|
||||||
defaultSettings,
|
defaultSettings,
|
||||||
defaultTextInputOptions,
|
defaultTextInputOptions,
|
||||||
@@ -11,7 +11,7 @@ import { parseDefaultGroupWithBlock } from 'utils/playwright/databaseHelpers'
|
|||||||
import { typebotViewer } from 'utils/playwright/testHelpers'
|
import { typebotViewer } from 'utils/playwright/testHelpers'
|
||||||
|
|
||||||
test('Result should be in storage by default', async ({ page }) => {
|
test('Result should be in storage by default', async ({ page }) => {
|
||||||
const typebotId = cuid()
|
const typebotId = createId()
|
||||||
await createTypebots([
|
await createTypebots([
|
||||||
{
|
{
|
||||||
id: typebotId,
|
id: typebotId,
|
||||||
@@ -37,7 +37,7 @@ test('Result should be in storage by default', async ({ page }) => {
|
|||||||
|
|
||||||
test.describe('Create result on page refresh enabled', () => {
|
test.describe('Create result on page refresh enabled', () => {
|
||||||
test('should work', async ({ page }) => {
|
test('should work', async ({ page }) => {
|
||||||
const typebotId = cuid()
|
const typebotId = createId()
|
||||||
await createTypebots([
|
await createTypebots([
|
||||||
{
|
{
|
||||||
id: typebotId,
|
id: typebotId,
|
||||||
@@ -80,7 +80,7 @@ test.describe('Create result on page refresh enabled', () => {
|
|||||||
})
|
})
|
||||||
|
|
||||||
test('Hide query params', async ({ page }) => {
|
test('Hide query params', async ({ page }) => {
|
||||||
const typebotId = cuid()
|
const typebotId = createId()
|
||||||
await createTypebots([
|
await createTypebots([
|
||||||
{
|
{
|
||||||
id: typebotId,
|
id: typebotId,
|
||||||
@@ -108,7 +108,7 @@ test('Hide query params', async ({ page }) => {
|
|||||||
})
|
})
|
||||||
|
|
||||||
test('Show close message', async ({ page }) => {
|
test('Show close message', async ({ page }) => {
|
||||||
const typebotId = cuid()
|
const typebotId = createId()
|
||||||
await createTypebots([
|
await createTypebots([
|
||||||
{
|
{
|
||||||
id: typebotId,
|
id: typebotId,
|
||||||
@@ -124,7 +124,7 @@ test('Show close message', async ({ page }) => {
|
|||||||
})
|
})
|
||||||
|
|
||||||
test('Should correctly parse metadata', async ({ page }) => {
|
test('Should correctly parse metadata', async ({ page }) => {
|
||||||
const typebotId = cuid()
|
const typebotId = createId()
|
||||||
const googleTagManagerId = 'GTM-M72NXKB'
|
const googleTagManagerId = 'GTM-M72NXKB'
|
||||||
const customMetadata: Metadata = {
|
const customMetadata: Metadata = {
|
||||||
description: 'My custom description',
|
description: 'My custom description',
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import test, { expect } from '@playwright/test'
|
import test, { expect } from '@playwright/test'
|
||||||
import cuid from 'cuid'
|
import { createId } from '@paralleldrive/cuid2'
|
||||||
import {
|
import {
|
||||||
defaultSettings,
|
defaultSettings,
|
||||||
defaultTextInputOptions,
|
defaultTextInputOptions,
|
||||||
@@ -10,7 +10,7 @@ import { createTypebots, updateTypebot } from 'utils/playwright/databaseActions'
|
|||||||
import { parseDefaultGroupWithBlock } from 'utils/playwright/databaseHelpers'
|
import { parseDefaultGroupWithBlock } from 'utils/playwright/databaseHelpers'
|
||||||
|
|
||||||
test('Result should be overwritten on page refresh', async ({ page }) => {
|
test('Result should be overwritten on page refresh', async ({ page }) => {
|
||||||
const typebotId = cuid()
|
const typebotId = createId()
|
||||||
await createTypebots([
|
await createTypebots([
|
||||||
{
|
{
|
||||||
id: typebotId,
|
id: typebotId,
|
||||||
@@ -39,7 +39,7 @@ test('Result should be overwritten on page refresh', async ({ page }) => {
|
|||||||
|
|
||||||
test.describe('Create result on page refresh enabled', () => {
|
test.describe('Create result on page refresh enabled', () => {
|
||||||
test('should work', async ({ page }) => {
|
test('should work', async ({ page }) => {
|
||||||
const typebotId = cuid()
|
const typebotId = createId()
|
||||||
await createTypebots([
|
await createTypebots([
|
||||||
{
|
{
|
||||||
id: typebotId,
|
id: typebotId,
|
||||||
@@ -74,7 +74,7 @@ test.describe('Create result on page refresh enabled', () => {
|
|||||||
})
|
})
|
||||||
|
|
||||||
test('Hide query params', async ({ page }) => {
|
test('Hide query params', async ({ page }) => {
|
||||||
const typebotId = cuid()
|
const typebotId = createId()
|
||||||
await createTypebots([
|
await createTypebots([
|
||||||
{
|
{
|
||||||
id: typebotId,
|
id: typebotId,
|
||||||
@@ -102,7 +102,7 @@ test('Hide query params', async ({ page }) => {
|
|||||||
})
|
})
|
||||||
|
|
||||||
test('Show close message', async ({ page }) => {
|
test('Show close message', async ({ page }) => {
|
||||||
const typebotId = cuid()
|
const typebotId = createId()
|
||||||
await createTypebots([
|
await createTypebots([
|
||||||
{
|
{
|
||||||
id: typebotId,
|
id: typebotId,
|
||||||
@@ -118,7 +118,7 @@ test('Show close message', async ({ page }) => {
|
|||||||
})
|
})
|
||||||
|
|
||||||
test('Should correctly parse metadata', async ({ page }) => {
|
test('Should correctly parse metadata', async ({ page }) => {
|
||||||
const typebotId = cuid()
|
const typebotId = createId()
|
||||||
const customMetadata: Metadata = {
|
const customMetadata: Metadata = {
|
||||||
description: 'My custom description',
|
description: 'My custom description',
|
||||||
title: 'Custom title',
|
title: 'Custom title',
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { getTestAsset } from '@/test/utils/playwright'
|
import { getTestAsset } from '@/test/utils/playwright'
|
||||||
import test, { expect } from '@playwright/test'
|
import test, { expect } from '@playwright/test'
|
||||||
import cuid from 'cuid'
|
import { createId } from '@paralleldrive/cuid2'
|
||||||
import { Plan } from 'db'
|
import { Plan } from 'db'
|
||||||
import { defaultSettings } from 'models'
|
import { defaultSettings } from 'models'
|
||||||
import {
|
import {
|
||||||
@@ -12,8 +12,8 @@ import { typebotViewer } from 'utils/playwright/testHelpers'
|
|||||||
|
|
||||||
test('should not start if chat limit is reached', async ({ page, context }) => {
|
test('should not start if chat limit is reached', async ({ page, context }) => {
|
||||||
await test.step('Free plan', async () => {
|
await test.step('Free plan', async () => {
|
||||||
const workspaceId = cuid()
|
const workspaceId = createId()
|
||||||
const typebotId = cuid()
|
const typebotId = createId()
|
||||||
await createWorkspaces([{ id: workspaceId, plan: Plan.FREE }])
|
await createWorkspaces([{ id: workspaceId, plan: Plan.FREE }])
|
||||||
await importTypebotInDatabase(getTestAsset('typebots/fileUpload.json'), {
|
await importTypebotInDatabase(getTestAsset('typebots/fileUpload.json'), {
|
||||||
id: typebotId,
|
id: typebotId,
|
||||||
@@ -28,8 +28,8 @@ test('should not start if chat limit is reached', async ({ page, context }) => {
|
|||||||
})
|
})
|
||||||
|
|
||||||
await test.step('Lifetime plan', async () => {
|
await test.step('Lifetime plan', async () => {
|
||||||
const workspaceId = cuid()
|
const workspaceId = createId()
|
||||||
const typebotId = cuid()
|
const typebotId = createId()
|
||||||
await createWorkspaces([{ id: workspaceId, plan: Plan.LIFETIME }])
|
await createWorkspaces([{ id: workspaceId, plan: Plan.LIFETIME }])
|
||||||
await importTypebotInDatabase(getTestAsset('typebots/fileUpload.json'), {
|
await importTypebotInDatabase(getTestAsset('typebots/fileUpload.json'), {
|
||||||
id: typebotId,
|
id: typebotId,
|
||||||
@@ -44,8 +44,8 @@ test('should not start if chat limit is reached', async ({ page, context }) => {
|
|||||||
})
|
})
|
||||||
|
|
||||||
await test.step('Custom plan', async () => {
|
await test.step('Custom plan', async () => {
|
||||||
const workspaceId = cuid()
|
const workspaceId = createId()
|
||||||
const typebotId = cuid()
|
const typebotId = createId()
|
||||||
await createWorkspaces([
|
await createWorkspaces([
|
||||||
{ id: workspaceId, plan: Plan.CUSTOM, customChatsLimit: 1000 },
|
{ id: workspaceId, plan: Plan.CUSTOM, customChatsLimit: 1000 },
|
||||||
])
|
])
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { getTestAsset } from '@/test/utils/playwright'
|
import { getTestAsset } from '@/test/utils/playwright'
|
||||||
import test, { expect } from '@playwright/test'
|
import test, { expect } from '@playwright/test'
|
||||||
import cuid from 'cuid'
|
import { createId } from '@paralleldrive/cuid2'
|
||||||
import { Plan } from 'db'
|
import { Plan } from 'db'
|
||||||
import { defaultSettings } from 'models'
|
import { defaultSettings } from 'models'
|
||||||
import {
|
import {
|
||||||
@@ -11,8 +11,8 @@ import {
|
|||||||
|
|
||||||
test('should not start if chat limit is reached', async ({ page, context }) => {
|
test('should not start if chat limit is reached', async ({ page, context }) => {
|
||||||
await test.step('Free plan', async () => {
|
await test.step('Free plan', async () => {
|
||||||
const workspaceId = cuid()
|
const workspaceId = createId()
|
||||||
const typebotId = cuid()
|
const typebotId = createId()
|
||||||
await createWorkspaces([{ id: workspaceId, plan: Plan.FREE }])
|
await createWorkspaces([{ id: workspaceId, plan: Plan.FREE }])
|
||||||
await importTypebotInDatabase(getTestAsset('typebots/fileUpload.json'), {
|
await importTypebotInDatabase(getTestAsset('typebots/fileUpload.json'), {
|
||||||
id: typebotId,
|
id: typebotId,
|
||||||
@@ -27,8 +27,8 @@ test('should not start if chat limit is reached', async ({ page, context }) => {
|
|||||||
})
|
})
|
||||||
|
|
||||||
await test.step('Lifetime plan', async () => {
|
await test.step('Lifetime plan', async () => {
|
||||||
const workspaceId = cuid()
|
const workspaceId = createId()
|
||||||
const typebotId = cuid()
|
const typebotId = createId()
|
||||||
await createWorkspaces([{ id: workspaceId, plan: Plan.LIFETIME }])
|
await createWorkspaces([{ id: workspaceId, plan: Plan.LIFETIME }])
|
||||||
await importTypebotInDatabase(getTestAsset('typebots/fileUpload.json'), {
|
await importTypebotInDatabase(getTestAsset('typebots/fileUpload.json'), {
|
||||||
id: typebotId,
|
id: typebotId,
|
||||||
@@ -41,8 +41,8 @@ test('should not start if chat limit is reached', async ({ page, context }) => {
|
|||||||
})
|
})
|
||||||
|
|
||||||
await test.step('Custom plan', async () => {
|
await test.step('Custom plan', async () => {
|
||||||
const workspaceId = cuid()
|
const workspaceId = createId()
|
||||||
const typebotId = cuid()
|
const typebotId = createId()
|
||||||
await createWorkspaces([
|
await createWorkspaces([
|
||||||
{ id: workspaceId, plan: Plan.CUSTOM, customChatsLimit: 1000 },
|
{ id: workspaceId, plan: Plan.CUSTOM, customChatsLimit: 1000 },
|
||||||
])
|
])
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
import { getTestAsset } from '@/test/utils/playwright'
|
import { getTestAsset } from '@/test/utils/playwright'
|
||||||
import test, { expect } from '@playwright/test'
|
import test, { expect } from '@playwright/test'
|
||||||
import cuid from 'cuid'
|
import { createId } from '@paralleldrive/cuid2'
|
||||||
import { importTypebotInDatabase } from 'utils/playwright/databaseActions'
|
import { importTypebotInDatabase } from 'utils/playwright/databaseActions'
|
||||||
import { typebotViewer } from 'utils/playwright/testHelpers'
|
import { typebotViewer } from 'utils/playwright/testHelpers'
|
||||||
|
|
||||||
test('should correctly be injected', async ({ page }) => {
|
test('should correctly be injected', async ({ page }) => {
|
||||||
const typebotId = cuid()
|
const typebotId = createId()
|
||||||
await importTypebotInDatabase(
|
await importTypebotInDatabase(
|
||||||
getTestAsset('typebots/predefinedVariables.json'),
|
getTestAsset('typebots/predefinedVariables.json'),
|
||||||
{ id: typebotId, publicId: `${typebotId}-public` }
|
{ id: typebotId, publicId: `${typebotId}-public` }
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
import { getTestAsset } from '@/test/utils/playwright'
|
import { getTestAsset } from '@/test/utils/playwright'
|
||||||
import test, { expect } from '@playwright/test'
|
import test, { expect } from '@playwright/test'
|
||||||
import cuid from 'cuid'
|
import { createId } from '@paralleldrive/cuid2'
|
||||||
import { importTypebotInDatabase } from 'utils/playwright/databaseActions'
|
import { importTypebotInDatabase } from 'utils/playwright/databaseActions'
|
||||||
|
|
||||||
test('should correctly be injected', async ({ page }) => {
|
test('should correctly be injected', async ({ page }) => {
|
||||||
const typebotId = cuid()
|
const typebotId = createId()
|
||||||
await importTypebotInDatabase(
|
await importTypebotInDatabase(
|
||||||
getTestAsset('typebots/predefinedVariables.json'),
|
getTestAsset('typebots/predefinedVariables.json'),
|
||||||
{ id: typebotId, publicId: `${typebotId}-public` }
|
{ id: typebotId, publicId: `${typebotId}-public` }
|
||||||
|
|||||||
@@ -26,7 +26,7 @@
|
|||||||
"cross-env": "7.0.3",
|
"cross-env": "7.0.3",
|
||||||
"cz-emoji": "1.3.2-canary.2",
|
"cz-emoji": "1.3.2-canary.2",
|
||||||
"husky": "^8.0.3",
|
"husky": "^8.0.3",
|
||||||
"turbo": "1.7.0"
|
"turbo": "1.7.4"
|
||||||
},
|
},
|
||||||
"config": {
|
"config": {
|
||||||
"commitizen": {
|
"commitizen": {
|
||||||
|
|||||||
@@ -9,5 +9,5 @@ export default defineConfig((options) => ({
|
|||||||
loader: {
|
loader: {
|
||||||
'.css': 'text',
|
'.css': 'text',
|
||||||
},
|
},
|
||||||
external: ['cuid'],
|
external: ['@paralleldrive/cuid2'],
|
||||||
}))
|
}))
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { z } from 'zod'
|
import { z } from 'zod'
|
||||||
import { ComparisonOperators, LogicalOperator } from '../../logic/condition'
|
import { ComparisonOperators, LogicalOperator } from '../../logic/condition'
|
||||||
import cuid from 'cuid'
|
import { createId } from '@paralleldrive/cuid2'
|
||||||
import { IntegrationBlockType } from '../enums'
|
import { IntegrationBlockType } from '../enums'
|
||||||
import { GoogleSheetsAction } from './enums'
|
import { GoogleSheetsAction } from './enums'
|
||||||
import { blockBaseSchema } from '../../baseSchemas'
|
import { blockBaseSchema } from '../../baseSchemas'
|
||||||
@@ -76,13 +76,13 @@ export const defaultGoogleSheetsGetOptions: GoogleSheetsGetOptions = {
|
|||||||
action: GoogleSheetsAction.GET,
|
action: GoogleSheetsAction.GET,
|
||||||
cellsToExtract: [
|
cellsToExtract: [
|
||||||
{
|
{
|
||||||
id: cuid(),
|
id: createId(),
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
filter: {
|
filter: {
|
||||||
comparisons: [
|
comparisons: [
|
||||||
{
|
{
|
||||||
id: cuid(),
|
id: createId(),
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
logicalOperator: LogicalOperator.AND,
|
logicalOperator: LogicalOperator.AND,
|
||||||
@@ -93,7 +93,7 @@ export const defaultGoogleSheetsInsertOptions: GoogleSheetsInsertRowOptions = {
|
|||||||
action: GoogleSheetsAction.INSERT_ROW,
|
action: GoogleSheetsAction.INSERT_ROW,
|
||||||
cellsToInsert: [
|
cellsToInsert: [
|
||||||
{
|
{
|
||||||
id: cuid(),
|
id: createId(),
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
}
|
}
|
||||||
@@ -102,7 +102,7 @@ export const defaultGoogleSheetsUpdateOptions: GoogleSheetsUpdateRowOptions = {
|
|||||||
action: GoogleSheetsAction.UPDATE_ROW,
|
action: GoogleSheetsAction.UPDATE_ROW,
|
||||||
cellsToUpsert: [
|
cellsToUpsert: [
|
||||||
{
|
{
|
||||||
id: cuid(),
|
id: createId(),
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,7 +9,7 @@
|
|||||||
"zod": "3.20.2"
|
"zod": "3.20.2"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"cuid": "3.0.0",
|
"@paralleldrive/cuid2": "2.0.1",
|
||||||
"db": "workspace:*",
|
"db": "workspace:*",
|
||||||
"next": "13.1.6",
|
"next": "13.1.6",
|
||||||
"tsconfig": "workspace:*",
|
"tsconfig": "workspace:*",
|
||||||
|
|||||||
@@ -9,7 +9,7 @@
|
|||||||
"@playwright/test": "1.30.0",
|
"@playwright/test": "1.30.0",
|
||||||
"@types/nodemailer": "6.4.7",
|
"@types/nodemailer": "6.4.7",
|
||||||
"aws-sdk": "2.1304.0",
|
"aws-sdk": "2.1304.0",
|
||||||
"cuid": "3.0.0",
|
"@paralleldrive/cuid2": "2.0.1",
|
||||||
"db": "workspace:*",
|
"db": "workspace:*",
|
||||||
"dotenv": "16.0.3",
|
"dotenv": "16.0.3",
|
||||||
"models": "workspace:*",
|
"models": "workspace:*",
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { Plan, Prisma, PrismaClient, User, Workspace, WorkspaceRole } from 'db'
|
import { Plan, Prisma, PrismaClient, User, Workspace, WorkspaceRole } from 'db'
|
||||||
import cuid from 'cuid'
|
import { createId } from '@paralleldrive/cuid2'
|
||||||
import { Typebot, Webhook } from 'models'
|
import { Typebot, Webhook } from 'models'
|
||||||
import { readFileSync } from 'fs'
|
import { readFileSync } from 'fs'
|
||||||
import { proWorkspaceId, userId } from './databaseSetup'
|
import { proWorkspaceId, userId } from './databaseSetup'
|
||||||
@@ -25,7 +25,7 @@ export const injectFakeResults = async ({
|
|||||||
isChronological,
|
isChronological,
|
||||||
fakeStorage,
|
fakeStorage,
|
||||||
}: CreateFakeResultsProps) => {
|
}: CreateFakeResultsProps) => {
|
||||||
const resultIdPrefix = customResultIdPrefix ?? cuid()
|
const resultIdPrefix = customResultIdPrefix ?? createId()
|
||||||
await prisma.result.createMany({
|
await prisma.result.createMany({
|
||||||
data: [
|
data: [
|
||||||
...Array.from(Array(count)).map((_, idx) => {
|
...Array.from(Array(count)).map((_, idx) => {
|
||||||
@@ -115,7 +115,7 @@ export const deleteWebhooks = async (webhookIds: string[]) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export const createWorkspaces = async (workspaces: Partial<Workspace>[]) => {
|
export const createWorkspaces = async (workspaces: Partial<Workspace>[]) => {
|
||||||
const workspaceIds = workspaces.map((workspace) => workspace.id ?? cuid())
|
const workspaceIds = workspaces.map((workspace) => workspace.id ?? createId())
|
||||||
await prisma.workspace.createMany({
|
await prisma.workspace.createMany({
|
||||||
data: workspaces.map((workspace, index) => ({
|
data: workspaces.map((workspace, index) => ({
|
||||||
id: workspaceIds[index],
|
id: workspaceIds[index],
|
||||||
@@ -166,7 +166,7 @@ export const createWebhook = async (
|
|||||||
|
|
||||||
export const createTypebots = async (partialTypebots: Partial<Typebot>[]) => {
|
export const createTypebots = async (partialTypebots: Partial<Typebot>[]) => {
|
||||||
const typebotsWithId = partialTypebots.map((typebot) => {
|
const typebotsWithId = partialTypebots.map((typebot) => {
|
||||||
const typebotId = typebot.id ?? cuid()
|
const typebotId = typebot.id ?? createId()
|
||||||
return {
|
return {
|
||||||
...typebot,
|
...typebot,
|
||||||
id: typebotId,
|
id: typebotId,
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import cuid from 'cuid'
|
import { createId } from '@paralleldrive/cuid2'
|
||||||
import {
|
import {
|
||||||
Block,
|
Block,
|
||||||
defaultChoiceInputOptions,
|
defaultChoiceInputOptions,
|
||||||
@@ -15,7 +15,7 @@ import { proWorkspaceId } from './databaseSetup'
|
|||||||
export const parseTestTypebot = (
|
export const parseTestTypebot = (
|
||||||
partialTypebot: Partial<Typebot>
|
partialTypebot: Partial<Typebot>
|
||||||
): Typebot => ({
|
): Typebot => ({
|
||||||
id: cuid(),
|
id: createId(),
|
||||||
workspaceId: proWorkspaceId,
|
workspaceId: proWorkspaceId,
|
||||||
folderId: null,
|
folderId: null,
|
||||||
name: 'My typebot',
|
name: 'My typebot',
|
||||||
|
|||||||
72
pnpm-lock.yaml
generated
72
pnpm-lock.yaml
generated
@@ -7,12 +7,12 @@ importers:
|
|||||||
cross-env: 7.0.3
|
cross-env: 7.0.3
|
||||||
cz-emoji: 1.3.2-canary.2
|
cz-emoji: 1.3.2-canary.2
|
||||||
husky: ^8.0.3
|
husky: ^8.0.3
|
||||||
turbo: 1.7.0
|
turbo: 1.7.4
|
||||||
devDependencies:
|
devDependencies:
|
||||||
cross-env: 7.0.3
|
cross-env: 7.0.3
|
||||||
cz-emoji: 1.3.2-canary.2
|
cz-emoji: 1.3.2-canary.2
|
||||||
husky: 8.0.3
|
husky: 8.0.3
|
||||||
turbo: 1.7.0
|
turbo: 1.7.4
|
||||||
|
|
||||||
apps/builder:
|
apps/builder:
|
||||||
specifiers:
|
specifiers:
|
||||||
@@ -40,6 +40,7 @@ importers:
|
|||||||
'@giphy/react-components': 6.5.2
|
'@giphy/react-components': 6.5.2
|
||||||
'@googleapis/drive': 4.0.1
|
'@googleapis/drive': 4.0.1
|
||||||
'@lezer/css': ^1.1.1
|
'@lezer/css': ^1.1.1
|
||||||
|
'@paralleldrive/cuid2': 2.0.1
|
||||||
'@playwright/test': 1.30.0
|
'@playwright/test': 1.30.0
|
||||||
'@sentry/nextjs': 7.36.0
|
'@sentry/nextjs': 7.36.0
|
||||||
'@stripe/stripe-js': 1.46.0
|
'@stripe/stripe-js': 1.46.0
|
||||||
@@ -76,7 +77,6 @@ importers:
|
|||||||
canvas-confetti: 1.6.0
|
canvas-confetti: 1.6.0
|
||||||
chakra-react-select: ^4.4.3
|
chakra-react-select: ^4.4.3
|
||||||
codemirror: 6.0.1
|
codemirror: 6.0.1
|
||||||
cuid: 3.0.0
|
|
||||||
db: workspace:*
|
db: workspace:*
|
||||||
deep-object-diff: 1.1.9
|
deep-object-diff: 1.1.9
|
||||||
dequal: 2.0.3
|
dequal: 2.0.3
|
||||||
@@ -149,6 +149,7 @@ importers:
|
|||||||
'@giphy/react-components': 6.5.2_57czaiyk6rdr5iy5tfs5pior4u
|
'@giphy/react-components': 6.5.2_57czaiyk6rdr5iy5tfs5pior4u
|
||||||
'@googleapis/drive': 4.0.1
|
'@googleapis/drive': 4.0.1
|
||||||
'@lezer/css': 1.1.1
|
'@lezer/css': 1.1.1
|
||||||
|
'@paralleldrive/cuid2': 2.0.1
|
||||||
'@sentry/nextjs': 7.36.0_next@13.1.6+react@18.2.0
|
'@sentry/nextjs': 7.36.0_next@13.1.6+react@18.2.0
|
||||||
'@stripe/stripe-js': 1.46.0
|
'@stripe/stripe-js': 1.46.0
|
||||||
'@tanstack/react-query': 4.24.4_biqbaboplfbrettd7655fr4n2y
|
'@tanstack/react-query': 4.24.4_biqbaboplfbrettd7655fr4n2y
|
||||||
@@ -171,7 +172,6 @@ importers:
|
|||||||
canvas-confetti: 1.6.0
|
canvas-confetti: 1.6.0
|
||||||
chakra-react-select: 4.4.3_alpyulvd3cwjobv54jo7ctrw7u
|
chakra-react-select: 4.4.3_alpyulvd3cwjobv54jo7ctrw7u
|
||||||
codemirror: 6.0.1_@lezer+common@1.0.2
|
codemirror: 6.0.1_@lezer+common@1.0.2
|
||||||
cuid: 3.0.0
|
|
||||||
deep-object-diff: 1.1.9
|
deep-object-diff: 1.1.9
|
||||||
dequal: 2.0.3
|
dequal: 2.0.3
|
||||||
emails: link:../../packages/emails
|
emails: link:../../packages/emails
|
||||||
@@ -353,6 +353,7 @@ importers:
|
|||||||
specifiers:
|
specifiers:
|
||||||
'@babel/preset-env': 7.20.2
|
'@babel/preset-env': 7.20.2
|
||||||
'@faire/mjml-react': 3.1.0
|
'@faire/mjml-react': 3.1.0
|
||||||
|
'@paralleldrive/cuid2': 2.0.1
|
||||||
'@playwright/test': 1.30.0
|
'@playwright/test': 1.30.0
|
||||||
'@sentry/nextjs': 7.36.0
|
'@sentry/nextjs': 7.36.0
|
||||||
'@trpc/server': 10.9.0
|
'@trpc/server': 10.9.0
|
||||||
@@ -369,7 +370,6 @@ importers:
|
|||||||
aws-sdk: 2.1304.0
|
aws-sdk: 2.1304.0
|
||||||
bot-engine: workspace:*
|
bot-engine: workspace:*
|
||||||
cors: 2.8.5
|
cors: 2.8.5
|
||||||
cuid: 3.0.0
|
|
||||||
db: workspace:*
|
db: workspace:*
|
||||||
dotenv: 16.0.3
|
dotenv: 16.0.3
|
||||||
emails: workspace:*
|
emails: workspace:*
|
||||||
@@ -397,6 +397,7 @@ importers:
|
|||||||
utils: workspace:*
|
utils: workspace:*
|
||||||
zod: 3.20.2
|
zod: 3.20.2
|
||||||
dependencies:
|
dependencies:
|
||||||
|
'@paralleldrive/cuid2': 2.0.1
|
||||||
'@sentry/nextjs': 7.36.0_next@13.1.6+react@18.2.0
|
'@sentry/nextjs': 7.36.0_next@13.1.6+react@18.2.0
|
||||||
'@trpc/server': 10.9.0
|
'@trpc/server': 10.9.0
|
||||||
'@typebot.io/js': link:../../packages/js
|
'@typebot.io/js': link:../../packages/js
|
||||||
@@ -404,7 +405,6 @@ importers:
|
|||||||
aws-sdk: 2.1304.0
|
aws-sdk: 2.1304.0
|
||||||
bot-engine: link:../../packages/bot-engine
|
bot-engine: link:../../packages/bot-engine
|
||||||
cors: 2.8.5
|
cors: 2.8.5
|
||||||
cuid: 3.0.0
|
|
||||||
db: link:../../packages/db
|
db: link:../../packages/db
|
||||||
google-spreadsheet: 3.3.0
|
google-spreadsheet: 3.3.0
|
||||||
got: 12.5.3
|
got: 12.5.3
|
||||||
@@ -630,7 +630,7 @@ importers:
|
|||||||
|
|
||||||
packages/models:
|
packages/models:
|
||||||
specifiers:
|
specifiers:
|
||||||
cuid: 3.0.0
|
'@paralleldrive/cuid2': 2.0.1
|
||||||
db: workspace:*
|
db: workspace:*
|
||||||
next: 13.1.6
|
next: 13.1.6
|
||||||
tsconfig: workspace:*
|
tsconfig: workspace:*
|
||||||
@@ -639,7 +639,7 @@ importers:
|
|||||||
dependencies:
|
dependencies:
|
||||||
zod: 3.20.2
|
zod: 3.20.2
|
||||||
devDependencies:
|
devDependencies:
|
||||||
cuid: 3.0.0
|
'@paralleldrive/cuid2': 2.0.1
|
||||||
db: link:../db
|
db: link:../db
|
||||||
next: 13.1.6_biqbaboplfbrettd7655fr4n2y
|
next: 13.1.6_biqbaboplfbrettd7655fr4n2y
|
||||||
tsconfig: link:../tsconfig
|
tsconfig: link:../tsconfig
|
||||||
@@ -751,10 +751,10 @@ importers:
|
|||||||
|
|
||||||
packages/utils:
|
packages/utils:
|
||||||
specifiers:
|
specifiers:
|
||||||
|
'@paralleldrive/cuid2': 2.0.1
|
||||||
'@playwright/test': 1.30.0
|
'@playwright/test': 1.30.0
|
||||||
'@types/nodemailer': 6.4.7
|
'@types/nodemailer': 6.4.7
|
||||||
aws-sdk: 2.1304.0
|
aws-sdk: 2.1304.0
|
||||||
cuid: 3.0.0
|
|
||||||
db: workspace:*
|
db: workspace:*
|
||||||
dotenv: 16.0.3
|
dotenv: 16.0.3
|
||||||
models: workspace:*
|
models: workspace:*
|
||||||
@@ -763,10 +763,10 @@ importers:
|
|||||||
tsconfig: workspace:*
|
tsconfig: workspace:*
|
||||||
typescript: 4.9.4
|
typescript: 4.9.4
|
||||||
devDependencies:
|
devDependencies:
|
||||||
|
'@paralleldrive/cuid2': 2.0.1
|
||||||
'@playwright/test': 1.30.0
|
'@playwright/test': 1.30.0
|
||||||
'@types/nodemailer': 6.4.7
|
'@types/nodemailer': 6.4.7
|
||||||
aws-sdk: 2.1304.0
|
aws-sdk: 2.1304.0
|
||||||
cuid: 3.0.0
|
|
||||||
db: link:../db
|
db: link:../db
|
||||||
dotenv: 16.0.3
|
dotenv: 16.0.3
|
||||||
models: link:../models
|
models: link:../models
|
||||||
@@ -6034,6 +6034,9 @@ packages:
|
|||||||
requiresBuild: true
|
requiresBuild: true
|
||||||
optional: true
|
optional: true
|
||||||
|
|
||||||
|
/@noble/hashes/1.2.0:
|
||||||
|
resolution: {integrity: sha512-FZfhjEDbT5GRswV3C6uvLPHMiVD6lQBmpoX5+eSiPaMTXte/IKqI5dykDxzZB/WBeK/CDuQRBWarPdi3FNY2zQ==}
|
||||||
|
|
||||||
/@nodelib/fs.scandir/2.1.5:
|
/@nodelib/fs.scandir/2.1.5:
|
||||||
resolution: {integrity: sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==}
|
resolution: {integrity: sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==}
|
||||||
engines: {node: '>= 8'}
|
engines: {node: '>= 8'}
|
||||||
@@ -6056,6 +6059,11 @@ packages:
|
|||||||
resolution: {integrity: sha512-MSAs9t3Go7GUkMhpKC44T58DJ5KGk2vBo+h1cqQeqlMfdGkxaVB78ZWpv9gYi/g2fa4sopag9gJsNvS8XGgWJA==}
|
resolution: {integrity: sha512-MSAs9t3Go7GUkMhpKC44T58DJ5KGk2vBo+h1cqQeqlMfdGkxaVB78ZWpv9gYi/g2fa4sopag9gJsNvS8XGgWJA==}
|
||||||
dev: false
|
dev: false
|
||||||
|
|
||||||
|
/@paralleldrive/cuid2/2.0.1:
|
||||||
|
resolution: {integrity: sha512-fi9nN5kCPGv9pcKQjk9g3riSTVcwR5TCFAGPUStbR61b1nXZ07GvxeoyStELKsJDCji1lwuUiUwLtagNTBllQA==}
|
||||||
|
dependencies:
|
||||||
|
'@noble/hashes': 1.2.0
|
||||||
|
|
||||||
/@pkgr/utils/2.3.1:
|
/@pkgr/utils/2.3.1:
|
||||||
resolution: {integrity: sha512-wfzX8kc1PMyUILA+1Z/EqoE4UCXGy0iRGMhPwdfae1+f0OXlLqCk+By+aMzgJBzR9AzS4CDizioG6Ss1gvAFJw==}
|
resolution: {integrity: sha512-wfzX8kc1PMyUILA+1Z/EqoE4UCXGy0iRGMhPwdfae1+f0OXlLqCk+By+aMzgJBzR9AzS4CDizioG6Ss1gvAFJw==}
|
||||||
engines: {node: ^12.20.0 || ^14.18.0 || >=16.0.0}
|
engines: {node: ^12.20.0 || ^14.18.0 || >=16.0.0}
|
||||||
@@ -10129,10 +10137,6 @@ packages:
|
|||||||
/csstype/3.1.1:
|
/csstype/3.1.1:
|
||||||
resolution: {integrity: sha512-DJR/VvkAvSZW9bTouZue2sSxDwdTN92uHjqeKVm+0dAqdfNykRzQ95tay8aXMBAAPpUiq4Qcug2L7neoRh2Egw==}
|
resolution: {integrity: sha512-DJR/VvkAvSZW9bTouZue2sSxDwdTN92uHjqeKVm+0dAqdfNykRzQ95tay8aXMBAAPpUiq4Qcug2L7neoRh2Egw==}
|
||||||
|
|
||||||
/cuid/3.0.0:
|
|
||||||
resolution: {integrity: sha512-WZYYkHdIDnaxdeP8Misq3Lah5vFjJwGuItJuV+tvMafosMzw0nF297T7mrm8IOWiPJkV6gc7sa8pzx27+w25Zg==}
|
|
||||||
deprecated: Cuid and other k-sortable and non-cryptographic ids (Ulid, ObjectId, KSUID, all UUIDs) are all insecure. Use @paralleldrive/cuid2 instead.
|
|
||||||
|
|
||||||
/cz-emoji/1.3.2-canary.2:
|
/cz-emoji/1.3.2-canary.2:
|
||||||
resolution: {integrity: sha512-XVH9N3P5sepyCRZGVqXJcEkVHT9dPcgBipTmZgkeQUhOJEtaGy0hakMcNdaq1d7N0ZwWVEnsCIs2m/NgLT+SaA==}
|
resolution: {integrity: sha512-XVH9N3P5sepyCRZGVqXJcEkVHT9dPcgBipTmZgkeQUhOJEtaGy0hakMcNdaq1d7N0ZwWVEnsCIs2m/NgLT+SaA==}
|
||||||
engines: {node: '>=4'}
|
engines: {node: '>=4'}
|
||||||
@@ -19448,65 +19452,65 @@ packages:
|
|||||||
fsevents: 2.3.2
|
fsevents: 2.3.2
|
||||||
dev: true
|
dev: true
|
||||||
|
|
||||||
/turbo-darwin-64/1.7.0:
|
/turbo-darwin-64/1.7.4:
|
||||||
resolution: {integrity: sha512-hSGAueSf5Ko8J67mpqjpt9FsP6ePn1nMcl7IVPoJq5dHsgX3anCP/BPlexJ502bNK+87DDyhQhJ/LPSJXKrSYQ==}
|
resolution: {integrity: sha512-ZyYrQlUl8K/mYN1e6R7bEhPPYjMakz0DYMaexkyD7TAijQtWmTSd4a+I7VknOYNEssnUZ/v41GU3gPV1JAzxxQ==}
|
||||||
cpu: [x64]
|
cpu: [x64]
|
||||||
os: [darwin]
|
os: [darwin]
|
||||||
requiresBuild: true
|
requiresBuild: true
|
||||||
dev: true
|
dev: true
|
||||||
optional: true
|
optional: true
|
||||||
|
|
||||||
/turbo-darwin-arm64/1.7.0:
|
/turbo-darwin-arm64/1.7.4:
|
||||||
resolution: {integrity: sha512-BLLOW5W6VZxk5+0ZOj5AO1qjM0P5isIgjbEuyAl8lHZ4s9antUbY4CtFrspT32XxPTYoDl4UjviPMcSsbcl3WQ==}
|
resolution: {integrity: sha512-CKIXg9uqp1a+Yeq/c4U0alPOqvwLUq5SBZf1PGYhGqJsfG0fRBtJfkUjHuBsuJIOGXg8rCmcGSWGIsIF6fqYuw==}
|
||||||
cpu: [arm64]
|
cpu: [arm64]
|
||||||
os: [darwin]
|
os: [darwin]
|
||||||
requiresBuild: true
|
requiresBuild: true
|
||||||
dev: true
|
dev: true
|
||||||
optional: true
|
optional: true
|
||||||
|
|
||||||
/turbo-linux-64/1.7.0:
|
/turbo-linux-64/1.7.4:
|
||||||
resolution: {integrity: sha512-aw2qxmfZa+kT87SB3GNUoFimqEPzTlzlRqhPgHuAAT6Uf0JHnmebPt4K+ZPtDNl5yfVmtB05bhHPqw+5QV97Yg==}
|
resolution: {integrity: sha512-RIUl4RUFFyzD2T024vL7509Ygwcw+SEa8NOwPfaN6TtJHK7RZV/SBP3fLNVOptG9WRLnOWX3OvsLMbiOqDLLyA==}
|
||||||
cpu: [x64]
|
cpu: [x64]
|
||||||
os: [linux]
|
os: [linux]
|
||||||
requiresBuild: true
|
requiresBuild: true
|
||||||
dev: true
|
dev: true
|
||||||
optional: true
|
optional: true
|
||||||
|
|
||||||
/turbo-linux-arm64/1.7.0:
|
/turbo-linux-arm64/1.7.4:
|
||||||
resolution: {integrity: sha512-AJEx2jX+zO5fQtJpO3r6uhTabj4oSA5ZhB7zTs/rwu/XqoydsvStA4X8NDW4poTbOjF7DcSHizqwi04tSMzpJw==}
|
resolution: {integrity: sha512-Bg65F0AjYYYxqE6RPf2H5TIGuA/EyWMeGOATHVSZOWAbYcnG3Ly03GZii8AHnUi7ntWBdjwvXf/QbOS1ayNB6A==}
|
||||||
cpu: [arm64]
|
cpu: [arm64]
|
||||||
os: [linux]
|
os: [linux]
|
||||||
requiresBuild: true
|
requiresBuild: true
|
||||||
dev: true
|
dev: true
|
||||||
optional: true
|
optional: true
|
||||||
|
|
||||||
/turbo-windows-64/1.7.0:
|
/turbo-windows-64/1.7.4:
|
||||||
resolution: {integrity: sha512-ewj7PPv2uxqv0r31hgnBa3E5qwUu7eyVRP5M1gB/TJXfSHduU79gbxpKCyxIZv2fL/N2/3U7EPOQPSZxBAoljA==}
|
resolution: {integrity: sha512-rTaV50XZ2BRxRHOHqt1UsWfeDmYLbn8UKE6g2D2ED+uW+kmnTvR9s01nmlGWd2sAuWcRYQyQ2V+O09VfKPKcQw==}
|
||||||
cpu: [x64]
|
cpu: [x64]
|
||||||
os: [win32]
|
os: [win32]
|
||||||
requiresBuild: true
|
requiresBuild: true
|
||||||
dev: true
|
dev: true
|
||||||
optional: true
|
optional: true
|
||||||
|
|
||||||
/turbo-windows-arm64/1.7.0:
|
/turbo-windows-arm64/1.7.4:
|
||||||
resolution: {integrity: sha512-LzjOUzveWkvTD0jP8DBMYiAnYemmydsvqxdSmsUapHHJkl6wKZIOQNSO7pxsy+9XM/1/+0f9Y9F9ZNl5lePTEA==}
|
resolution: {integrity: sha512-h8sxdKPvHTnWUPtwnYszFMmSO0P/iUUwmYY9n7iYThA71zSao28UeZ0H0Gw75cY3MPjvkjn2C4EBAUGPjuZJLw==}
|
||||||
cpu: [arm64]
|
cpu: [arm64]
|
||||||
os: [win32]
|
os: [win32]
|
||||||
requiresBuild: true
|
requiresBuild: true
|
||||||
dev: true
|
dev: true
|
||||||
optional: true
|
optional: true
|
||||||
|
|
||||||
/turbo/1.7.0:
|
/turbo/1.7.4:
|
||||||
resolution: {integrity: sha512-cwympNwQNnQZ/TffBd8yT0i0O10Cf/hlxccCYgUcwhcGEb9rDjE5thDbHoHw1hlJQUF/5ua7ERJe7Zr0lNE/ww==}
|
resolution: {integrity: sha512-8RLedDoUL0kkVKWEZ/RMM70BvKLyDFen06QuKKhYC2XNOfNKqFDqzIdcY/vGick869bNIWalChoy4O07k0HLsA==}
|
||||||
hasBin: true
|
hasBin: true
|
||||||
requiresBuild: true
|
requiresBuild: true
|
||||||
optionalDependencies:
|
optionalDependencies:
|
||||||
turbo-darwin-64: 1.7.0
|
turbo-darwin-64: 1.7.4
|
||||||
turbo-darwin-arm64: 1.7.0
|
turbo-darwin-arm64: 1.7.4
|
||||||
turbo-linux-64: 1.7.0
|
turbo-linux-64: 1.7.4
|
||||||
turbo-linux-arm64: 1.7.0
|
turbo-linux-arm64: 1.7.4
|
||||||
turbo-windows-64: 1.7.0
|
turbo-windows-64: 1.7.4
|
||||||
turbo-windows-arm64: 1.7.0
|
turbo-windows-arm64: 1.7.4
|
||||||
dev: true
|
dev: true
|
||||||
|
|
||||||
/type-check/0.3.2:
|
/type-check/0.3.2:
|
||||||
|
|||||||
Reference in New Issue
Block a user