@@ -90,15 +90,15 @@ export const createChatMessage = createAction({
|
||||
options,
|
||||
turnableInto: [
|
||||
{
|
||||
blockType: 'mistral',
|
||||
blockId: 'mistral',
|
||||
transform: transformToChatCompletionOptions,
|
||||
},
|
||||
{
|
||||
blockType: 'openai',
|
||||
blockId: 'openai',
|
||||
transform: transformToChatCompletionOptions,
|
||||
},
|
||||
{ blockType: 'open-router', transform: transformToChatCompletionOptions },
|
||||
{ blockType: 'together-ai', transform: transformToChatCompletionOptions },
|
||||
{ blockId: 'open-router', transform: transformToChatCompletionOptions },
|
||||
{ blockId: 'together-ai', transform: transformToChatCompletionOptions },
|
||||
],
|
||||
getSetVariableIds: ({ responseMapping }) =>
|
||||
responseMapping?.map((res) => res.variableId).filter(isDefined) ?? [],
|
||||
|
||||
@@ -3,7 +3,7 @@ import { AnthropicLogo } from './logo'
|
||||
import { auth } from './auth'
|
||||
import { createChatMessage } from './actions/createChatMessage'
|
||||
|
||||
export const anthropic = createBlock({
|
||||
export const anthropicBlock = createBlock({
|
||||
id: 'anthropic',
|
||||
name: 'Anthropic',
|
||||
tags: ['ai', 'chat', 'completion', 'claude', 'anthropic'],
|
||||
|
||||
6
packages/forge/blocks/anthropic/schemas.ts
Normal file
6
packages/forge/blocks/anthropic/schemas.ts
Normal file
@@ -0,0 +1,6 @@
|
||||
// Do not edit this file manually
|
||||
import { parseBlockCredentials, parseBlockSchema } from '@typebot.io/forge'
|
||||
import { anthropicBlock } from '.'
|
||||
|
||||
export const anthropicBlockSchema = parseBlockSchema(anthropicBlock)
|
||||
export const anthropicCredentialsSchema = parseBlockCredentials(anthropicBlock)
|
||||
@@ -3,7 +3,7 @@ import { CalComLogo } from './logo'
|
||||
import { bookEvent } from './actions/bookEvent'
|
||||
import { baseOptions } from './baseOptions'
|
||||
|
||||
export const calCom = createBlock({
|
||||
export const calComBlock = createBlock({
|
||||
id: 'cal-com',
|
||||
name: 'Cal.com',
|
||||
tags: ['calendar', 'scheduling', 'meetings'],
|
||||
|
||||
6
packages/forge/blocks/calCom/schemas.ts
Normal file
6
packages/forge/blocks/calCom/schemas.ts
Normal file
@@ -0,0 +1,6 @@
|
||||
// Do not edit this file manually
|
||||
import { parseBlockCredentials, parseBlockSchema } from '@typebot.io/forge'
|
||||
import { calComBlock } from '.'
|
||||
|
||||
export const calComBlockSchema = parseBlockSchema(calComBlock)
|
||||
export const calComCredentialsSchema = parseBlockCredentials(calComBlock)
|
||||
@@ -3,7 +3,7 @@ import { ChatNodeLogo } from './logo'
|
||||
import { auth } from './auth'
|
||||
import { sendMessage } from './actions/sendMessage'
|
||||
|
||||
export const chatNode = createBlock({
|
||||
export const chatNodeBlock = createBlock({
|
||||
id: 'chat-node',
|
||||
name: 'ChatNode',
|
||||
tags: ['ai', 'openai', 'document', 'url'],
|
||||
|
||||
6
packages/forge/blocks/chatNode/schemas.ts
Normal file
6
packages/forge/blocks/chatNode/schemas.ts
Normal file
@@ -0,0 +1,6 @@
|
||||
// Do not edit this file manually
|
||||
import { parseBlockCredentials, parseBlockSchema } from '@typebot.io/forge'
|
||||
import { chatNodeBlock } from '.'
|
||||
|
||||
export const chatNodeBlockSchema = parseBlockSchema(chatNodeBlock)
|
||||
export const chatNodeCredentialsSchema = parseBlockCredentials(chatNodeBlock)
|
||||
@@ -3,7 +3,7 @@ import { DifyAiLogo } from './logo'
|
||||
import { auth } from './auth'
|
||||
import { createChatMessage } from './actions/createChatMessage'
|
||||
|
||||
export const difyAi = createBlock({
|
||||
export const difyAiBlock = createBlock({
|
||||
id: 'dify-ai',
|
||||
name: 'Dify.AI',
|
||||
tags: ['dify', 'ai', 'documents', 'files', 'knowledge base'],
|
||||
|
||||
6
packages/forge/blocks/difyAi/schemas.ts
Normal file
6
packages/forge/blocks/difyAi/schemas.ts
Normal file
@@ -0,0 +1,6 @@
|
||||
// Do not edit this file manually
|
||||
import { parseBlockCredentials, parseBlockSchema } from '@typebot.io/forge'
|
||||
import { difyAiBlock } from '.'
|
||||
|
||||
export const difyAiBlockSchema = parseBlockSchema(difyAiBlock)
|
||||
export const difyAiCredentialsSchema = parseBlockCredentials(difyAiBlock)
|
||||
@@ -3,7 +3,7 @@ import { ElevenlabsLogo, ElevenlabsLogoDark } from './logo'
|
||||
import { auth } from './auth'
|
||||
import { convertTextToSpeech } from './actions/convertTextToSpeech'
|
||||
|
||||
export const elevenlabs = createBlock({
|
||||
export const elevenlabsBlock = createBlock({
|
||||
id: 'elevenlabs',
|
||||
name: 'ElevenLabs',
|
||||
tags: ['ai', 'voice', 'generation'],
|
||||
|
||||
7
packages/forge/blocks/elevenlabs/schemas.ts
Normal file
7
packages/forge/blocks/elevenlabs/schemas.ts
Normal file
@@ -0,0 +1,7 @@
|
||||
// Do not edit this file manually
|
||||
import { parseBlockCredentials, parseBlockSchema } from '@typebot.io/forge'
|
||||
import { elevenlabsBlock } from '.'
|
||||
|
||||
export const elevenlabsBlockSchema = parseBlockSchema(elevenlabsBlock)
|
||||
export const elevenlabsCredentialsSchema =
|
||||
parseBlockCredentials(elevenlabsBlock)
|
||||
@@ -69,14 +69,14 @@ export const createChatCompletion = createAction({
|
||||
options,
|
||||
turnableInto: [
|
||||
{
|
||||
blockType: 'openai',
|
||||
blockId: 'openai',
|
||||
},
|
||||
{
|
||||
blockType: 'together-ai',
|
||||
blockId: 'together-ai',
|
||||
},
|
||||
{ blockType: 'open-router' },
|
||||
{ blockId: 'open-router' },
|
||||
{
|
||||
blockType: 'anthropic',
|
||||
blockId: 'anthropic',
|
||||
transform: (options) => ({
|
||||
...options,
|
||||
action: 'Create Chat Message',
|
||||
|
||||
@@ -3,7 +3,7 @@ import { MistralLogo } from './logo'
|
||||
import { auth } from './auth'
|
||||
import { createChatCompletion } from './actions/createChatCompletion'
|
||||
|
||||
export const mistral = createBlock({
|
||||
export const mistralBlock = createBlock({
|
||||
id: 'mistral',
|
||||
name: 'Mistral',
|
||||
tags: ['ai', 'chat', 'completion'],
|
||||
|
||||
6
packages/forge/blocks/mistral/schemas.ts
Normal file
6
packages/forge/blocks/mistral/schemas.ts
Normal file
@@ -0,0 +1,6 @@
|
||||
// Do not edit this file manually
|
||||
import { parseBlockCredentials, parseBlockSchema } from '@typebot.io/forge'
|
||||
import { mistralBlock } from '.'
|
||||
|
||||
export const mistralBlockSchema = parseBlockSchema(mistralBlock)
|
||||
export const mistralCredentialsSchema = parseBlockCredentials(mistralBlock)
|
||||
@@ -14,14 +14,14 @@ export const createChatCompletion = createAction({
|
||||
auth,
|
||||
turnableInto: [
|
||||
{
|
||||
blockType: 'openai',
|
||||
blockId: 'openai',
|
||||
},
|
||||
{
|
||||
blockType: 'together-ai',
|
||||
blockId: 'together-ai',
|
||||
},
|
||||
{ blockType: 'mistral' },
|
||||
{ blockId: 'mistral' },
|
||||
{
|
||||
blockType: 'anthropic',
|
||||
blockId: 'anthropic',
|
||||
transform: (options) => ({
|
||||
...options,
|
||||
action: 'Create Chat Message',
|
||||
|
||||
@@ -3,7 +3,7 @@ import { OpenRouterLogo } from './logo'
|
||||
import { auth } from './auth'
|
||||
import { createChatCompletion } from './actions/createChatCompletion'
|
||||
|
||||
export const openRouter = createBlock({
|
||||
export const openRouterBlock = createBlock({
|
||||
id: 'open-router',
|
||||
name: 'OpenRouter',
|
||||
tags: ['ai', 'openai', 'chat', 'completion'],
|
||||
|
||||
7
packages/forge/blocks/openRouter/schemas.ts
Normal file
7
packages/forge/blocks/openRouter/schemas.ts
Normal file
@@ -0,0 +1,7 @@
|
||||
// Do not edit this file manually
|
||||
import { parseBlockCredentials, parseBlockSchema } from '@typebot.io/forge'
|
||||
import { openRouterBlock } from '.'
|
||||
|
||||
export const openRouterBlockSchema = parseBlockSchema(openRouterBlock)
|
||||
export const openRouterCredentialsSchema =
|
||||
parseBlockCredentials(openRouterBlock)
|
||||
@@ -21,14 +21,14 @@ export const createChatCompletion = createAction({
|
||||
getSetVariableIds: getChatCompletionSetVarIds,
|
||||
turnableInto: [
|
||||
{
|
||||
blockType: 'open-router',
|
||||
blockId: 'open-router',
|
||||
},
|
||||
{
|
||||
blockType: 'together-ai',
|
||||
blockId: 'together-ai',
|
||||
},
|
||||
{ blockType: 'mistral' },
|
||||
{ blockId: 'mistral' },
|
||||
{
|
||||
blockType: 'anthropic',
|
||||
blockId: 'anthropic',
|
||||
transform: (options) => ({
|
||||
...options,
|
||||
action: 'Create Chat Message',
|
||||
|
||||
6
packages/forge/blocks/openai/schemas.ts
Normal file
6
packages/forge/blocks/openai/schemas.ts
Normal file
@@ -0,0 +1,6 @@
|
||||
// Do not edit this file manually
|
||||
import { parseBlockCredentials, parseBlockSchema } from '@typebot.io/forge'
|
||||
import { openAIBlock } from '.'
|
||||
|
||||
export const openAIBlockSchema = parseBlockSchema(openAIBlock)
|
||||
export const openAICredentialsSchema = parseBlockCredentials(openAIBlock)
|
||||
@@ -2,7 +2,7 @@ import { createBlock } from '@typebot.io/forge'
|
||||
import { QrCodeLogo } from './logo'
|
||||
import { generateQrCode } from './actions/generateQrCodeImage'
|
||||
|
||||
export const qrCode = createBlock({
|
||||
export const qrCodeBlock = createBlock({
|
||||
id: 'qr-code',
|
||||
name: 'QR code',
|
||||
tags: [],
|
||||
|
||||
6
packages/forge/blocks/qrcode/schemas.ts
Normal file
6
packages/forge/blocks/qrcode/schemas.ts
Normal file
@@ -0,0 +1,6 @@
|
||||
// Do not edit this file manually
|
||||
import { parseBlockCredentials, parseBlockSchema } from '@typebot.io/forge'
|
||||
import { qrCodeBlock } from '.'
|
||||
|
||||
export const qrCodeBlockSchema = parseBlockSchema(qrCodeBlock)
|
||||
export const qrCodeCredentialsSchema = parseBlockCredentials(qrCodeBlock)
|
||||
@@ -16,14 +16,14 @@ export const createChatCompletion = createAction({
|
||||
}),
|
||||
turnableInto: [
|
||||
{
|
||||
blockType: 'openai',
|
||||
blockId: 'openai',
|
||||
},
|
||||
{
|
||||
blockType: 'open-router',
|
||||
blockId: 'open-router',
|
||||
},
|
||||
{ blockType: 'mistral' },
|
||||
{ blockId: 'mistral' },
|
||||
{
|
||||
blockType: 'anthropic',
|
||||
blockId: 'anthropic',
|
||||
transform: (options) => ({
|
||||
...options,
|
||||
action: 'Create Chat Message',
|
||||
|
||||
@@ -3,7 +3,7 @@ import { TogetherAiLogo } from './logo'
|
||||
import { auth } from './auth'
|
||||
import { createChatCompletion } from './actions/createChatCompletion'
|
||||
|
||||
export const togetherAi = createBlock({
|
||||
export const togetherAiBlock = createBlock({
|
||||
id: 'together-ai',
|
||||
name: 'Together',
|
||||
fullName: 'Together AI',
|
||||
|
||||
7
packages/forge/blocks/togetherAi/schemas.ts
Normal file
7
packages/forge/blocks/togetherAi/schemas.ts
Normal file
@@ -0,0 +1,7 @@
|
||||
// Do not edit this file manually
|
||||
import { parseBlockCredentials, parseBlockSchema } from '@typebot.io/forge'
|
||||
import { togetherAiBlock } from '.'
|
||||
|
||||
export const togetherAiBlockSchema = parseBlockSchema(togetherAiBlock)
|
||||
export const togetherAiCredentialsSchema =
|
||||
parseBlockCredentials(togetherAiBlock)
|
||||
@@ -5,7 +5,7 @@ import { searchDocuments } from './actions/searchDocuments'
|
||||
import { auth } from './auth'
|
||||
import { baseOptions } from './baseOptions'
|
||||
|
||||
export const zemanticAi = createBlock({
|
||||
export const zemanticAiBlock = createBlock({
|
||||
id: 'zemantic-ai',
|
||||
name: 'Zemantic AI',
|
||||
tags: [],
|
||||
|
||||
7
packages/forge/blocks/zemanticAi/schemas.ts
Normal file
7
packages/forge/blocks/zemanticAi/schemas.ts
Normal file
@@ -0,0 +1,7 @@
|
||||
// Do not edit this file manually
|
||||
import { parseBlockCredentials, parseBlockSchema } from '@typebot.io/forge'
|
||||
import { zemanticAiBlock } from '.'
|
||||
|
||||
export const zemanticAiBlockSchema = parseBlockSchema(zemanticAiBlock)
|
||||
export const zemanticAiCredentialsSchema =
|
||||
parseBlockCredentials(zemanticAiBlock)
|
||||
@@ -83,7 +83,7 @@ const main = async () => {
|
||||
await createIndexFile(newBlockPath, prompt)
|
||||
await createLogoFile(newBlockPath, prompt)
|
||||
if (prompt.auth !== 'none') await createAuthFile(newBlockPath, prompt)
|
||||
await addNewIntegrationToRepository(prompt)
|
||||
await createSchemasFile(newBlockPath, prompt)
|
||||
s.stop('Creating files...')
|
||||
s.start('Installing dependencies...')
|
||||
await new Promise<void>((resolve, reject) => {
|
||||
@@ -138,7 +138,7 @@ const createIndexFile = async (
|
||||
import { ${capitalize(camelCaseId)}Logo } from './logo'
|
||||
${auth !== 'none' ? `import { auth } from './auth'` : ''}
|
||||
|
||||
export const ${camelCaseName} = createBlock({
|
||||
export const ${camelCaseName}Block = createBlock({
|
||||
id: '${id}',
|
||||
name: '${name}',
|
||||
tags: [],
|
||||
@@ -175,51 +175,6 @@ const createPackageJson = async (path: string, { id }: { id: unknown }) => {
|
||||
)
|
||||
}
|
||||
|
||||
const addNewIntegrationToRepository = async ({
|
||||
camelCaseId,
|
||||
id,
|
||||
}: {
|
||||
camelCaseId: string
|
||||
id: string
|
||||
}) => {
|
||||
const schemasPath = join(process.cwd(), `../schemas`)
|
||||
const packageJson = require(join(schemasPath, 'package.json'))
|
||||
packageJson.devDependencies[`@typebot.io/${id}-block`] = 'workspace:*'
|
||||
writeFileSync(
|
||||
join(schemasPath, 'package.json'),
|
||||
await prettier.format(JSON.stringify(packageJson, null, 2), {
|
||||
parser: 'json',
|
||||
...prettierRc,
|
||||
})
|
||||
)
|
||||
const repoIndexFile = readFileSync(join(schemasPath, 'index.ts')).toString()
|
||||
writeFileSync(
|
||||
join(schemasPath, 'index.ts'),
|
||||
await prettier.format(
|
||||
repoIndexFile
|
||||
.replace(
|
||||
'] as BlockDefinition<(typeof enabledBlocks)[number], any, any>[]',
|
||||
`${camelCaseId},] as BlockDefinition<(typeof enabledBlocks)[number], any, any>[]`
|
||||
)
|
||||
.replace(
|
||||
'// Do not edit this file manually',
|
||||
`// Do not edit this file manually\nimport {${camelCaseId}} from '@typebot.io/${id}-block'`
|
||||
),
|
||||
{ parser: 'typescript', ...prettierRc }
|
||||
)
|
||||
)
|
||||
|
||||
const repoPath = join(process.cwd(), `../repository`)
|
||||
const enabledIndexFile = readFileSync(join(repoPath, 'index.ts')).toString()
|
||||
writeFileSync(
|
||||
join(repoPath, 'index.ts'),
|
||||
await prettier.format(
|
||||
enabledIndexFile.replace('] as const', `'${id}'] as const`),
|
||||
{ parser: 'typescript', ...prettierRc }
|
||||
)
|
||||
)
|
||||
}
|
||||
|
||||
const createTsConfig = async (path: string) => {
|
||||
writeFileSync(
|
||||
join(path, 'tsconfig.json'),
|
||||
@@ -289,6 +244,27 @@ const createAuthFile = async (
|
||||
)
|
||||
)
|
||||
|
||||
const createSchemasFile = async (
|
||||
path: string,
|
||||
{
|
||||
id,
|
||||
}: { id: string; name: string; auth: 'apiKey' | 'encryptedData' | 'none' }
|
||||
) => {
|
||||
const camelCaseName = camelize(id as string)
|
||||
writeFileSync(
|
||||
join(path, 'schemas.ts'),
|
||||
await prettier.format(
|
||||
`// Do not edit this file manually
|
||||
import { parseBlockCredentials, parseBlockSchema } from '@typebot.io/forge'
|
||||
import { ${camelCaseName}Block } from '.'
|
||||
|
||||
export const ${camelCaseName}BlockSchema = parseBlockSchema(${camelCaseName}Block)
|
||||
export const ${camelCaseName}CredentialsSchema = parseBlockCredentials(${camelCaseName}Block)`,
|
||||
{ parser: 'typescript', ...prettierRc }
|
||||
)
|
||||
)
|
||||
}
|
||||
|
||||
main()
|
||||
.then()
|
||||
.catch((err) => {
|
||||
|
||||
@@ -89,7 +89,7 @@ export const parseBlockCredentials = <
|
||||
>(
|
||||
blockDefinition: BlockDefinition<I, A, O>
|
||||
) => {
|
||||
if (!blockDefinition.auth) throw new Error('Block has no auth definition')
|
||||
if (!blockDefinition.auth) return null
|
||||
return z.object({
|
||||
id: z.string(),
|
||||
type: z.literal(blockDefinition.id),
|
||||
|
||||
@@ -11,7 +11,6 @@
|
||||
},
|
||||
"devDependencies": {
|
||||
"@typebot.io/tsconfig": "workspace:*",
|
||||
"@types/react": "18.2.15",
|
||||
"@typebot.io/forge-repository": "workspace:*"
|
||||
"@types/react": "18.2.15"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import { SVGProps } from 'react'
|
||||
import { z } from './zod'
|
||||
import { ZodRawShape } from 'zod'
|
||||
import { enabledBlocks } from '@typebot.io/forge-repository'
|
||||
|
||||
export type VariableStore = {
|
||||
get: (variableId: string) => string | (string | null)[] | null | undefined
|
||||
@@ -34,7 +33,7 @@ export type FunctionToExecute = {
|
||||
export type ReadOnlyVariableStore = Omit<VariableStore, 'set'>
|
||||
|
||||
export type TurnableIntoParam<T = {}> = {
|
||||
blockType: (typeof enabledBlocks)[number]
|
||||
blockId: string
|
||||
/**
|
||||
* If defined will be used to convert the existing block options into the new block options.
|
||||
*/
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
// Do not edit this file manually
|
||||
export const enabledBlocks = [
|
||||
import { ForgedBlock } from './types'
|
||||
|
||||
export const forgedBlockIds = [
|
||||
'openai',
|
||||
'zemantic-ai',
|
||||
'cal-com',
|
||||
@@ -11,4 +12,4 @@ export const enabledBlocks = [
|
||||
'anthropic',
|
||||
'together-ai',
|
||||
'open-router',
|
||||
] as const
|
||||
] as const satisfies ForgedBlock['type'][]
|
||||
36
packages/forge/repository/credentials.ts
Normal file
36
packages/forge/repository/credentials.ts
Normal file
@@ -0,0 +1,36 @@
|
||||
import { anthropicBlock } from '@typebot.io/anthropic-block'
|
||||
import { anthropicCredentialsSchema } from '@typebot.io/anthropic-block/schemas'
|
||||
import { calComBlock } from '@typebot.io/cal-com-block'
|
||||
import { calComCredentialsSchema } from '@typebot.io/cal-com-block/schemas'
|
||||
import { chatNodeBlock } from '@typebot.io/chat-node-block'
|
||||
import { chatNodeCredentialsSchema } from '@typebot.io/chat-node-block/schemas'
|
||||
import { difyAiBlock } from '@typebot.io/dify-ai-block'
|
||||
import { difyAiCredentialsSchema } from '@typebot.io/dify-ai-block/schemas'
|
||||
import { elevenlabsBlock } from '@typebot.io/elevenlabs-block'
|
||||
import { elevenlabsCredentialsSchema } from '@typebot.io/elevenlabs-block/schemas'
|
||||
import { mistralBlock } from '@typebot.io/mistral-block'
|
||||
import { mistralCredentialsSchema } from '@typebot.io/mistral-block/schemas'
|
||||
import { openRouterBlock } from '@typebot.io/open-router-block'
|
||||
import { openRouterCredentialsSchema } from '@typebot.io/open-router-block/schemas'
|
||||
import { openAIBlock } from '@typebot.io/openai-block'
|
||||
import { openAICredentialsSchema } from '@typebot.io/openai-block/schemas'
|
||||
import { qrCodeBlock } from '@typebot.io/qrcode-block'
|
||||
import { qrCodeCredentialsSchema } from '@typebot.io/qrcode-block/schemas'
|
||||
import { togetherAiBlock } from '@typebot.io/together-ai-block'
|
||||
import { togetherAiCredentialsSchema } from '@typebot.io/together-ai-block/schemas'
|
||||
import { zemanticAiBlock } from '@typebot.io/zemantic-ai-block'
|
||||
import { zemanticAiCredentialsSchema } from '@typebot.io/zemantic-ai-block/schemas'
|
||||
|
||||
export const forgedCredentialsSchemas = {
|
||||
[openAIBlock.id]: openAICredentialsSchema,
|
||||
[zemanticAiBlock.id]: zemanticAiCredentialsSchema,
|
||||
[calComBlock.id]: calComCredentialsSchema,
|
||||
[chatNodeBlock.id]: chatNodeCredentialsSchema,
|
||||
[qrCodeBlock.id]: qrCodeCredentialsSchema,
|
||||
[difyAiBlock.id]: difyAiCredentialsSchema,
|
||||
[mistralBlock.id]: mistralCredentialsSchema,
|
||||
[elevenlabsBlock.id]: elevenlabsCredentialsSchema,
|
||||
[anthropicBlock.id]: anthropicCredentialsSchema,
|
||||
[togetherAiBlock.id]: togetherAiCredentialsSchema,
|
||||
[openRouterBlock.id]: openRouterCredentialsSchema,
|
||||
}
|
||||
26
packages/forge/repository/definitions.ts
Normal file
26
packages/forge/repository/definitions.ts
Normal file
@@ -0,0 +1,26 @@
|
||||
// Do not edit this file manually
|
||||
import { anthropicBlock } from '@typebot.io/anthropic-block'
|
||||
import { openRouterBlock } from '@typebot.io/open-router-block'
|
||||
import { togetherAiBlock } from '@typebot.io/together-ai-block'
|
||||
import { elevenlabsBlock } from '@typebot.io/elevenlabs-block'
|
||||
import { difyAiBlock } from '@typebot.io/dify-ai-block'
|
||||
import { mistralBlock } from '@typebot.io/mistral-block'
|
||||
import { qrCodeBlock } from '@typebot.io/qrcode-block'
|
||||
import { chatNodeBlock } from '@typebot.io/chat-node-block'
|
||||
import { calComBlock } from '@typebot.io/cal-com-block'
|
||||
import { zemanticAiBlock } from '@typebot.io/zemantic-ai-block'
|
||||
import { openAIBlock } from '@typebot.io/openai-block'
|
||||
|
||||
export const forgedBlocks = {
|
||||
[openAIBlock.id]: openAIBlock,
|
||||
[zemanticAiBlock.id]: zemanticAiBlock,
|
||||
[calComBlock.id]: calComBlock,
|
||||
[chatNodeBlock.id]: chatNodeBlock,
|
||||
[qrCodeBlock.id]: qrCodeBlock,
|
||||
[difyAiBlock.id]: difyAiBlock,
|
||||
[mistralBlock.id]: mistralBlock,
|
||||
[elevenlabsBlock.id]: elevenlabsBlock,
|
||||
[anthropicBlock.id]: anthropicBlock,
|
||||
[togetherAiBlock.id]: togetherAiBlock,
|
||||
[openRouterBlock.id]: openRouterBlock,
|
||||
} as const
|
||||
@@ -2,8 +2,21 @@
|
||||
"name": "@typebot.io/forge-repository",
|
||||
"version": "1.0.0",
|
||||
"description": "",
|
||||
"main": "index.ts",
|
||||
"keywords": [],
|
||||
"author": "Baptiste Arnaud",
|
||||
"license": "ISC"
|
||||
"license": "ISC",
|
||||
"devDependencies": {
|
||||
"@typebot.io/forge": "workspace:*",
|
||||
"@typebot.io/openai-block": "workspace:*",
|
||||
"@typebot.io/zemantic-ai-block": "workspace:*",
|
||||
"@typebot.io/cal-com-block": "workspace:*",
|
||||
"@typebot.io/chat-node-block": "workspace:*",
|
||||
"@typebot.io/qrcode-block": "workspace:*",
|
||||
"@typebot.io/dify-ai-block": "workspace:*",
|
||||
"@typebot.io/mistral-block": "workspace:*",
|
||||
"@typebot.io/elevenlabs-block": "workspace:*",
|
||||
"@typebot.io/anthropic-block": "workspace:*",
|
||||
"@typebot.io/together-ai-block": "workspace:*",
|
||||
"@typebot.io/open-router-block": "workspace:*"
|
||||
}
|
||||
}
|
||||
|
||||
36
packages/forge/repository/schemas.ts
Normal file
36
packages/forge/repository/schemas.ts
Normal file
@@ -0,0 +1,36 @@
|
||||
import { anthropicBlock } from '@typebot.io/anthropic-block'
|
||||
import { anthropicBlockSchema } from '@typebot.io/anthropic-block/schemas'
|
||||
import { calComBlock } from '@typebot.io/cal-com-block'
|
||||
import { calComBlockSchema } from '@typebot.io/cal-com-block/schemas'
|
||||
import { chatNodeBlock } from '@typebot.io/chat-node-block'
|
||||
import { chatNodeBlockSchema } from '@typebot.io/chat-node-block/schemas'
|
||||
import { difyAiBlock } from '@typebot.io/dify-ai-block'
|
||||
import { difyAiBlockSchema } from '@typebot.io/dify-ai-block/schemas'
|
||||
import { elevenlabsBlock } from '@typebot.io/elevenlabs-block'
|
||||
import { elevenlabsBlockSchema } from '@typebot.io/elevenlabs-block/schemas'
|
||||
import { mistralBlock } from '@typebot.io/mistral-block'
|
||||
import { mistralBlockSchema } from '@typebot.io/mistral-block/schemas'
|
||||
import { openRouterBlock } from '@typebot.io/open-router-block'
|
||||
import { openRouterBlockSchema } from '@typebot.io/open-router-block/schemas'
|
||||
import { openAIBlock } from '@typebot.io/openai-block'
|
||||
import { openAIBlockSchema } from '@typebot.io/openai-block/schemas'
|
||||
import { qrCodeBlock } from '@typebot.io/qrcode-block'
|
||||
import { qrCodeBlockSchema } from '@typebot.io/qrcode-block/schemas'
|
||||
import { togetherAiBlock } from '@typebot.io/together-ai-block'
|
||||
import { togetherAiBlockSchema } from '@typebot.io/together-ai-block/schemas'
|
||||
import { zemanticAiBlock } from '@typebot.io/zemantic-ai-block'
|
||||
import { zemanticAiBlockSchema } from '@typebot.io/zemantic-ai-block/schemas'
|
||||
|
||||
export const forgedBlockSchemas = {
|
||||
[openAIBlock.id]: openAIBlockSchema,
|
||||
[zemanticAiBlock.id]: zemanticAiBlockSchema,
|
||||
[calComBlock.id]: calComBlockSchema,
|
||||
[chatNodeBlock.id]: chatNodeBlockSchema,
|
||||
[qrCodeBlock.id]: qrCodeBlockSchema,
|
||||
[difyAiBlock.id]: difyAiBlockSchema,
|
||||
[mistralBlock.id]: mistralBlockSchema,
|
||||
[elevenlabsBlock.id]: elevenlabsBlockSchema,
|
||||
[anthropicBlock.id]: anthropicBlockSchema,
|
||||
[togetherAiBlock.id]: togetherAiBlockSchema,
|
||||
[openRouterBlock.id]: openRouterBlockSchema,
|
||||
}
|
||||
10
packages/forge/repository/types.ts
Normal file
10
packages/forge/repository/types.ts
Normal file
@@ -0,0 +1,10 @@
|
||||
import { z } from '@typebot.io/forge/zod'
|
||||
import { forgedBlocks } from './definitions'
|
||||
import { forgedBlockSchemas } from './schemas'
|
||||
|
||||
export type ForgedBlock = z.infer<
|
||||
(typeof forgedBlockSchemas)[keyof typeof forgedBlockSchemas]
|
||||
>
|
||||
|
||||
export type ForgedBlockDefinition =
|
||||
(typeof forgedBlocks)[keyof typeof forgedBlocks]
|
||||
@@ -1,42 +0,0 @@
|
||||
// Do not edit this file manually
|
||||
import { anthropic } from '@typebot.io/anthropic-block'
|
||||
import { openRouter } from '@typebot.io/open-router-block'
|
||||
import { togetherAi } from '@typebot.io/together-ai-block'
|
||||
import { elevenlabs } from '@typebot.io/elevenlabs-block'
|
||||
import { difyAi } from '@typebot.io/dify-ai-block'
|
||||
import { mistral } from '@typebot.io/mistral-block'
|
||||
import { qrCode } from '@typebot.io/qrcode-block'
|
||||
import { chatNode } from '@typebot.io/chat-node-block'
|
||||
import { calCom } from '@typebot.io/cal-com-block'
|
||||
import { zemanticAi } from '@typebot.io/zemantic-ai-block'
|
||||
import { openAIBlock } from '@typebot.io/openai-block'
|
||||
import {
|
||||
BlockDefinition,
|
||||
parseBlockCredentials,
|
||||
parseBlockSchema,
|
||||
} from '@typebot.io/forge'
|
||||
import { enabledBlocks } from '@typebot.io/forge-repository'
|
||||
import { z } from '@typebot.io/forge/zod'
|
||||
|
||||
export const forgedBlocks = [
|
||||
openAIBlock,
|
||||
zemanticAi,
|
||||
calCom,
|
||||
chatNode,
|
||||
qrCode,
|
||||
difyAi,
|
||||
mistral,
|
||||
elevenlabs,
|
||||
anthropic,
|
||||
togetherAi,
|
||||
openRouter,
|
||||
] as BlockDefinition<(typeof enabledBlocks)[number], any, any>[]
|
||||
|
||||
export type ForgedBlockDefinition = (typeof forgedBlocks)[number]
|
||||
|
||||
export const forgedBlockSchemas = forgedBlocks.map(parseBlockSchema)
|
||||
export type ForgedBlock = z.infer<(typeof forgedBlockSchemas)[number]>
|
||||
|
||||
export const forgedCredentialsSchemas = forgedBlocks
|
||||
.filter((b) => b.auth)
|
||||
.map(parseBlockCredentials)
|
||||
@@ -1,24 +0,0 @@
|
||||
{
|
||||
"name": "@typebot.io/forge-schemas",
|
||||
"version": "1.0.0",
|
||||
"description": "",
|
||||
"main": "index.ts",
|
||||
"keywords": [],
|
||||
"author": "Baptiste Arnaud",
|
||||
"license": "ISC",
|
||||
"devDependencies": {
|
||||
"@typebot.io/forge": "workspace:*",
|
||||
"@typebot.io/forge-repository": "workspace:*",
|
||||
"@typebot.io/openai-block": "workspace:*",
|
||||
"@typebot.io/zemantic-ai-block": "workspace:*",
|
||||
"@typebot.io/cal-com-block": "workspace:*",
|
||||
"@typebot.io/chat-node-block": "workspace:*",
|
||||
"@typebot.io/qrcode-block": "workspace:*",
|
||||
"@typebot.io/dify-ai-block": "workspace:*",
|
||||
"@typebot.io/mistral-block": "workspace:*",
|
||||
"@typebot.io/elevenlabs-block": "workspace:*",
|
||||
"@typebot.io/anthropic-block": "workspace:*",
|
||||
"@typebot.io/together-ai-block": "workspace:*",
|
||||
"@typebot.io/open-router-block": "workspace:*"
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user