decentralised sync engine
0
fork

Configure Feed

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

refactor: rename schema

serenity 4ce95eaa 3f0ab1cd

+9 -9
+3 -3
src/lib/state.ts
··· 1 1 import type { AtUri } from "@/lib/types/atproto"; 2 - import type { SessionInfo } from "@/lib/types/handshake"; 2 + import type { ShardSessionInfo } from "@/lib/types/handshake"; 3 3 import type WebSocket from "ws"; 4 4 5 5 export const registrationState = { ··· 15 15 return registrationState; 16 16 }; 17 17 18 - export const handshakeTokens = new Map<AtUri, SessionInfo>(); 19 - export const shardSessions = new Map<SessionInfo, WebSocket>(); 18 + export const handshakeTokens = new Map<AtUri, ShardSessionInfo>(); 19 + export const shardSessions = new Map<ShardSessionInfo, WebSocket>();
+2 -2
src/lib/types/handshake.ts
··· 1 1 import { atUriSchema } from "@/lib/types/atproto"; 2 2 import { z } from "zod"; 3 3 4 - export const sessionInfoSchema = z.object({ 4 + export const shardSessionInfoSchema = z.object({ 5 5 id: z.string(), 6 6 token: z.string(), 7 7 fingerprint: z.string(), 8 8 allowedChannels: z.array(atUriSchema), 9 9 }); 10 - export type SessionInfo = z.infer<typeof sessionInfoSchema>; 10 + export type ShardSessionInfo = z.infer<typeof shardSessionInfoSchema>;
+2 -2
src/lib/types/http/responses.ts
··· 1 - import { sessionInfoSchema } from "@/lib/types/handshake"; 1 + import { shardSessionInfoSchema } from "@/lib/types/handshake"; 2 2 import { httpResponseErrorInfoSchema } from "@/lib/types/http/errors"; 3 3 import { z } from "zod"; 4 4 ··· 12 12 >; 13 13 14 14 export const handshakeResponseSchema = z.object({ 15 - sessionInfo: sessionInfoSchema, 15 + sessionInfo: shardSessionInfoSchema, 16 16 }); 17 17 export type HandshakeResponse = z.infer<typeof handshakeResponseSchema>; 18 18
+2 -2
src/lib/utils/handshake.ts
··· 1 1 import type { AtUri, Did } from "@/lib/types/atproto"; 2 - import type { SessionInfo } from "@/lib/types/handshake"; 2 + import type { ShardSessionInfo } from "@/lib/types/handshake"; 3 3 import { 4 4 handshakeResponseSchema, 5 5 httpSuccessResponseSchema, ··· 16 16 }: { 17 17 did: Did; 18 18 channels: Array<AtUri>; 19 - }): Promise<Result<SessionInfo, unknown>> => { 19 + }): Promise<Result<ShardSessionInfo, unknown>> => { 20 20 const shardUrlResult = await getShardEndpointFromDid(did); 21 21 if (!shardUrlResult.ok) return { ok: false, error: shardUrlResult.error }; 22 22