Rising Tide Developers
SDKSchemas

Schemas

The @rising-tide/sdk/schemas entry point - Zod schemas for API response validation.

@rising-tide/sdk/schemas exports Zod schemas that mirror the SDK's TypeScript types. Use them for runtime validation in tests and form handling.

Usage in tests

import { SmartProductSchema, ProductInstanceSchema } from "@rising-tide/sdk/schemas";

// Validate API response shape matches SDK type
const result = SmartProductSchema.safeParse(apiResponse.body);
expect(result.success).toBe(true);

Usage in forms

Input schemas (the *InputSchema variants) pair well with react-hook-form:

import { FundingGroupCreateInputSchema } from "@rising-tide/sdk/schemas";
import { useForm } from "react-hook-form";
import { zodResolver } from "@hookform/resolvers/zod";

const form = useForm({
  resolver: zodResolver(FundingGroupCreateInputSchema),
});

Schema catalog

Response-shape schemas:

  • SmartProductSchema / SmartProductLooseSchema - Full and permissive SmartProduct shapes
  • ProductInstanceSchema, ArchivalStateSchema - ProductInstance shape and its archival state
  • ProductTypeSchema, ProductTypeNestedSchema - ProductType shape, and the nested form embedded in other rows
  • ContributionSchema, ContributionListSchema - Revenue-routing contribution rows (with ContributionRoleSchema for the role enum)
  • FundingGroupSchema - FundingGroup shape
  • UserSchema, UserWithRelationsSchema, UserStoragePostureSchema, SaveAsDestinationSchema - Users and their storage posture
  • PageSchema, StyleSetSchema, StyleSchema, EditionSchema, EventSchema, LocationSchema, EventTypeSchema, CollectionSchema, CollectionItemSchema, TransactionSchema, PaymentSchema, TagSchema, ProductTagSchema - Other core entities
  • BracketDetailsSchema, BracketEntryDetailsSchema, BracketLeaderboardSchema, BracketRoundTallySchema - The PREDICTION domain
  • GameLobbyDetailsSchema, GameMatchSchema, GameMatchStateSchema, GameRecordSchema and the seat, participant and move schemas - The GAME domain
  • NotificationItemSchema, NotificationFeedPageSchema, NotificationReadResultSchema - The notification feed
  • PushPayloadSchema, PushSubscriptionViewSchema, PushSubscriptionListSchema, PushVapidPublicKeySchema - Web Push
  • AchievementAwardSchema, AchievementShelfSchema, NextRungSchema - Achievements
  • UserProfileAggregateSchema, UserRevenueReportSchema, UserCollectorsResponseSchema, UserSupportingResponseSchema, UserFeedResponseSchema, AppTrendingResponseSchema, AppRandomResponseSchema - The aggregate user and app reads
  • ProtocolStatsSchema, CreatorStatsSchema, ProductStatsSchema, SentimentSnapshotSchema - Analytics
  • CapabilityConfigEntrySchema, ConstraintConfigEntrySchema, AttributeConfigEntrySchema - The composition entries in productConfig
  • PaginationSchema, SuccessResponseSchema, PaginatedResponseSchema, ErrorResponseSchema - The response envelope

Enum schemas:

  • ProductDomainSchema, ProductStatusSchema, FundingGroupStatusSchema, CurrencyTypeSchema, TransactionStatusSchema, GameMatchStatusSchema, GameResultSchema, NotificationKindSchema

Input schemas:

  • FundingGroupCreateInputSchema, FundingGroupUpdateInputSchema, CollaboratorInputSchema, ContributionPickInputSchema

The entry point's own index.ts is the complete list.

The schemas are used by rt-api/tests/contract/ to verify that API responses match SDK type expectations ("the type always tells the truth").