♻️ Export bot-engine code into its own package
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import { authenticatedProcedure } from '@/helpers/server/trpc'
|
||||
import { z } from 'zod'
|
||||
import prisma from '@/lib/prisma'
|
||||
import prisma from '@typebot.io/lib/prisma'
|
||||
import { createId } from '@paralleldrive/cuid2'
|
||||
|
||||
export const generateVerificationToken = authenticatedProcedure
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { authenticatedProcedure } from '@/helpers/server/trpc'
|
||||
import { z } from 'zod'
|
||||
import got from 'got'
|
||||
import prisma from '@/lib/prisma'
|
||||
import prisma from '@typebot.io/lib/prisma'
|
||||
import { decrypt } from '@typebot.io/lib/api'
|
||||
import { TRPCError } from '@trpc/server'
|
||||
import { WhatsAppCredentials } from '@typebot.io/schemas/features/whatsapp'
|
||||
|
||||
@@ -3,7 +3,7 @@ import { z } from 'zod'
|
||||
import got from 'got'
|
||||
import { TRPCError } from '@trpc/server'
|
||||
import { WhatsAppCredentials } from '@typebot.io/schemas/features/whatsapp'
|
||||
import prisma from '@/lib/prisma'
|
||||
import prisma from '@typebot.io/lib/prisma'
|
||||
import { decrypt } from '@typebot.io/lib/api/encryption'
|
||||
|
||||
const inputSchema = z.object({
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { publicProcedure } from '@/helpers/server/trpc'
|
||||
import { whatsAppWebhookRequestBodySchema } from '@typebot.io/schemas/features/whatsapp'
|
||||
import { z } from 'zod'
|
||||
import { resumeWhatsAppFlow } from '@typebot.io/viewer/src/features/whatsApp/helpers/resumeWhatsAppFlow'
|
||||
import { resumeWhatsAppFlow } from '@typebot.io/bot-engine/whatsapp/resumeWhatsAppFlow'
|
||||
import { isNotDefined } from '@typebot.io/lib'
|
||||
import { TRPCError } from '@trpc/server'
|
||||
import { env } from '@typebot.io/env'
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
import { authenticatedProcedure } from '@/helpers/server/trpc'
|
||||
import { z } from 'zod'
|
||||
import { TRPCError } from '@trpc/server'
|
||||
import { sendWhatsAppMessage } from '@typebot.io/lib/whatsApp/sendWhatsAppMessage'
|
||||
import { startSession } from '@typebot.io/viewer/src/features/chat/helpers/startSession'
|
||||
import { startSession } from '@typebot.io/bot-engine/startSession'
|
||||
import { env } from '@typebot.io/env'
|
||||
import { HTTPError } from 'got'
|
||||
import prisma from '@/lib/prisma'
|
||||
import { sendChatReplyToWhatsApp } from '@typebot.io/lib/whatsApp/sendChatReplyToWhatsApp'
|
||||
import { saveStateToDatabase } from '@typebot.io/viewer/src/features/chat/helpers/saveStateToDatabase'
|
||||
import { restartSession } from '@typebot.io/viewer/src/features/chat/queries/restartSession'
|
||||
import prisma from '@typebot.io/lib/prisma'
|
||||
import { saveStateToDatabase } from '@typebot.io/bot-engine/saveStateToDatabase'
|
||||
import { restartSession } from '@typebot.io/bot-engine/queries/restartSession'
|
||||
import { sendChatReplyToWhatsApp } from '@typebot.io/bot-engine/whatsapp/sendChatReplyToWhatsApp'
|
||||
import { sendWhatsAppMessage } from '@typebot.io/bot-engine/whatsapp/sendWhatsAppMessage'
|
||||
import { isReadTypebotForbidden } from '../typebot/helpers/isReadTypebotForbidden'
|
||||
import { SessionState } from '@typebot.io/schemas'
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { authenticatedProcedure } from '@/helpers/server/trpc'
|
||||
import { z } from 'zod'
|
||||
import prisma from '@/lib/prisma'
|
||||
import prisma from '@typebot.io/lib/prisma'
|
||||
|
||||
export const verifyIfPhoneNumberAvailable = authenticatedProcedure
|
||||
.meta({
|
||||
|
||||
Reference in New Issue
Block a user