♻️ Re-organize workspace folders

This commit is contained in:
Baptiste Arnaud
2023-03-15 08:35:16 +01:00
parent 25c367901f
commit cbc8194f19
987 changed files with 2716 additions and 2770 deletions

View File

@@ -7,8 +7,8 @@ import {
useEffect,
useState,
} from 'react'
import { env, isDefined, isNotDefined } from 'utils'
import { User } from 'db'
import { env, isDefined, isNotDefined } from '@typebot.io/lib'
import { User } from '@typebot.io/prisma'
import { setUser as setSentryUser } from '@sentry/nextjs'
import { useToast } from '@/hooks/useToast'
import { updateUserQuery } from './queries/updateUserQuery'

View File

@@ -1,6 +1,6 @@
import { getTestAsset } from '@/test/utils/playwright'
import test, { expect } from '@playwright/test'
import { userId } from 'utils/playwright/databaseSetup'
import { userId } from '@typebot.io/lib/playwright/databaseSetup'
test.describe.configure({ mode: 'parallel' })

View File

@@ -17,9 +17,9 @@ import {
} from '@chakra-ui/react'
import { ConfirmModal } from '@/components/ConfirmModal'
import { useToast } from '@/hooks/useToast'
import { User } from 'db'
import { User } from '@typebot.io/prisma'
import React, { useState } from 'react'
import { byId, isDefined } from 'utils'
import { byId, isDefined } from '@typebot.io/lib'
import { CreateTokenModal } from './CreateTokenModal'
import { useApiTokens } from '../../../hooks/useApiTokens'
import { ApiTokenFromServer } from '../../../types'

View File

@@ -7,7 +7,7 @@ import {
VStack,
Text,
} from '@chakra-ui/react'
import { GraphNavigation } from 'db'
import { GraphNavigation } from '@typebot.io/prisma'
const graphNavigationData = [
{

View File

@@ -1,6 +1,6 @@
import { Stack, Heading, useColorMode } from '@chakra-ui/react'
import { useUser } from '@/features/account'
import { GraphNavigation } from 'db'
import { GraphNavigation } from '@typebot.io/prisma'
import React, { useEffect } from 'react'
import { GraphNavigationRadioGroup } from './GraphNavigationRadioGroup'
import { AppearanceRadioGroup } from './AppearanceRadioGroup'

View File

@@ -1,6 +1,6 @@
import { fetcher } from '@/utils/helpers'
import useSWR from 'swr'
import { env } from 'utils'
import { env } from '@typebot.io/lib'
import { ApiTokenFromServer } from '../types'
type ServerResponse = {

View File

@@ -1,4 +1,4 @@
import { sendRequest } from 'utils'
import { sendRequest } from '@typebot.io/lib'
import { ApiTokenFromServer } from '../types'
export const createApiTokenQuery = (

View File

@@ -1,5 +1,5 @@
import { ApiToken } from 'db'
import { sendRequest } from 'utils'
import { ApiToken } from '@typebot.io/prisma'
import { sendRequest } from '@typebot.io/lib'
export const deleteApiTokenQuery = ({
userId,

View File

@@ -1,5 +1,5 @@
import { User } from 'db'
import { sendRequest } from 'utils'
import { User } from '@typebot.io/prisma'
import { sendRequest } from '@typebot.io/lib'
export const updateUserQuery = async (id: string, user: User) =>
sendRequest({

View File

@@ -4,8 +4,8 @@ import { createId } from '@paralleldrive/cuid2'
import {
importTypebotInDatabase,
injectFakeResults,
} from 'utils/playwright/databaseActions'
import { starterWorkspaceId } from 'utils/playwright/databaseSetup'
} from '@typebot.io/lib/playwright/databaseActions'
import { starterWorkspaceId } from '@typebot.io/lib/playwright/databaseSetup'
test('analytics are not available for non-pro workspaces', async ({ page }) => {
const typebotId = createId()

View File

@@ -6,7 +6,7 @@ import {
} from '@chakra-ui/react'
import { useToast } from '@/hooks/useToast'
import { useTypebot } from '@/features/editor'
import { Stats } from 'models'
import { Stats } from '@typebot.io/schemas'
import React from 'react'
import { useAnswersCount } from '../hooks/useAnswersCount'
import {

View File

@@ -7,10 +7,10 @@ import {
StatNumber,
useColorModeValue,
} from '@chakra-ui/react'
import { Stats } from 'models'
import { Stats } from '@typebot.io/schemas'
import React from 'react'
const computeCompletionRate = (
const computeCompletionRate = (
totalCompleted: number,
totalStarts: number
): string => {

View File

@@ -1,4 +1,4 @@
import { Invitation, PrismaClient, WorkspaceRole } from 'db'
import { Invitation, PrismaClient, WorkspaceRole } from '@typebot.io/prisma'
export type InvitationWithWorkspaceId = Invitation & {
typebot: {

View File

@@ -1,6 +1,6 @@
import prisma from '@/lib/prisma'
import { setUser } from '@sentry/nextjs'
import { User } from 'db'
import { User } from '@typebot.io/prisma'
import { NextApiRequest } from 'next'
import { getSession } from 'next-auth/react'

View File

@@ -1,4 +1,4 @@
import { PrismaClient, WorkspaceInvitation } from 'db'
import { PrismaClient, WorkspaceInvitation } from '@typebot.io/prisma'
import { InvitationWithWorkspaceId } from './convertInvitationsToCollaborations'
export const getNewUserInvitations = async (

View File

@@ -1,4 +1,4 @@
import { PrismaClient, WorkspaceInvitation } from 'db'
import { PrismaClient, WorkspaceInvitation } from '@typebot.io/prisma'
export const joinWorkspaces = async (
p: PrismaClient,

View File

@@ -12,7 +12,7 @@ import { stringify } from 'qs'
import { BuiltInProviderType } from 'next-auth/providers'
import { GoogleLogo } from '@/components/GoogleLogo'
import { AzureAdLogo, FacebookLogo, GitlabLogo } from './logos'
import { omit } from 'utils'
import { omit } from '@typebot.io/lib'
type Props = {
providers:

View File

@@ -1,4 +1,4 @@
import { User } from 'db'
import { User } from '@typebot.io/prisma'
export const mockedUser: User = {
id: 'userId',

View File

@@ -1,7 +1,7 @@
import prisma from '@/lib/prisma'
import { authenticatedProcedure } from '@/utils/server/trpc'
import { TRPCError } from '@trpc/server'
import { Plan, WorkspaceRole } from 'db'
import { Plan, WorkspaceRole } from '@typebot.io/prisma'
import Stripe from 'stripe'
import { z } from 'zod'

View File

@@ -1,7 +1,7 @@
import prisma from '@/lib/prisma'
import { authenticatedProcedure } from '@/utils/server/trpc'
import { TRPCError } from '@trpc/server'
import { Plan, WorkspaceRole } from 'db'
import { Plan, WorkspaceRole } from '@typebot.io/prisma'
import Stripe from 'stripe'
import { z } from 'zod'
import { parseSubscriptionItems } from '../utils/parseSubscriptionItems'

View File

@@ -1,7 +1,7 @@
import prisma from '@/lib/prisma'
import { authenticatedProcedure } from '@/utils/server/trpc'
import { TRPCError } from '@trpc/server'
import { WorkspaceRole } from 'db'
import { WorkspaceRole } from '@typebot.io/prisma'
import Stripe from 'stripe'
import { z } from 'zod'

View File

@@ -1,10 +1,10 @@
import prisma from '@/lib/prisma'
import { authenticatedProcedure } from '@/utils/server/trpc'
import { TRPCError } from '@trpc/server'
import { WorkspaceRole } from 'db'
import { WorkspaceRole } from '@typebot.io/prisma'
import Stripe from 'stripe'
import { z } from 'zod'
import { subscriptionSchema } from 'models/features/billing/subscription'
import { subscriptionSchema } from '@typebot.io/schemas/features/billing/subscription'
export const getSubscription = authenticatedProcedure
.meta({

View File

@@ -1,11 +1,11 @@
import prisma from '@/lib/prisma'
import { authenticatedProcedure } from '@/utils/server/trpc'
import { TRPCError } from '@trpc/server'
import { WorkspaceRole } from 'db'
import { WorkspaceRole } from '@typebot.io/prisma'
import Stripe from 'stripe'
import { isDefined } from 'utils'
import { isDefined } from '@typebot.io/lib'
import { z } from 'zod'
import { invoiceSchema } from 'models/features/billing/invoice'
import { invoiceSchema } from '@typebot.io/schemas/features/billing/invoice'
export const listInvoices = authenticatedProcedure
.meta({

View File

@@ -1,11 +1,11 @@
import { sendTelemetryEvents } from 'utils/telemetry/sendTelemetryEvent'
import { sendTelemetryEvents } from '@typebot.io/lib/telemetry/sendTelemetryEvent'
import prisma from '@/lib/prisma'
import { authenticatedProcedure } from '@/utils/server/trpc'
import { TRPCError } from '@trpc/server'
import { Plan, WorkspaceRole } from 'db'
import { workspaceSchema } from 'models'
import { Plan, WorkspaceRole } from '@typebot.io/prisma'
import { workspaceSchema } from '@typebot.io/schemas'
import Stripe from 'stripe'
import { isDefined } from 'utils'
import { isDefined } from '@typebot.io/lib'
import { z } from 'zod'
export const updateSubscription = authenticatedProcedure

View File

@@ -1,4 +1,4 @@
import { Plan } from 'db'
import { Plan } from '@typebot.io/prisma'
export const parseSubscriptionItems = (
plan: Plan,

View File

@@ -4,13 +4,13 @@ import {
} from '@/test/utils/databaseActions'
import test, { expect } from '@playwright/test'
import { createId } from '@paralleldrive/cuid2'
import { Plan } from 'db'
import { Plan } from '@typebot.io/prisma'
import {
createTypebots,
createWorkspaces,
deleteWorkspaces,
injectFakeResults,
} from 'utils/playwright/databaseActions'
} from '@typebot.io/lib/playwright/databaseActions'
const usageWorkspaceId = createId()
const usageTypebotId = createId()

View File

@@ -1,6 +1,6 @@
import { HStack, Stack, Text } from '@chakra-ui/react'
import { useWorkspace } from '@/features/workspace'
import { Plan } from 'db'
import { Plan } from '@typebot.io/prisma'
import React from 'react'
import { CurrentSubscriptionContent } from './CurrentSubscriptionContent'
import { InvoicesList } from './InvoicesList'

View File

@@ -1,11 +1,11 @@
import { Text, HStack, Link, Spinner, Stack, Heading } from '@chakra-ui/react'
import { useToast } from '@/hooks/useToast'
import { Plan } from 'db'
import { Plan } from '@typebot.io/prisma'
import React from 'react'
import { PlanTag } from '../PlanTag'
import { BillingPortalButton } from './BillingPortalButton'
import { trpc } from '@/lib/trpc'
import { Workspace } from 'models'
import { Workspace } from '@typebot.io/schemas'
type CurrentSubscriptionContentProps = {
workspace: Pick<Workspace, 'id' | 'plan' | 'stripeId'>

View File

@@ -9,10 +9,10 @@ import {
Tooltip,
} from '@chakra-ui/react'
import { AlertIcon } from '@/components/icons'
import { Plan, Workspace } from 'db'
import { Plan, Workspace } from '@typebot.io/prisma'
import React from 'react'
import { parseNumberWithCommas } from 'utils'
import { getChatsLimit, getStorageLimit } from 'utils/pricing'
import { parseNumberWithCommas } from '@typebot.io/lib'
import { getChatsLimit, getStorageLimit } from '@typebot.io/lib/pricing'
import { storageToReadable } from './helpers'
import { trpc } from '@/lib/trpc'

View File

@@ -1,4 +1,4 @@
import { sendRequest } from 'utils'
import { sendRequest } from '@typebot.io/lib'
export const cancelSubscriptionQuery = (stripeId: string) =>
sendRequest({

View File

@@ -1,13 +1,13 @@
import { Stack, HStack, Text } from '@chakra-ui/react'
import { useUser } from '@/features/account'
import { Plan } from 'db'
import { Plan } from '@typebot.io/prisma'
import { ProPlanContent } from './ProPlanContent'
import { StarterPlanContent } from './StarterPlanContent'
import { TextLink } from '@/components/TextLink'
import { useToast } from '@/hooks/useToast'
import { trpc } from '@/lib/trpc'
import { guessIfUserIsEuropean } from 'utils/pricing'
import { Workspace } from 'models'
import { guessIfUserIsEuropean } from '@typebot.io/lib/pricing'
import { Workspace } from '@typebot.io/schemas'
import { PreCheckoutModal, PreCheckoutModalProps } from '../PreCheckoutModal'
import { useState } from 'react'
import { ParentModalProvider } from '@/features/graph/providers/ParentModalProvider'

View File

@@ -16,9 +16,9 @@ import {
} from '@chakra-ui/react'
import { ChevronLeftIcon } from '@/components/icons'
import { useWorkspace } from '@/features/workspace'
import { Plan } from 'db'
import { Plan } from '@typebot.io/prisma'
import { useEffect, useState } from 'react'
import { parseNumberWithCommas } from 'utils'
import { parseNumberWithCommas } from '@typebot.io/lib'
import {
chatsLimit,
computePrice,
@@ -26,7 +26,7 @@ import {
getChatsLimit,
getStorageLimit,
storageLimit,
} from 'utils/pricing'
} from '@typebot.io/lib/pricing'
import { FeaturesList } from './components/FeaturesList'
import { MoreInfoTooltip } from '@/components/MoreInfoTooltip'

View File

@@ -12,9 +12,9 @@ import {
} from '@chakra-ui/react'
import { ChevronLeftIcon } from '@/components/icons'
import { useWorkspace } from '@/features/workspace'
import { Plan } from 'db'
import { Plan } from '@typebot.io/prisma'
import { useEffect, useState } from 'react'
import { parseNumberWithCommas } from 'utils'
import { parseNumberWithCommas } from '@typebot.io/lib'
import {
chatsLimit,
computePrice,
@@ -22,7 +22,7 @@ import {
getChatsLimit,
getStorageLimit,
storageLimit,
} from 'utils/pricing'
} from '@typebot.io/lib/pricing'
import { FeaturesList } from './components/FeaturesList'
import { MoreInfoTooltip } from '@/components/MoreInfoTooltip'

View File

@@ -1,6 +1,6 @@
import { Tag, TagProps } from '@chakra-ui/react'
import { LockedIcon } from '@/components/icons'
import { Plan } from 'db'
import { Plan } from '@typebot.io/prisma'
import { planColorSchemes } from './PlanTag'
export const LockTag = ({ plan, ...props }: { plan?: Plan } & TagProps) => (

View File

@@ -1,5 +1,5 @@
import { Tag, TagProps, ThemeTypings } from '@chakra-ui/react'
import { Plan } from 'db'
import { Plan } from '@typebot.io/prisma'
export const planColorSchemes: Record<Plan, ThemeTypings['colorSchemes']> = {
[Plan.LIFETIME]: 'purple',

View File

@@ -16,7 +16,7 @@ import {
} from '@chakra-ui/react'
import { useRouter } from 'next/router'
import React, { FormEvent, useState } from 'react'
import { isDefined } from 'utils'
import { isDefined } from '@typebot.io/lib'
import { taxIdTypes } from '../taxIdTypes'
export type PreCheckoutModalProps = {

View File

@@ -1,7 +1,7 @@
import { Button, ButtonProps, useDisclosure } from '@chakra-ui/react'
import { useWorkspace } from '@/features/workspace'
import React from 'react'
import { isNotDefined } from 'utils'
import { isNotDefined } from '@typebot.io/lib'
import { ChangePlanModal } from './ChangePlanModal'
import { LimitReached } from './ChangePlanModal'

View File

@@ -1,5 +1,5 @@
import { Plan, Workspace } from 'db'
import { isDefined, isNotDefined } from 'utils'
import { Plan, Workspace } from '@typebot.io/prisma'
import { isDefined, isNotDefined } from '@typebot.io/lib'
export const planToReadable = (plan?: Plan) => {
if (!plan) return

View File

@@ -1,7 +1,7 @@
import test, { expect } from '@playwright/test'
import { createTypebots } from 'utils/playwright/databaseActions'
import { parseDefaultGroupWithBlock } from 'utils/playwright/databaseHelpers'
import { BubbleBlockType, defaultAudioBubbleContent } from 'models'
import { createTypebots } from '@typebot.io/lib/playwright/databaseActions'
import { parseDefaultGroupWithBlock } from '@typebot.io/lib/playwright/databaseHelpers'
import { BubbleBlockType, defaultAudioBubbleContent } from '@typebot.io/schemas'
import { createId } from '@paralleldrive/cuid2'
import { getTestAsset } from '@/test/utils/playwright'

View File

@@ -1,5 +1,5 @@
import { Button, Flex, HStack, Stack, Text } from '@chakra-ui/react'
import { AudioBubbleContent } from 'models'
import { AudioBubbleContent } from '@typebot.io/schemas'
import { TextInput } from '@/components/inputs'
import { useState } from 'react'
import { UploadButton } from '@/components/ImageUploadContent/UploadButton'

View File

@@ -1,6 +1,6 @@
import { Text } from '@chakra-ui/react'
import { AudioBubbleContent } from 'models'
import { isDefined } from 'utils'
import { AudioBubbleContent } from '@typebot.io/schemas'
import { isDefined } from '@typebot.io/lib'
type Props = {
url: AudioBubbleContent['url']

View File

@@ -1,5 +1,5 @@
import { Text } from '@chakra-ui/react'
import { EmbedBubbleBlock } from 'models'
import { EmbedBubbleBlock } from '@typebot.io/schemas'
export const EmbedBubbleContent = ({ block }: { block: EmbedBubbleBlock }) => {
if (!block.content?.url) return <Text color="gray.500">Click to edit...</Text>

View File

@@ -1,7 +1,7 @@
import { TextInput, NumberInput } from '@/components/inputs'
import { HStack, Stack, Text } from '@chakra-ui/react'
import { EmbedBubbleContent } from 'models'
import { sanitizeUrl } from 'utils'
import { EmbedBubbleContent } from '@typebot.io/schemas'
import { sanitizeUrl } from '@typebot.io/lib'
type Props = {
content: EmbedBubbleContent

View File

@@ -1,8 +1,8 @@
import test, { expect } from '@playwright/test'
import { BubbleBlockType, defaultEmbedBubbleContent } from 'models'
import { BubbleBlockType, defaultEmbedBubbleContent } from '@typebot.io/schemas'
import { createId } from '@paralleldrive/cuid2'
import { createTypebots } from 'utils/playwright/databaseActions'
import { parseDefaultGroupWithBlock } from 'utils/playwright/databaseHelpers'
import { createTypebots } from '@typebot.io/lib/playwright/databaseActions'
import { parseDefaultGroupWithBlock } from '@typebot.io/lib/playwright/databaseHelpers'
const pdfSrc = 'https://www.orimi.com/pdf-test.pdf'
const siteSrc = 'https://app.cal.com/baptistearno/15min'

View File

@@ -1,5 +1,5 @@
import { Box, Text, Image } from '@chakra-ui/react'
import { ImageBubbleBlock } from 'models'
import { ImageBubbleBlock } from '@typebot.io/schemas'
export const ImageBubbleContent = ({ block }: { block: ImageBubbleBlock }) => {
const containsVariables =

View File

@@ -1,7 +1,7 @@
import test, { expect } from '@playwright/test'
import { createTypebots } from 'utils/playwright/databaseActions'
import { parseDefaultGroupWithBlock } from 'utils/playwright/databaseHelpers'
import { BubbleBlockType, defaultImageBubbleContent } from 'models'
import { createTypebots } from '@typebot.io/lib/playwright/databaseActions'
import { parseDefaultGroupWithBlock } from '@typebot.io/lib/playwright/databaseHelpers'
import { BubbleBlockType, defaultImageBubbleContent } from '@typebot.io/schemas'
import { createId } from '@paralleldrive/cuid2'
import { getTestAsset } from '@/test/utils/playwright'

View File

@@ -1,9 +1,9 @@
import { Flex } from '@chakra-ui/react'
import { useTypebot } from '@/features/editor'
import { TextBubbleBlock } from 'models'
import { TextBubbleBlock } from '@typebot.io/schemas'
import React from 'react'
import { parseVariableHighlight } from '@/utils/helpers'
import { isEmpty } from 'utils'
import { isEmpty } from '@typebot.io/lib'
type Props = {
block: TextBubbleBlock

View File

@@ -9,7 +9,11 @@ import { Plate, PlateProvider, usePlateEditorRef } from '@udecode/plate-core'
import { editorStyle, platePlugins } from '@/lib/plate'
import { BaseEditor, BaseSelection, Transforms } from 'slate'
import { ToolBar } from './ToolBar'
import { defaultTextBubbleContent, TextBubbleContent, Variable } from 'models'
import {
defaultTextBubbleContent,
TextBubbleContent,
Variable,
} from '@typebot.io/schemas'
import { ReactEditor } from 'slate-react'
import { serializeHtml } from '@udecode/plate-serializer-html'
import { parseHtmlStringToPlainText } from '../../utils'

View File

@@ -1,7 +1,7 @@
import test, { expect } from '@playwright/test'
import { createTypebots } from 'utils/playwright/databaseActions'
import { parseDefaultGroupWithBlock } from 'utils/playwright/databaseHelpers'
import { BubbleBlockType, defaultTextBubbleContent } from 'models'
import { createTypebots } from '@typebot.io/lib/playwright/databaseActions'
import { parseDefaultGroupWithBlock } from '@typebot.io/lib/playwright/databaseHelpers'
import { BubbleBlockType, defaultTextBubbleContent } from '@typebot.io/schemas'
import { createId } from '@paralleldrive/cuid2'
test.describe('Text bubble block', () => {

View File

@@ -1,5 +1,5 @@
import { Parser } from 'htmlparser2'
import { isNotEmpty } from 'utils'
import { isNotEmpty } from '@typebot.io/lib'
export const parseHtmlStringToPlainText = (html: string): string => {
let plainText = ''

View File

@@ -1,5 +1,5 @@
import { Box, Text } from '@chakra-ui/react'
import { VideoBubbleBlock, VideoBubbleContentType } from 'models'
import { VideoBubbleBlock, VideoBubbleContentType } from '@typebot.io/schemas'
export const VideoBubbleContent = ({ block }: { block: VideoBubbleBlock }) => {
if (!block.content?.url || !block.content.type)

View File

@@ -1,9 +1,9 @@
import { Stack, Text } from '@chakra-ui/react'
import { VideoBubbleContent, VideoBubbleContentType } from 'models'
import { VideoBubbleContent, VideoBubbleContentType } from '@typebot.io/schemas'
import urlParser from 'js-video-url-parser/lib/base'
import 'js-video-url-parser/lib/provider/vimeo'
import 'js-video-url-parser/lib/provider/youtube'
import { isDefined } from 'utils'
import { isDefined } from '@typebot.io/lib'
import { TextInput } from '@/components/inputs'
type Props = {

View File

@@ -1,11 +1,11 @@
import test, { expect } from '@playwright/test'
import { createTypebots } from 'utils/playwright/databaseActions'
import { parseDefaultGroupWithBlock } from 'utils/playwright/databaseHelpers'
import { createTypebots } from '@typebot.io/lib/playwright/databaseActions'
import { parseDefaultGroupWithBlock } from '@typebot.io/lib/playwright/databaseHelpers'
import {
BubbleBlockType,
defaultVideoBubbleContent,
VideoBubbleContentType,
} from 'models'
} from '@typebot.io/schemas'
import { createId } from '@paralleldrive/cuid2'
const videoSrc =

View File

@@ -2,9 +2,13 @@ import test, { expect } from '@playwright/test'
import {
createTypebots,
importTypebotInDatabase,
} from 'utils/playwright/databaseActions'
import { parseDefaultGroupWithBlock } from 'utils/playwright/databaseHelpers'
import { defaultChoiceInputOptions, InputBlockType, ItemType } from 'models'
} from '@typebot.io/lib/playwright/databaseActions'
import { parseDefaultGroupWithBlock } from '@typebot.io/lib/playwright/databaseHelpers'
import {
defaultChoiceInputOptions,
InputBlockType,
ItemType,
} from '@typebot.io/schemas'
import { createId } from '@paralleldrive/cuid2'
import { getTestAsset } from '@/test/utils/playwright'

View File

@@ -1,4 +1,4 @@
import { BlockIndices, ChoiceInputBlock } from 'models'
import { BlockIndices, ChoiceInputBlock } from '@typebot.io/schemas'
import React from 'react'
import { ItemNodesList } from '@/features/graph/components/Nodes/ItemNode'
import { Stack, Tag, Text, Wrap } from '@chakra-ui/react'

View File

@@ -3,7 +3,7 @@ import { MoreInfoTooltip } from '@/components/MoreInfoTooltip'
import { SwitchWithLabel } from '@/components/inputs/SwitchWithLabel'
import { VariableSearchInput } from '@/components/inputs/VariableSearchInput'
import { FormControl, FormLabel, Stack } from '@chakra-ui/react'
import { ChoiceInputOptions, Variable } from 'models'
import { ChoiceInputOptions, Variable } from '@typebot.io/schemas'
import React from 'react'
type Props = {

View File

@@ -8,9 +8,9 @@ import {
} from '@chakra-ui/react'
import { PlusIcon } from '@/components/icons'
import { useTypebot } from '@/features/editor'
import { ButtonItem, ItemIndices, ItemType } from 'models'
import { ButtonItem, ItemIndices, ItemType } from '@typebot.io/schemas'
import React, { useRef, useState } from 'react'
import { isNotDefined } from 'utils'
import { isNotDefined } from '@typebot.io/lib'
type Props = {
item: ButtonItem

View File

@@ -2,7 +2,7 @@ import { TextInput } from '@/components/inputs'
import { SwitchWithLabel } from '@/components/inputs/SwitchWithLabel'
import { VariableSearchInput } from '@/components/inputs/VariableSearchInput'
import { FormLabel, Stack } from '@chakra-ui/react'
import { DateInputOptions, Variable } from 'models'
import { DateInputOptions, Variable } from '@typebot.io/schemas'
import React from 'react'
type DateInputSettingsBodyProps = {

View File

@@ -1,7 +1,7 @@
import test, { expect } from '@playwright/test'
import { createTypebots } from 'utils/playwright/databaseActions'
import { parseDefaultGroupWithBlock } from 'utils/playwright/databaseHelpers'
import { defaultDateInputOptions, InputBlockType } from 'models'
import { createTypebots } from '@typebot.io/lib/playwright/databaseActions'
import { parseDefaultGroupWithBlock } from '@typebot.io/lib/playwright/databaseHelpers'
import { defaultDateInputOptions, InputBlockType } from '@typebot.io/schemas'
import { createId } from '@paralleldrive/cuid2'
test.describe('Date input block', () => {

View File

@@ -1,6 +1,6 @@
import React from 'react'
import { Text } from '@chakra-ui/react'
import { EmailInputBlock } from 'models'
import { EmailInputBlock } from '@typebot.io/schemas'
import { WithVariableContent } from '@/features/graph/components/Nodes/BlockNode/BlockNodeContent/WithVariableContent'
type Props = {

View File

@@ -1,7 +1,7 @@
import { TextInput } from '@/components/inputs'
import { VariableSearchInput } from '@/components/inputs/VariableSearchInput'
import { FormLabel, Stack } from '@chakra-ui/react'
import { EmailInputOptions, Variable } from 'models'
import { EmailInputOptions, Variable } from '@typebot.io/schemas'
import React from 'react'
type EmailInputSettingsBodyProps = {

View File

@@ -1,7 +1,7 @@
import test, { expect } from '@playwright/test'
import { createTypebots } from 'utils/playwright/databaseActions'
import { parseDefaultGroupWithBlock } from 'utils/playwright/databaseHelpers'
import { defaultEmailInputOptions, InputBlockType } from 'models'
import { createTypebots } from '@typebot.io/lib/playwright/databaseActions'
import { parseDefaultGroupWithBlock } from '@typebot.io/lib/playwright/databaseHelpers'
import { defaultEmailInputOptions, InputBlockType } from '@typebot.io/schemas'
import { createId } from '@paralleldrive/cuid2'
test.describe('Email input block', () => {

View File

@@ -1,6 +1,6 @@
import { WithVariableContent } from '@/features/graph/components/Nodes/BlockNode/BlockNodeContent/WithVariableContent'
import { Text } from '@chakra-ui/react'
import { FileInputOptions } from 'models'
import { FileInputOptions } from '@typebot.io/schemas'
type Props = {
options: FileInputOptions

View File

@@ -1,6 +1,6 @@
import { FormLabel, HStack, Stack, Text } from '@chakra-ui/react'
import { CodeEditor } from '@/components/inputs/CodeEditor'
import { FileInputOptions, Variable } from 'models'
import { FileInputOptions, Variable } from '@typebot.io/schemas'
import React from 'react'
import { TextInput, NumberInput } from '@/components/inputs'
import { SwitchWithLabel } from '@/components/inputs/SwitchWithLabel'

View File

@@ -1,9 +1,9 @@
import test, { expect } from '@playwright/test'
import { createTypebots } from 'utils/playwright/databaseActions'
import { parseDefaultGroupWithBlock } from 'utils/playwright/databaseHelpers'
import { defaultFileInputOptions, InputBlockType } from 'models'
import { createTypebots } from '@typebot.io/lib/playwright/databaseActions'
import { parseDefaultGroupWithBlock } from '@typebot.io/lib/playwright/databaseHelpers'
import { defaultFileInputOptions, InputBlockType } from '@typebot.io/schemas'
import { createId } from '@paralleldrive/cuid2'
import { freeWorkspaceId } from 'utils/playwright/databaseSetup'
import { freeWorkspaceId } from '@typebot.io/lib/playwright/databaseSetup'
import { getTestAsset } from '@/test/utils/playwright'
test.describe.configure({ mode: 'parallel' })

View File

@@ -2,7 +2,7 @@ import { TextInput, NumberInput } from '@/components/inputs'
import { VariableSearchInput } from '@/components/inputs/VariableSearchInput'
import { removeUndefinedFields } from '@/utils/helpers'
import { FormLabel, Stack } from '@chakra-ui/react'
import { NumberInputOptions, Variable } from 'models'
import { NumberInputOptions, Variable } from '@typebot.io/schemas'
import React from 'react'
type NumberInputSettingsBodyProps = {

View File

@@ -1,6 +1,6 @@
import React from 'react'
import { Text } from '@chakra-ui/react'
import { NumberInputBlock } from 'models'
import { NumberInputBlock } from '@typebot.io/schemas'
import { WithVariableContent } from '@/features/graph/components/Nodes/BlockNode/BlockNodeContent/WithVariableContent'
type Props = {

View File

@@ -1,7 +1,7 @@
import test, { expect } from '@playwright/test'
import { createTypebots } from 'utils/playwright/databaseActions'
import { parseDefaultGroupWithBlock } from 'utils/playwright/databaseHelpers'
import { defaultNumberInputOptions, InputBlockType } from 'models'
import { createTypebots } from '@typebot.io/lib/playwright/databaseActions'
import { parseDefaultGroupWithBlock } from '@typebot.io/lib/playwright/databaseHelpers'
import { defaultNumberInputOptions, InputBlockType } from '@typebot.io/schemas'
import { createId } from '@paralleldrive/cuid2'
test.describe('Number input block', () => {

View File

@@ -1,5 +1,5 @@
import { Text } from '@chakra-ui/react'
import { PaymentInputBlock } from 'models'
import { PaymentInputBlock } from '@typebot.io/schemas'
type Props = {
block: PaymentInputBlock

View File

@@ -11,7 +11,7 @@ import {
AccordionPanel,
} from '@chakra-ui/react'
import { DropdownList } from '@/components/DropdownList'
import { PaymentInputOptions, PaymentProvider } from 'models'
import { PaymentInputOptions, PaymentProvider } from '@typebot.io/schemas'
import React, { ChangeEvent } from 'react'
import { currencies } from './currencies'
import { StripeConfigModal } from './StripeConfigModal'

View File

@@ -20,9 +20,9 @@ import { useToast } from '@/hooks/useToast'
import { TextInput } from '@/components/inputs'
import { MoreInfoTooltip } from '@/components/MoreInfoTooltip'
import { TextLink } from '@/components/TextLink'
import { StripeCredentials } from 'models'
import { StripeCredentials } from '@typebot.io/schemas'
import { trpc } from '@/lib/trpc'
import { isNotEmpty } from 'utils'
import { isNotEmpty } from '@typebot.io/lib'
type Props = {
isOpen: boolean

View File

@@ -1,7 +1,7 @@
import test, { expect } from '@playwright/test'
import { createTypebots } from 'utils/playwright/databaseActions'
import { parseDefaultGroupWithBlock } from 'utils/playwright/databaseHelpers'
import { defaultPaymentInputOptions, InputBlockType } from 'models'
import { createTypebots } from '@typebot.io/lib/playwright/databaseActions'
import { parseDefaultGroupWithBlock } from '@typebot.io/lib/playwright/databaseHelpers'
import { defaultPaymentInputOptions, InputBlockType } from '@typebot.io/schemas'
import { createId } from '@paralleldrive/cuid2'
import { stripePaymentForm } from '@/test/utils/selectorUtils'

View File

@@ -1,6 +1,6 @@
import React from 'react'
import { Text } from '@chakra-ui/react'
import { PhoneNumberInputOptions } from 'models'
import { PhoneNumberInputOptions } from '@typebot.io/schemas'
import { WithVariableContent } from '@/features/graph/components/Nodes/BlockNode/BlockNodeContent/WithVariableContent'
type Props = {

View File

@@ -1,7 +1,7 @@
import { TextInput } from '@/components/inputs'
import { VariableSearchInput } from '@/components/inputs/VariableSearchInput'
import { FormLabel, Stack } from '@chakra-ui/react'
import { PhoneNumberInputOptions, Variable } from 'models'
import { PhoneNumberInputOptions, Variable } from '@typebot.io/schemas'
import React from 'react'
import { CountryCodeSelect } from './CountryCodeSelect'

View File

@@ -1,7 +1,7 @@
import test, { expect } from '@playwright/test'
import { createTypebots } from 'utils/playwright/databaseActions'
import { parseDefaultGroupWithBlock } from 'utils/playwright/databaseHelpers'
import { defaultPhoneInputOptions, InputBlockType } from 'models'
import { createTypebots } from '@typebot.io/lib/playwright/databaseActions'
import { parseDefaultGroupWithBlock } from '@typebot.io/lib/playwright/databaseHelpers'
import { defaultPhoneInputOptions, InputBlockType } from '@typebot.io/schemas'
import { createId } from '@paralleldrive/cuid2'
test.describe('Phone input block', () => {

View File

@@ -1,6 +1,6 @@
import { WithVariableContent } from '@/features/graph/components/Nodes/BlockNode/BlockNodeContent/WithVariableContent'
import { Text } from '@chakra-ui/react'
import { RatingInputBlock } from 'models'
import { RatingInputBlock } from '@typebot.io/schemas'
type Props = {
variableId?: string

View File

@@ -1,6 +1,6 @@
import { FormLabel, Stack } from '@chakra-ui/react'
import { DropdownList } from '@/components/DropdownList'
import { RatingInputOptions, Variable } from 'models'
import { RatingInputOptions, Variable } from '@typebot.io/schemas'
import React from 'react'
import { SwitchWithLabel } from '@/components/inputs/SwitchWithLabel'
import { TextInput } from '@/components/inputs'

View File

@@ -1,7 +1,7 @@
import test, { expect } from '@playwright/test'
import { createTypebots } from 'utils/playwright/databaseActions'
import { parseDefaultGroupWithBlock } from 'utils/playwright/databaseHelpers'
import { defaultRatingInputOptions, InputBlockType } from 'models'
import { createTypebots } from '@typebot.io/lib/playwright/databaseActions'
import { parseDefaultGroupWithBlock } from '@typebot.io/lib/playwright/databaseHelpers'
import { defaultRatingInputOptions, InputBlockType } from '@typebot.io/schemas'
import { createId } from '@paralleldrive/cuid2'
const boxSvg = `<svg

View File

@@ -1,6 +1,6 @@
import React from 'react'
import { Text } from '@chakra-ui/react'
import { TextInputOptions } from 'models'
import { TextInputOptions } from '@typebot.io/schemas'
import { WithVariableContent } from '@/features/graph/components/Nodes/BlockNode/BlockNodeContent/WithVariableContent'
type Props = {

View File

@@ -2,7 +2,7 @@ import { TextInput } from '@/components/inputs'
import { SwitchWithLabel } from '@/components/inputs/SwitchWithLabel'
import { VariableSearchInput } from '@/components/inputs/VariableSearchInput'
import { FormLabel, Stack } from '@chakra-ui/react'
import { TextInputOptions, Variable } from 'models'
import { TextInputOptions, Variable } from '@typebot.io/schemas'
import React from 'react'
type TextInputSettingsBodyProps = {

View File

@@ -1,7 +1,7 @@
import test, { expect } from '@playwright/test'
import { createTypebots } from 'utils/playwright/databaseActions'
import { parseDefaultGroupWithBlock } from 'utils/playwright/databaseHelpers'
import { defaultTextInputOptions, InputBlockType } from 'models'
import { createTypebots } from '@typebot.io/lib/playwright/databaseActions'
import { parseDefaultGroupWithBlock } from '@typebot.io/lib/playwright/databaseHelpers'
import { defaultTextInputOptions, InputBlockType } from '@typebot.io/schemas'
import { createId } from '@paralleldrive/cuid2'
test.describe.parallel('Text input block', () => {

View File

@@ -1,7 +1,7 @@
import { TextInput } from '@/components/inputs'
import { VariableSearchInput } from '@/components/inputs/VariableSearchInput'
import { FormLabel, Stack } from '@chakra-ui/react'
import { UrlInputOptions, Variable } from 'models'
import { UrlInputOptions, Variable } from '@typebot.io/schemas'
import React from 'react'
type UrlInputSettingsBodyProps = {

View File

@@ -1,6 +1,6 @@
import React from 'react'
import { Text } from '@chakra-ui/react'
import { UrlInputOptions } from 'models'
import { UrlInputOptions } from '@typebot.io/schemas'
import { WithVariableContent } from '@/features/graph/components/Nodes/BlockNode/BlockNodeContent/WithVariableContent'
type Props = {

View File

@@ -1,7 +1,7 @@
import test, { expect } from '@playwright/test'
import { createTypebots } from 'utils/playwright/databaseActions'
import { parseDefaultGroupWithBlock } from 'utils/playwright/databaseHelpers'
import { defaultUrlInputOptions, InputBlockType } from 'models'
import { createTypebots } from '@typebot.io/lib/playwright/databaseActions'
import { parseDefaultGroupWithBlock } from '@typebot.io/lib/playwright/databaseHelpers'
import { defaultUrlInputOptions, InputBlockType } from '@typebot.io/schemas'
import { createId } from '@paralleldrive/cuid2'
test.describe('Url input block', () => {

View File

@@ -1,8 +1,11 @@
import test, { expect } from '@playwright/test'
import { createTypebots } from 'utils/playwright/databaseActions'
import { parseDefaultGroupWithBlock } from 'utils/playwright/databaseHelpers'
import { createTypebots } from '@typebot.io/lib/playwright/databaseActions'
import { parseDefaultGroupWithBlock } from '@typebot.io/lib/playwright/databaseHelpers'
import { createId } from '@paralleldrive/cuid2'
import { defaultChatwootOptions, IntegrationBlockType } from 'models'
import {
defaultChatwootOptions,
IntegrationBlockType,
} from '@typebot.io/schemas'
const typebotId = createId()

View File

@@ -1,5 +1,5 @@
import { Text } from '@chakra-ui/react'
import { ChatwootBlock } from 'models'
import { ChatwootBlock } from '@typebot.io/schemas'
type Props = {
block: ChatwootBlock

View File

@@ -8,7 +8,7 @@ import {
AccordionPanel,
Stack,
} from '@chakra-ui/react'
import { ChatwootOptions, chatwootTasks } from 'models'
import { ChatwootOptions, chatwootTasks } from '@typebot.io/schemas'
import React from 'react'
type Props = {

View File

@@ -1,6 +1,6 @@
import React from 'react'
import { Text } from '@chakra-ui/react'
import { GoogleAnalyticsOptions } from 'models'
import { GoogleAnalyticsOptions } from '@typebot.io/schemas'
type Props = {
action: GoogleAnalyticsOptions['action']

View File

@@ -10,7 +10,7 @@ import {
Stack,
Tag,
} from '@chakra-ui/react'
import { GoogleAnalyticsOptions } from 'models'
import { GoogleAnalyticsOptions } from '@typebot.io/schemas'
import React from 'react'
type Props = {

View File

@@ -1,7 +1,10 @@
import test from '@playwright/test'
import { createTypebots } from 'utils/playwright/databaseActions'
import { parseDefaultGroupWithBlock } from 'utils/playwright/databaseHelpers'
import { defaultGoogleAnalyticsOptions, IntegrationBlockType } from 'models'
import { createTypebots } from '@typebot.io/lib/playwright/databaseActions'
import { parseDefaultGroupWithBlock } from '@typebot.io/lib/playwright/databaseHelpers'
import {
defaultGoogleAnalyticsOptions,
IntegrationBlockType,
} from '@typebot.io/schemas'
import { createId } from '@paralleldrive/cuid2'
test.describe('Google Analytics block', () => {

View File

@@ -1,6 +1,6 @@
import React from 'react'
import { Text } from '@chakra-ui/react'
import { GoogleSheetsAction } from 'models'
import { GoogleSheetsAction } from '@typebot.io/schemas'
type Props = {
action?: GoogleSheetsAction

View File

@@ -1,6 +1,6 @@
import { Stack } from '@chakra-ui/react'
import { DropdownList } from '@/components/DropdownList'
import { Cell } from 'models'
import { Cell } from '@typebot.io/schemas'
import { TableListItemProps } from '@/components/TableList'
import { TextInput } from '@/components/inputs'

View File

@@ -1,6 +1,6 @@
import { Stack } from '@chakra-ui/react'
import { DropdownList } from '@/components/DropdownList'
import { ExtractingCell, Variable } from 'models'
import { ExtractingCell, Variable } from '@typebot.io/schemas'
import { TableListItemProps } from '@/components/TableList'
import { VariableSearchInput } from '@/components/inputs/VariableSearchInput'

View File

@@ -12,9 +12,9 @@ import {
GoogleSheetsInsertRowOptions,
GoogleSheetsOptions,
GoogleSheetsUpdateRowOptions,
} from 'models'
} from '@typebot.io/schemas'
import React, { useMemo } from 'react'
import { isDefined } from 'utils'
import { isDefined } from '@typebot.io/lib'
import { SheetsDropdown } from './SheetsDropdown'
import { SpreadsheetsDropdown } from './SpreadsheetDropdown'
import { CellWithValueStack } from './CellWithValueStack'

View File

@@ -2,7 +2,7 @@ import { DropdownList } from '@/components/DropdownList'
import { TextInput } from '@/components/inputs'
import { TableListItemProps } from '@/components/TableList'
import { Stack } from '@chakra-ui/react'
import { ComparisonOperators, RowsFilterComparison } from 'models'
import { ComparisonOperators, RowsFilterComparison } from '@typebot.io/schemas'
import React from 'react'
export const RowsFilterComparisonItem = ({

View File

@@ -5,7 +5,7 @@ import {
GoogleSheetsGetOptions,
LogicalOperator,
RowsFilterComparison,
} from 'models'
} from '@typebot.io/schemas'
import React, { useCallback } from 'react'
import { RowsFilterComparisonItem } from './RowsFilterComparisonItem'

View File

@@ -1,5 +1,5 @@
import test, { expect, Page } from '@playwright/test'
import { importTypebotInDatabase } from 'utils/playwright/databaseActions'
import { importTypebotInDatabase } from '@typebot.io/lib/playwright/databaseActions'
import { createId } from '@paralleldrive/cuid2'
import { getTestAsset } from '@/test/utils/playwright'

View File

@@ -1,5 +1,5 @@
import { stringify } from 'qs'
import { sendRequest } from 'utils'
import { sendRequest } from '@typebot.io/lib'
export const createSheetsCredentialQuery = async (code: string) => {
const queryParams = stringify({ code })

View File

@@ -1,7 +1,7 @@
import { Text } from '@chakra-ui/react'
import { useTypebot } from '@/features/editor'
import { MakeComBlock } from 'models'
import { byId, isNotDefined } from 'utils'
import { MakeComBlock } from '@typebot.io/schemas'
import { byId, isNotDefined } from '@typebot.io/lib'
type Props = {
block: MakeComBlock

View File

@@ -1,9 +1,9 @@
import { Alert, AlertIcon, Button, Link, Stack, Text } from '@chakra-ui/react'
import { ExternalLinkIcon } from '@/components/icons'
import { useTypebot } from '@/features/editor'
import { MakeComBlock, Webhook, WebhookOptions } from 'models'
import { MakeComBlock, Webhook, WebhookOptions } from '@typebot.io/schemas'
import React, { useCallback, useEffect, useState } from 'react'
import { byId } from 'utils'
import { byId } from '@typebot.io/lib'
import { WebhookAdvancedConfigForm } from '../../webhook/components/WebhookAdvancedConfigForm'
type Props = {

Some files were not shown because too many files have changed in this diff Show More