Rocky_Mountain_Vending/.pnpm-store/v10/files/06/86662a841c18c4d7da557d6f95fadb09687d7f4478a54f724aad9f751e69e7fb533e458f0bc74b54b241889eeac922708e876e789310e2e054e5a5fbc52d65
DMleadgen 46d973904b
Initial commit: Rocky Mountain Vending website
Next.js website for Rocky Mountain Vending company featuring:
- Product catalog with Stripe integration
- Service areas and parts pages
- Admin dashboard with Clerk authentication
- SEO optimized pages with JSON-LD structured data

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-12 16:22:15 -07:00

83 lines
1.8 KiB
Text

import { Static, Type } from '@sinclair/typebox';
import { Field, InternalFieldName } from 'react-hook-form';
export const schema = Type.Object({
username: Type.String({
minLength: 3,
maxLength: 30,
pattern: '^[a-zA-Z0-9]+$',
}),
password: Type.String({
minLength: 8,
pattern: '^(.*[A-Za-z\\d].*)$',
}),
repeatPassword: Type.String(),
accessToken: Type.Union([Type.String(), Type.Number()]),
birthYear: Type.Optional(
Type.Number({
minimum: 1900,
maximum: 2013,
}),
),
email: Type.Optional(
Type.RegExp(
/^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i,
),
),
tags: Type.Array(Type.String()),
enabled: Type.Boolean(),
like: Type.Optional(
Type.Array(
Type.Object({
id: Type.Number(),
name: Type.String({ minLength: 4, maxLength: 4 }),
}),
),
),
dateStr: Type.Date(),
});
export const validData: Static<typeof schema> = {
username: 'Doe',
password: 'Password123_',
repeatPassword: 'Password123_',
birthYear: 2000,
email: 'google@gmail.com',
tags: ['tag1', 'tag2'],
enabled: true,
accessToken: 'accessToken',
like: [
{
id: 1,
name: 'name',
},
],
dateStr: new Date(),
};
export const invalidData = {
password: '___',
email: '',
birthYear: 'birthYear',
like: [{ id: 'z' }],
url: 'abc',
};
export const fields: Record<InternalFieldName, Field['_f']> = {
username: {
ref: { name: 'username' },
name: 'username',
},
password: {
ref: { name: 'password' },
name: 'password',
},
email: {
ref: { name: 'email' },
name: 'email',
},
birthday: {
ref: { name: 'birthday' },
name: 'birthday',
},
};