⚡ (customDomains) Fix custom domain update feedback
This commit is contained in:
10
packages/schemas/features/customDomains.ts
Normal file
10
packages/schemas/features/customDomains.ts
Normal file
@@ -0,0 +1,10 @@
|
||||
import { CustomDomain as CustomDomainInDb } from '@typebot.io/prisma'
|
||||
import { z } from 'zod'
|
||||
|
||||
const domainNameRegex = /^([a-z0-9]+(-[a-z0-9]+)*\.)+[a-z]{2,}$/
|
||||
|
||||
export const customDomainSchema = z.object({
|
||||
name: z.string().refine((name) => domainNameRegex.test(name)),
|
||||
workspaceId: z.string(),
|
||||
createdAt: z.date(),
|
||||
}) satisfies z.ZodType<CustomDomainInDb>
|
||||
@@ -39,7 +39,7 @@ const resultsTablePreferencesSchema = z.object({
|
||||
})
|
||||
|
||||
const isPathNameCompatible = (str: string) =>
|
||||
/^([a-z0-9]+-[a-z0-9]*)*$/.test(str) || /^[a-z0-9]*$/.test(str)
|
||||
/^([a-zA-Z0-9]+(-|.)[a-zA-z0-9]*)*$/.test(str) || /^[a-zA-Z0-9]*$/.test(str)
|
||||
|
||||
const isDomainNameWithPathNameCompatible = (str: string) =>
|
||||
/^(?:(?:[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}(?:\/[\w-\/]*)?)$/.test(
|
||||
|
||||
Reference in New Issue
Block a user