✨ (credentials) Add credentials management menu in workspace settings
Closes #1567
This commit is contained in:
@ -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 }
|
||||
)
|
||||
)
|
||||
|
Reference in New Issue
Block a user