From 97e6f1385cf7b719ee25fb40a05590227c6cd083 Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Thu, 13 Jul 2023 20:17:31 -0500 Subject: [PATCH] Move transmute into transmogrify directory --- src/controllers/api/accounts.ts | 2 +- src/controllers/api/search.ts | 4 ++-- src/controllers/api/statuses.ts | 2 +- src/controllers/api/timelines.ts | 2 +- .../nostr-to-activitypub.ts | 0 .../nostr-to-mastoapi.ts} | 14 +++++++------- 6 files changed, 12 insertions(+), 12 deletions(-) rename src/{transmogrifier => transmogrify}/nostr-to-activitypub.ts (100%) rename src/{transmute.ts => transmogrify/nostr-to-mastoapi.ts} (97%) diff --git a/src/controllers/api/accounts.ts b/src/controllers/api/accounts.ts index b45e027..142e3d2 100644 --- a/src/controllers/api/accounts.ts +++ b/src/controllers/api/accounts.ts @@ -3,7 +3,7 @@ import { type Filter, findReplyTag, z } from '@/deps.ts'; import { getAuthor, getFilter, getFollows, publish } from '@/client.ts'; import { parseMetaContent } from '@/schema.ts'; import { signEvent } from '@/sign.ts'; -import { toAccount, toStatus } from '@/transmute.ts'; +import { toAccount, toStatus } from '@/transmogrify/nostr-to-mastoapi.ts'; import { buildLinkHeader, eventDateComparator, lookupAccount, nostrNow, paginationSchema, parseBody } from '@/utils.ts'; const createAccountController: AppController = (c) => { diff --git a/src/controllers/api/search.ts b/src/controllers/api/search.ts index d6988ea..d863fbb 100644 --- a/src/controllers/api/search.ts +++ b/src/controllers/api/search.ts @@ -1,6 +1,6 @@ import { AppController } from '@/app.ts'; -import { lookupAccount } from '../../utils.ts'; -import { toAccount } from '../../transmute.ts'; +import { lookupAccount } from '@/utils.ts'; +import { toAccount } from '@/transmogrify/nostr-to-mastoapi.ts'; const searchController: AppController = async (c) => { const q = c.req.query('q'); diff --git a/src/controllers/api/statuses.ts b/src/controllers/api/statuses.ts index abbddb5..3a36f09 100644 --- a/src/controllers/api/statuses.ts +++ b/src/controllers/api/statuses.ts @@ -3,7 +3,7 @@ import { getAncestors, getDescendants, getEvent, publish } from '@/client.ts'; import { ISO6391, Kind, z } from '@/deps.ts'; import { type Event } from '@/event.ts'; import { signEvent } from '@/sign.ts'; -import { toStatus } from '@/transmute.ts'; +import { toStatus } from '@/transmogrify/nostr-to-mastoapi.ts'; import { nostrNow, parseBody } from '@/utils.ts'; const createStatusSchema = z.object({ diff --git a/src/controllers/api/timelines.ts b/src/controllers/api/timelines.ts index f724662..f012082 100644 --- a/src/controllers/api/timelines.ts +++ b/src/controllers/api/timelines.ts @@ -1,5 +1,5 @@ import { getFeed, getFollows, getPublicFeed } from '@/client.ts'; -import { toStatus } from '@/transmute.ts'; +import { toStatus } from '@/transmogrify/nostr-to-mastoapi.ts'; import { buildLinkHeader, paginationSchema } from '@/utils.ts'; import type { AppController } from '@/app.ts'; diff --git a/src/transmogrifier/nostr-to-activitypub.ts b/src/transmogrify/nostr-to-activitypub.ts similarity index 100% rename from src/transmogrifier/nostr-to-activitypub.ts rename to src/transmogrify/nostr-to-activitypub.ts diff --git a/src/transmute.ts b/src/transmogrify/nostr-to-mastoapi.ts similarity index 97% rename from src/transmute.ts rename to src/transmogrify/nostr-to-mastoapi.ts index c157af2..ea70df5 100644 --- a/src/transmute.ts +++ b/src/transmogrify/nostr-to-mastoapi.ts @@ -1,13 +1,13 @@ +import { isCWTag } from 'https://gitlab.com/soapbox-pub/mostr/-/raw/c67064aee5ade5e01597c6d23e22e53c628ef0e2/src/nostr/tags.ts'; + +import { getAuthor } from '@/client.ts'; +import { Conf } from '@/config.ts'; import { findReplyTag, lodash, nip19, sanitizeHtml, TTLCache, unfurl, z } from '@/deps.ts'; import { type Event } from '@/event.ts'; +import { verifyNip05Cached } from '@/nip05.ts'; +import { getMediaLinks, type MediaLink, parseNoteContent } from '@/note.ts'; import { emojiTagSchema, filteredArray, type MetaContent, parseMetaContent } from '@/schema.ts'; - -import { Conf } from './config.ts'; -import { getAuthor } from './client.ts'; -import { verifyNip05Cached } from './nip05.ts'; -import { getMediaLinks, type MediaLink, parseNoteContent } from './note.ts'; -import { type Nip05, nostrDate, parseNip05, Time } from './utils.ts'; -import { isCWTag } from 'https://gitlab.com/soapbox-pub/mostr/-/raw/c67064aee5ade5e01597c6d23e22e53c628ef0e2/src/nostr/tags.ts'; +import { type Nip05, nostrDate, parseNip05, Time } from '@/utils.ts'; const DEFAULT_AVATAR = 'https://gleasonator.com/images/avi.png'; const DEFAULT_BANNER = 'https://gleasonator.com/images/banner.png';