Skip to main content

@helix/shared/validators

Zod validation schemas for runtime type safety.

Overview

Currently provides only pagination validation. Service-specific validators (tenant creation, user updates, etc.) belong in their respective services.

Installation

import { PaginationSchema } from '@helix/shared/validators';

Usage

// Validate pagination params
const result = PaginationSchema.parse(req.query);
// { page: 1, pageSize: 20, sortBy: 'createdAt', sortOrder: 'desc' }

// Type-safe result
type PaginationInput = z.infer<typeof PaginationSchema>;

Why Service-Specific Validators Don't Live Here

  • User creation: WorkOS handles via AuthKit, we don't validate
  • Tenant creation: Lives in tenant-service (business logic)
  • Product schemas: Live in product services

Shared validators = generic schemas used across multiple services

License

Proprietary - CleverChain Limited