decentralised sync engine
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

refactor: split between types of sessions

serenity cb60fa57 3a355d4c

+19 -4
+19 -4
src/lib/types/http/responses.ts
··· 1 - import { latticeSessionInfoSchema } from "@/lib/types/handshake"; 1 + import { 2 + latticeSessionInfoSchema, 3 + shardSessionInfoSchema, 4 + } from "@/lib/types/handshake"; 2 5 import { httpResponseErrorInfoSchema } from "@/lib/types/http/errors"; 3 6 import { z } from "zod"; 4 7 ··· 11 14 typeof httpResponseStatusTypeSchema 12 15 >; 13 16 14 - export const handshakeResponseSchema = z.object({ 17 + export const latticeHandshakeResponseSchema = z.object({ 15 18 sessionInfo: latticeSessionInfoSchema, 16 19 }); 17 - export type HandshakeResponse = z.infer<typeof handshakeResponseSchema>; 20 + export type LatticeHandshakeResponse = z.infer< 21 + typeof latticeHandshakeResponseSchema 22 + >; 23 + 24 + export const shardHandshakeResponseSchema = z.object({ 25 + sessionInfo: shardSessionInfoSchema, 26 + }); 27 + export type ShardHandshakeResponse = z.infer< 28 + typeof shardHandshakeResponseSchema 29 + >; 18 30 19 - export const httpResponseDataSchema = z.union([handshakeResponseSchema]); 31 + export const httpResponseDataSchema = z.union([ 32 + latticeHandshakeResponseSchema, 33 + shardHandshakeResponseSchema, 34 + ]); 20 35 export type HttpResponseData = z.infer<typeof httpResponseDataSchema>; 21 36 22 37 const httpResponseBaseSchema = z.object({