ThatAIguyA world of ideas

THE CONSCIOUSNESS ATLAS
Read. Experiment. Follow the evidence.

ConsciousnessLearn · Explore · Joseph Anady

Janady13/llms-txt-hub / apps/web/components/forms/submit-form-schemas.ts

Source identity, revision, and recovered contents.

GitHub sourceSource text recovered

Source identity

FieldRecorded value
Source typeGitHub source
Original recordJanady13/llms-txt-hub / apps/web/components/forms/submit-form-schemas.ts
DateNot specified in source
RepositoryJanady13/llms-txt-hub
Revisione0f4bf978d4df168369c7601d9c5f5ea89e84377
Branchmain
Path or archive memberapps/web/components/forms/submit-form-schemas.ts
Original SHA-256b21dcab895240f6ea7b3369dcd0920c7451f21c879d7dacf350dd3cd170a64b2
Git blob SHA5c8b9cc670ae1fdea6ce08eb626687b6905eb240
Reading-copy SHA-256b21dcab895240f6ea7b3369dcd0920c7451f21c879d7dacf350dd3cd170a64b2

Original source ↗

Recovered source transcript

import * as z from 'zod' import { categories } from '@/lib/categories' /** * Validation schema for Step 1 of the submit form */ export const step1Schema = z.object({ website: z .string() .url({ message: 'Please enter a valid URL.' }) .refine( value => !value.toLowerCase().includes('llms.txt') && !value.toLowerCase().includes('llms-full.txt'), { message: 'Please enter your website URL, not the path to your llms.txt or llms-full.txt file' } ) }) const validCategorySlugs = categories.map(category => category.slug) as [string, ...string[]] /** * Validation schema for Step 2 of the submit form */ export const step2Schema = z.object({ name: z .string() .min(2, { message: 'Name must be at least 2 characters.' }) .max(30, { message: 'Name must be less than 30 characters for optimal display and SEO.' }) .refine(value => !value.endsWith('.'), { message: 'Name should not end with a period.' }), description: z .string() .min(50, { message: 'Description must be at least 50 characters for better context.' }) .max(160, { message: 'Description must be less than 160 characters for optimal SEO.' }) .refine(value => value.endsWith('.'), { message: 'Description should end with a period.' }), mdxContent: z.string().optional().nullable(), website: z .string() .url({ message: 'Please enter a valid URL.' }) .refine( value => !value.toLowerCase().includes('llms.txt') && !value.toLowerCase().includes('llms-full.txt'), { message: 'Please enter your website URL, not the path to your llms.txt or llms-full.txt file' } ), llmsUrl: z .string() .url({ message: 'Please enter a valid URL.' }) .refine(value => /llms\.txt(?:$|\?)/i.test(value), { message: 'URL must end with llms.txt' }), llmsFullUrl: z .union([ z.literal(''), z .string() .url({ message: 'Please enter a valid URL.' }) .refine(value => /llms-full\.txt(?:$|\?)/i.test(value), { message: 'URL must end with llms-full.txt' }), z.null() ]) .optional(), category: z.enum(validCategorySlugs, { errorMap: () => ({ message: 'Please select a valid category' }) }) }) export type Step1Data = z.infer<typeof step1Schema> export type Step2Data = z.infer<typeof step2Schema> /** * Server-side validation schema for submitLlmsTxt action (FormData payload) */ export const submitActionSchema = z.object({ name: z .string() .min(2, { message: 'Name must be at least 2 characters.' }) .max(30, { message: 'Name must be less than 30 characters.' }) .refine(value => !value.endsWith('.'), { message: 'Name should not end with a period.' }), description: z .string() .min(50, { message: 'Description must be at least 50 characters.' }) .max(160, { message: 'Description must be less than 160 characters.' }) .refine(value => value.endsWith('.'), { message: 'Description should end with a period.' }), website: z .string() .url({ message: 'Please enter a valid URL.' }) .refine( value => !value.toLowerCase().includes('llms.txt') && !value.toLowerCase().includes('llms-full.txt'), { message: 'Please enter your website URL, not the path to your llms.txt or llms-full.txt file' } ), llmsUrl: z .string() .url({ message: 'Please enter a valid URL.' }) .refine(value => /llms\.txt(?:$|\?)/i.test(value), { message: 'URL must end with llms.txt' }), llmsFullUrl: z .union([ z.literal(''), z .string() .url({ message: 'Please enter a valid URL.' }) .refine(value => /llms-full\.txt(?:$|\?)/i.test(value), { message: 'URL must end with llms-full.txt' }), z.null() ]) .optional(), category: z.enum(validCategorySlugs, { errorMap: () => ({ message: 'Please select a valid category' }) }), publishedAt: z.string().min(1, { message: 'Publication date is required' }) }) export type SubmitActionData = z.infer<typeof submitActionSchema>

Search equations, builds, manuscript text, and recovered sources.