2
0

📝 Migrate from Docusaurus to Mintlify (#1115)

Closes #868
This commit is contained in:
Baptiste Arnaud
2023-12-22 09:13:53 +01:00
committed by GitHub
parent 512bb09282
commit 1e5fa5a575
450 changed files with 49522 additions and 104787 deletions

View File

@@ -11,12 +11,13 @@
"test:report": "pnpm playwright show-report"
},
"dependencies": {
"@lilyrose2798/trpc-openapi": "^1.3.9",
"@planetscale/database": "1.8.0",
"@sentry/nextjs": "7.77.0",
"@trpc/server": "10.40.0",
"@typebot.io/bot-engine": "workspace:*",
"@typebot.io/nextjs": "workspace:*",
"@typebot.io/js": "workspace:*",
"@typebot.io/nextjs": "workspace:*",
"@typebot.io/prisma": "workspace:*",
"ai": "2.2.24",
"bot-engine": "workspace:*",
@@ -30,8 +31,7 @@
"qs": "6.11.2",
"react": "18.2.0",
"react-dom": "18.2.0",
"stripe": "12.13.0",
"trpc-openapi": "1.2.0"
"stripe": "12.13.0"
},
"devDependencies": {
"@faire/mjml-react": "3.3.0",
@@ -39,13 +39,13 @@
"@playwright/test": "1.36.0",
"@typebot.io/emails": "workspace:*",
"@typebot.io/env": "workspace:*",
"@typebot.io/forge": "workspace:*",
"@typebot.io/forge-repository": "workspace:*",
"@typebot.io/forge-schemas": "workspace:*",
"@typebot.io/lib": "workspace:*",
"@typebot.io/schemas": "workspace:*",
"@typebot.io/tsconfig": "workspace:*",
"@typebot.io/forge-schemas": "workspace:*",
"@typebot.io/forge": "workspace:*",
"@typebot.io/variables": "workspace:*",
"@typebot.io/forge-repository": "workspace:*",
"@types/cors": "2.8.13",
"@types/node": "20.4.2",
"@types/nodemailer": "6.4.8",

View File

@@ -19,9 +19,9 @@ export const ErrorPage = ({ error }: { error: Error }) => {
NEXT_PUBLIC_VIEWER_URL is missing
</h1>
<h2>
Make sure to configure the viewer properly (
<a href="https://docs.typebot.io/self-hosting/configuration#viewer">
https://docs.typebot.io/self-hosting/configuration#viewer
Make sure to configure the app properly (
<a href="https://docs.typebot.io/self-hosting/configuration">
https://docs.typebot.io/self-hosting/configuration
</a>
)
</h2>

View File

@@ -14,14 +14,16 @@ export const continueChat = publicProcedure
method: 'POST',
path: '/v1/sessions/{sessionId}/continueChat',
summary: 'Continue chat',
description:
'To initiate a chat, do not provide a `sessionId` nor a `message`.\n\nContinue the conversation by providing the `sessionId` and the `message` that should answer the previous question.\n\nSet the `isPreview` option to `true` to chat with the non-published version of the typebot.',
},
})
.input(
z.object({
message: z.string().optional(),
sessionId: z.string(),
sessionId: z
.string()
.describe(
'The session ID you got from the [startChat](./start-chat) response.'
),
})
)
.output(continueChatResponseSchema)

View File

@@ -67,7 +67,7 @@ export const sendMessageV1 = publicProcedure
? {
type: 'preview',
isOnlyRegistering: startParams.isOnlyRegistering ?? false,
isStreamEnabled: startParams.isStreamEnabled,
isStreamEnabled: startParams.isStreamEnabled ?? false,
startFrom:
'startGroupId' in startParams && startParams.startGroupId
? {
@@ -95,7 +95,7 @@ export const sendMessageV1 = publicProcedure
: {
type: 'live',
isOnlyRegistering: startParams.isOnlyRegistering ?? false,
isStreamEnabled: startParams.isStreamEnabled,
isStreamEnabled: startParams.isStreamEnabled ?? false,
publicId: startParams.typebot,
prefilledVariables: startParams.prefilledVariables,
resultId: startParams.resultId,

View File

@@ -67,7 +67,7 @@ export const sendMessageV2 = publicProcedure
? {
type: 'preview',
isOnlyRegistering: startParams.isOnlyRegistering ?? false,
isStreamEnabled: startParams.isStreamEnabled,
isStreamEnabled: startParams.isStreamEnabled ?? false,
startFrom:
'startGroupId' in startParams && startParams.startGroupId
? {
@@ -95,7 +95,7 @@ export const sendMessageV2 = publicProcedure
: {
type: 'live',
isOnlyRegistering: startParams.isOnlyRegistering ?? false,
isStreamEnabled: startParams.isStreamEnabled,
isStreamEnabled: startParams.isStreamEnabled ?? false,
publicId: startParams.typebot,
prefilledVariables: startParams.prefilledVariables,
resultId: startParams.resultId,

View File

@@ -12,7 +12,7 @@ export const saveClientLogs = publicProcedure
openapi: {
method: 'POST',
path: '/v1/sessions/{sessionId}/clientLogs',
summary: 'Save client logs',
summary: 'Save logs',
},
})
.input(

View File

@@ -74,7 +74,7 @@ export const startChat = publicProcedure
},
messages,
input,
resultId,
resultId: resultId as string,
dynamicTheme,
logs,
clientSideActions,

View File

@@ -13,6 +13,8 @@ export const startChatPreview = publicProcedure
method: 'POST',
path: '/v1/typebots/{typebotId}/preview/startChat',
summary: 'Start preview chat',
description:
'Use this endpoint to test your bot. The answers will not be saved. And some blocks like "Send email" will be skipped.',
},
})
.input(startPreviewChatInputSchema)

View File

@@ -1,4 +1,4 @@
import { generateOpenApiDocument } from 'trpc-openapi'
import { generateOpenApiDocument } from '@lilyrose2798/trpc-openapi'
import { writeFileSync } from 'fs'
import { appRouter } from './appRouter'
@@ -6,10 +6,7 @@ const openApiDocument = generateOpenApiDocument(appRouter, {
title: 'Chat API',
version: '3.0.0',
baseUrl: 'https://typebot.io/api',
docsUrl: 'https://docs.typebot.io/api',
docsUrl: 'https://docs.typebot.io/api-reference',
})
writeFileSync(
'./openapi/chat/_spec_.json',
JSON.stringify(openApiDocument, null, 2)
)
writeFileSync('./openapi/viewer.json', JSON.stringify(openApiDocument, null, 2))

View File

@@ -1,5 +1,5 @@
import { initTRPC } from '@trpc/server'
import { OpenApiMeta } from 'trpc-openapi'
import { OpenApiMeta } from '@lilyrose2798/trpc-openapi'
import superjson from 'superjson'
import { Context } from './context'
import * as Sentry from '@sentry/nextjs'

View File

@@ -1,6 +1,6 @@
import { appRouter } from '@/helpers/server/appRouter'
import * as Sentry from '@sentry/nextjs'
import { createOpenApiNextHandler } from 'trpc-openapi'
import { createOpenApiNextHandler } from '@lilyrose2798/trpc-openapi'
import cors from 'nextjs-cors'
import { NextApiRequest, NextApiResponse } from 'next'
import { createContext } from '@/helpers/server/context'

View File

@@ -300,6 +300,8 @@ test('API chat execution should work on published bot', async ({ request }) => {
{
data: {
message: 'Hey',
isStreamEnabled: false,
isOnlyRegistering: false,
} satisfies Omit<StartChatInput, 'publicId'>,
}
)

View File

@@ -1,15 +0,0 @@
import { generateOpenApiDocument } from 'trpc-openapi'
import { writeFileSync } from 'fs'
import { appRouter } from '@/helpers/server/appRouter'
const openApiDocument = generateOpenApiDocument(appRouter, {
title: 'Chat API',
version: '3.0.0',
baseUrl: 'https://typebot.io/api',
docsUrl: 'https://docs.typebot.io/api',
})
writeFileSync(
'./openapi/chat/_spec_.json',
JSON.stringify(openApiDocument, null, 2)
)