decentralised message store

refactor: don't use atcute validator shape, use zod instead

serenity d1ebd0f6 b2e7d334

Changed files
+10 -3
src
lib
+7
src/lib/types/atproto.ts
···
),
});
export type DidDocument = z.infer<typeof didDocumentSchema>;
···
),
});
export type DidDocument = z.infer<typeof didDocumentSchema>;
+
+
export const comAtprotoRepoStrongRefSchema = z.object({
+
$type: z.optional(z.literal("com.atproto.repo.strongRef")),
+
cid: z.string(),
+
uri: z.string(),
+
})
+
export type ComAtprotoRepoStrongRef = z.infer<typeof comAtprotoRepoStrongRefSchema>;
+3 -3
src/lib/types/gmstn.ts
···
-
import { ComAtprotoRepoStrongRef } from "@atcute/atproto";
import z from "zod";
export const systemsGmstnDevelopmentChannelRecordSchema = z.object({
$type: z.string(),
name: z.string(),
topic: z.string(),
-
storeAt: z.object({ ...ComAtprotoRepoStrongRef.mainSchema.shape }),
-
routeThrough: z.object({ ...ComAtprotoRepoStrongRef.mainSchema.shape }),
createdAt: z.coerce.date(),
});
export type SystemsGmstnDevelopmentChannel = z.infer<
···
+
import { comAtprotoRepoStrongRefSchema } from "@/lib/types/atproto";
import z from "zod";
export const systemsGmstnDevelopmentChannelRecordSchema = z.object({
$type: z.string(),
name: z.string(),
topic: z.string(),
+
storeAt: comAtprotoRepoStrongRefSchema,
+
routeThrough: comAtprotoRepoStrongRefSchema,
createdAt: z.coerce.date(),
});
export type SystemsGmstnDevelopmentChannel = z.infer<