(whatsapp) Improve whatsApp management and media collection

Closes #796
This commit is contained in:
Baptiste Arnaud
2023-09-22 11:08:41 +02:00
parent 8f4e5b5d63
commit 9e0109f561
22 changed files with 505 additions and 452 deletions

View File

@@ -31,14 +31,16 @@ export const createCredentials = authenticatedProcedure
})
.input(
z.object({
credentials: z.discriminatedUnion('type', [
stripeCredentialsSchema.pick(inputShape),
smtpCredentialsSchema.pick(inputShape),
googleSheetsCredentialsSchema.pick(inputShape),
openAICredentialsSchema.pick(inputShape),
whatsAppCredentialsSchema.pick(inputShape),
zemanticAiCredentialsSchema.pick(inputShape),
]),
credentials: z
.discriminatedUnion('type', [
stripeCredentialsSchema.pick(inputShape),
smtpCredentialsSchema.pick(inputShape),
googleSheetsCredentialsSchema.pick(inputShape),
openAICredentialsSchema.pick(inputShape),
whatsAppCredentialsSchema.pick(inputShape),
zemanticAiCredentialsSchema.pick(inputShape),
])
.and(z.object({ id: z.string().cuid2().optional() })),
})
)
.output(