From 4e4b7711c993b4eac93db8df05a5ec1942cd5532 Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Thu, 25 Apr 2024 18:48:02 -0500 Subject: [PATCH] relay: NSchema --- src/controllers/nostr/relay.ts | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/controllers/nostr/relay.ts b/src/controllers/nostr/relay.ts index 30d73169..3db72c31 100644 --- a/src/controllers/nostr/relay.ts +++ b/src/controllers/nostr/relay.ts @@ -1,8 +1,7 @@ -import { NostrEvent, NostrFilter } from '@nostrify/nostrify'; +import { NostrEvent, NostrFilter, NSchema as n } from '@nostrify/nostrify'; import { relayInfoController } from '@/controllers/nostr/relay-info.ts'; import { eventsDB } from '@/storages.ts'; import * as pipeline from '@/pipeline.ts'; -import { jsonSchema } from '@/schema.ts'; import { type ClientCLOSE, type ClientCOUNT, @@ -32,7 +31,7 @@ function connectStream(socket: WebSocket) { const controllers = new Map(); socket.onmessage = (e) => { - const result = jsonSchema.pipe(clientMsgSchema).safeParse(e.data); + const result = n.json().pipe(clientMsgSchema).safeParse(e.data); if (result.success) { handleMsg(result.data); } else {