decentralised sync engine

refactor: split between types of sessions

serenity cb60fa57 3a355d4c

Changed files
+19 -4
src
lib
types
+19 -4
src/lib/types/http/responses.ts
···
-
import { latticeSessionInfoSchema } from "@/lib/types/handshake";
import { httpResponseErrorInfoSchema } from "@/lib/types/http/errors";
import { z } from "zod";
···
typeof httpResponseStatusTypeSchema
>;
-
export const handshakeResponseSchema = z.object({
sessionInfo: latticeSessionInfoSchema,
});
-
export type HandshakeResponse = z.infer<typeof handshakeResponseSchema>;
-
export const httpResponseDataSchema = z.union([handshakeResponseSchema]);
export type HttpResponseData = z.infer<typeof httpResponseDataSchema>;
const httpResponseBaseSchema = z.object({
···
+
import {
+
latticeSessionInfoSchema,
+
shardSessionInfoSchema,
+
} from "@/lib/types/handshake";
import { httpResponseErrorInfoSchema } from "@/lib/types/http/errors";
import { z } from "zod";
···
typeof httpResponseStatusTypeSchema
>;
+
export const latticeHandshakeResponseSchema = z.object({
sessionInfo: latticeSessionInfoSchema,
});
+
export type LatticeHandshakeResponse = z.infer<
+
typeof latticeHandshakeResponseSchema
+
>;
+
+
export const shardHandshakeResponseSchema = z.object({
+
sessionInfo: shardSessionInfoSchema,
+
});
+
export type ShardHandshakeResponse = z.infer<
+
typeof shardHandshakeResponseSchema
+
>;
+
export const httpResponseDataSchema = z.union([
+
latticeHandshakeResponseSchema,
+
shardHandshakeResponseSchema,
+
]);
export type HttpResponseData = z.infer<typeof httpResponseDataSchema>;
const httpResponseBaseSchema = z.object({