From 180fdbd1c9599d469e7de0b2b413fa00bac1e7cc Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Fri, 6 Oct 2023 15:09:01 -0500 Subject: [PATCH] nostr-to-activitypub.ts --> activitypub/actor.ts --- src/controllers/activitypub/actor.ts | 4 ++-- src/views/{nostr-to-activitypub.ts => activitypub/actor.ts} | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) rename src/views/{nostr-to-activitypub.ts => activitypub/actor.ts} (91%) diff --git a/src/controllers/activitypub/actor.ts b/src/controllers/activitypub/actor.ts index 4f051c0..49fda36 100644 --- a/src/controllers/activitypub/actor.ts +++ b/src/controllers/activitypub/actor.ts @@ -1,7 +1,7 @@ import { findUser } from '@/db/users.ts'; import { getAuthor } from '@/queries.ts'; import { activityJson } from '@/utils/web.ts'; -import { toActor } from '@/views/nostr-to-activitypub.ts'; +import { renderActor } from '@/views/activitypub/actor.ts'; import type { AppContext, AppController } from '@/app.ts'; @@ -14,7 +14,7 @@ const actorController: AppController = async (c) => { const event = await getAuthor(user.pubkey); if (!event) return notFound(c); - const actor = await toActor(event, user.username); + const actor = await renderActor(event, user.username); if (!actor) return notFound(c); return activityJson(c, actor); diff --git a/src/views/nostr-to-activitypub.ts b/src/views/activitypub/actor.ts similarity index 91% rename from src/views/nostr-to-activitypub.ts rename to src/views/activitypub/actor.ts index ca90625..1f2f679 100644 --- a/src/views/nostr-to-activitypub.ts +++ b/src/views/activitypub/actor.ts @@ -6,7 +6,7 @@ import type { Event } from '@/deps.ts'; import type { Actor } from '@/schemas/activitypub.ts'; /** Nostr metadata event to ActivityPub actor. */ -async function toActor(event: Event<0>, username: string): Promise { +async function renderActor(event: Event<0>, username: string): Promise { const content = jsonMetaContentSchema.parse(event.content); return { @@ -44,4 +44,4 @@ async function toActor(event: Event<0>, username: string): Promise