🐛 (credentials) Fix credentials not listing when workspace has legacy zemantic
This commit is contained in:
@ -1,4 +1,5 @@
|
||||
import { z } from '../zod'
|
||||
import { zemanticAiCredentialsSchema } from './blocks'
|
||||
import { stripeCredentialsSchema } from './blocks/inputs/payment/schema'
|
||||
import { googleSheetsCredentialsSchema } from './blocks/integrations/googleSheets/schema'
|
||||
import { smtpCredentialsSchema } from './blocks/integrations/sendEmail'
|
||||
@ -10,19 +11,30 @@ const credentialsSchema = z.discriminatedUnion('type', [
|
||||
googleSheetsCredentialsSchema,
|
||||
stripeCredentialsSchema,
|
||||
whatsAppCredentialsSchema,
|
||||
zemanticAiCredentialsSchema,
|
||||
...Object.values(forgedCredentialsSchemas),
|
||||
])
|
||||
|
||||
export type Credentials = z.infer<typeof credentialsSchema>
|
||||
|
||||
export type CredentialsWithoutLegacy = Exclude<
|
||||
Credentials,
|
||||
{
|
||||
type: 'zemanticAi'
|
||||
}
|
||||
>
|
||||
|
||||
export const credentialsTypes = [
|
||||
'smtp',
|
||||
'google sheets',
|
||||
'stripe',
|
||||
'whatsApp',
|
||||
'zemanticAi',
|
||||
...(Object.keys(forgedCredentialsSchemas) as Array<
|
||||
keyof typeof forgedCredentialsSchemas
|
||||
>),
|
||||
] as const
|
||||
|
||||
export const credentialsTypeSchema = z.enum(credentialsTypes)
|
||||
|
||||
export const legacyCredentialsTypes = ['zemanticAi']
|
||||
|
Reference in New Issue
Block a user