diff --git a/src/client.ts b/src/client.ts index 75b216f..993242f 100644 --- a/src/client.ts +++ b/src/client.ts @@ -1,7 +1,7 @@ import { Debug, type Event, type Filter, matchFilters } from '@/deps.ts'; import * as pipeline from '@/pipeline.ts'; import { activeRelays, pool } from '@/pool.ts'; -import { type EventStore, type GetEventsOpts, type StoreEventOpts } from '@/store.ts'; +import { type EventStore, type GetEventsOpts, type StoreEventOpts } from '@/storages/types.ts'; const debug = Debug('ditto:client'); diff --git a/src/queries.ts b/src/queries.ts index 29c07a7..56a8b67 100644 --- a/src/queries.ts +++ b/src/queries.ts @@ -2,7 +2,7 @@ import { eventsDB, memorelay } from '@/storages.ts'; import { Debug, type Event, findReplyTag } from '@/deps.ts'; import { type AuthorMicrofilter, type DittoFilter, type IdMicrofilter, type Relation } from '@/filter.ts'; import { reqmeister } from '@/reqmeister.ts'; -import { type DittoEvent } from '@/store.ts'; +import { type DittoEvent } from '@/storages/types.ts'; import { getTagSet } from '@/tags.ts'; const debug = Debug('ditto:queries'); diff --git a/src/reqmeister.ts b/src/reqmeister.ts index 8cc7e0d..48b1370 100644 --- a/src/reqmeister.ts +++ b/src/reqmeister.ts @@ -8,7 +8,7 @@ import { isMicrofilter, type MicroFilter, } from '@/filter.ts'; -import { type EventStore, GetEventsOpts } from '@/store.ts'; +import { type EventStore, GetEventsOpts } from '@/storages/types.ts'; import { Time } from '@/utils/time.ts'; const debug = Debug('ditto:reqmeister'); diff --git a/src/storages/events-db.ts b/src/storages/events-db.ts index c5536da..143f4f6 100644 --- a/src/storages/events-db.ts +++ b/src/storages/events-db.ts @@ -4,9 +4,10 @@ import { Debug, type Event, Kysely, type SelectQueryBuilder } from '@/deps.ts'; import { type DittoFilter } from '@/filter.ts'; import { isDittoInternalKind, isParameterizedReplaceableKind, isReplaceableKind } from '@/kinds.ts'; import { jsonMetaContentSchema } from '@/schemas/nostr.ts'; -import { type DittoEvent, EventStore, type GetEventsOpts, type StoreEventOpts } from '@/store.ts'; import { isNostrId, isURL } from '@/utils.ts'; +import { type DittoEvent, EventStore, type GetEventsOpts, type StoreEventOpts } from './types.ts'; + /** Function to decide whether or not to index a tag. */ type TagCondition = ({ event, count, value }: { event: Event; diff --git a/src/storages/memorelay.ts b/src/storages/memorelay.ts index 85f4826..bfa2a32 100644 --- a/src/storages/memorelay.ts +++ b/src/storages/memorelay.ts @@ -1,8 +1,9 @@ import { Debug, type Event, type Filter, LRUCache, matchFilter } from '@/deps.ts'; import { normalizeFilters } from '@/filter.ts'; -import { type EventStore, type GetEventsOpts } from '@/store.ts'; import { EventSet } from '@/utils/event-set.ts'; +import { type EventStore, type GetEventsOpts } from './types.ts'; + /** In-memory data store for events. */ class Memorelay implements EventStore { #debug = Debug('ditto:memorelay'); diff --git a/src/storages/optimizer.ts b/src/storages/optimizer.ts index f70fa7f..5bd4af8 100644 --- a/src/storages/optimizer.ts +++ b/src/storages/optimizer.ts @@ -1,7 +1,8 @@ -import { type DittoEvent, type EventStore, type GetEventsOpts, type StoreEventOpts } from '@/store.ts'; import { type DittoFilter, normalizeFilters } from '@/filter.ts'; import { EventSet } from '@/utils/event-set.ts'; +import { type DittoEvent, type EventStore, type GetEventsOpts, type StoreEventOpts } from './types.ts'; + interface OptimizerOpts { db: EventStore; cache: EventStore; diff --git a/src/store.ts b/src/storages/types.ts similarity index 100% rename from src/store.ts rename to src/storages/types.ts diff --git a/src/views/mastodon/accounts.ts b/src/views/mastodon/accounts.ts index eae3dd7..620a1b5 100644 --- a/src/views/mastodon/accounts.ts +++ b/src/views/mastodon/accounts.ts @@ -2,8 +2,8 @@ import { Conf } from '@/config.ts'; import { findUser } from '@/db/users.ts'; import { lodash, nip19, type UnsignedEvent } from '@/deps.ts'; import { jsonMetaContentSchema } from '@/schemas/nostr.ts'; +import { type DittoEvent } from '@/storages/types.ts'; import { verifyNip05Cached } from '@/utils/nip05.ts'; -import { type DittoEvent } from '@/store.ts'; import { Nip05, nostrDate, nostrNow, parseNip05 } from '@/utils.ts'; import { renderEmojis } from '@/views/mastodon/emojis.ts'; diff --git a/src/views/mastodon/statuses.ts b/src/views/mastodon/statuses.ts index c0b65c2..9e45f49 100644 --- a/src/views/mastodon/statuses.ts +++ b/src/views/mastodon/statuses.ts @@ -6,7 +6,7 @@ import { getMediaLinks, parseNoteContent } from '@/note.ts'; import { getAuthor } from '@/queries.ts'; import { jsonMediaDataSchema } from '@/schemas/nostr.ts'; import { eventsDB } from '@/storages.ts'; -import { type DittoEvent } from '@/store.ts'; +import { type DittoEvent } from '@/storages/types.ts'; import { nostrDate } from '@/utils.ts'; import { unfurlCardCached } from '@/utils/unfurl.ts'; import { accountFromPubkey, renderAccount } from '@/views/mastodon/accounts.ts';