2
0

(credentials) Add credentials management menu in workspace settings

Closes #1567
This commit is contained in:
Baptiste Arnaud
2024-07-16 15:11:48 +02:00
parent db628cd051
commit c6005c49a2
81 changed files with 3582 additions and 1704 deletions

View File

@ -273,6 +273,7 @@ const createSchemasFile = async (
path: string,
{
id,
auth,
}: { id: string; name: string; auth: 'apiKey' | 'encryptedData' | 'none' }
) => {
const camelCaseName = camelize(id as string)
@ -280,11 +281,19 @@ const createSchemasFile = async (
join(path, 'schemas.ts'),
await prettier.format(
`// Do not edit this file manually
import { parseBlockCredentials, parseBlockSchema } from '@typebot.io/forge'
import { ${camelCaseName}Block } from '.'
import { ${
auth !== 'none' ? 'parseBlockCredentials,' : ''
} parseBlockSchema } from '@typebot.io/forge'
import { ${camelCaseName}Block } from '.'${
auth !== 'none' ? `\nimport { auth } from './auth'` : ''
}
export const ${camelCaseName}BlockSchema = parseBlockSchema(${camelCaseName}Block)
export const ${camelCaseName}CredentialsSchema = parseBlockCredentials(${camelCaseName}Block)`,
${
auth !== 'none'
? `export const ${camelCaseName}CredentialsSchema = parseBlockCredentials(${camelCaseName}Block.id, auth.schema)`
: ''
}`,
{ parser: 'typescript', ...prettierRc }
)
)