✨ Introducing The Forge (#1072)
The Forge allows anyone to easily create their own Typebot Block. Closes #380
This commit is contained in:
@ -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 = {
|
||||
|
Reference in New Issue
Block a user