2
0

Introducing The Forge (#1072)

The Forge allows anyone to easily create their own Typebot Block.

Closes #380
This commit is contained in:
Baptiste Arnaud
2023-12-13 10:22:02 +01:00
committed by GitHub
parent c373108b55
commit 5e019bbb22
184 changed files with 42659 additions and 37411 deletions

View File

@ -60,6 +60,24 @@ const embedMessageSchema = z.object({
.merge(z.object({ height: z.number().optional() })),
})
const displayEmbedBubbleSchema = z.object({
waitForEventFunction: z
.object({
args: z.record(z.string(), z.unknown()),
content: z.string(),
})
.optional(),
initFunction: z.object({
args: z.record(z.string(), z.unknown()),
content: z.string(),
}),
})
const customEmbedSchema = z.object({
type: z.literal('custom-embed'),
content: displayEmbedBubbleSchema,
})
export type CustomEmbedBubble = z.infer<typeof customEmbedSchema>
export const chatMessageSchema = z
.object({ id: z.string() })
.and(
@ -69,6 +87,7 @@ export const chatMessageSchema = z
videoMessageSchema,
audioMessageSchema,
embedMessageSchema,
customEmbedSchema,
])
)
export type ChatMessage = z.infer<typeof chatMessageSchema>
@ -242,6 +261,19 @@ export const clientSideActionSchema = z
pixel: pixelOptionsSchema,
})
)
.or(
z.object({
stream: z.literal(true),
})
)
.or(
z.object({
codeToExecute: z.object({
args: z.record(z.string(), z.unknown()),
content: z.string(),
}),
})
)
)
const typebotInChatReplyPick = {