Telegram Bot + Mini App for city walking quests. - React 19 + TypeScript + Vite 6 frontend - Express 5 + PostgreSQL backend - grammY Telegram bot with DeepSeek AI - GitLab CI/CD: lint, build, deploy to production Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
24 lines
644 B
TypeScript
24 lines
644 B
TypeScript
import { z } from 'zod'
|
|
|
|
export const questEventSchema = z.object({
|
|
questId: z.string().uuid(),
|
|
pointId: z.string().uuid().optional(),
|
|
eventType: z.enum([
|
|
'arrived', 'photo_uploaded', 'skipped',
|
|
'finished_today', 'point_completed',
|
|
'quest_started', 'quest_completed',
|
|
'day_started', 'day_completed',
|
|
'peek_next'
|
|
]),
|
|
payload: z.record(z.unknown()).optional(),
|
|
})
|
|
|
|
export const internalActionSchema = z.object({
|
|
action: z.enum([
|
|
'create_quest', 'generate_step', 'update_point_content',
|
|
'update_state', 'get_user_state', 'save_chat_message',
|
|
'check_achievements'
|
|
]),
|
|
data: z.record(z.unknown()),
|
|
})
|