@/store.ts -> @/storages/types.ts
This commit is contained in:
parent
b3e4b79439
commit
96dd635661
|
@ -1,7 +1,7 @@
|
||||||
import { Debug, type Event, type Filter, matchFilters } from '@/deps.ts';
|
import { Debug, type Event, type Filter, matchFilters } from '@/deps.ts';
|
||||||
import * as pipeline from '@/pipeline.ts';
|
import * as pipeline from '@/pipeline.ts';
|
||||||
import { activeRelays, pool } from '@/pool.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');
|
const debug = Debug('ditto:client');
|
||||||
|
|
||||||
|
|
|
@ -2,7 +2,7 @@ import { eventsDB, memorelay } from '@/storages.ts';
|
||||||
import { Debug, type Event, findReplyTag } from '@/deps.ts';
|
import { Debug, type Event, findReplyTag } from '@/deps.ts';
|
||||||
import { type AuthorMicrofilter, type DittoFilter, type IdMicrofilter, type Relation } from '@/filter.ts';
|
import { type AuthorMicrofilter, type DittoFilter, type IdMicrofilter, type Relation } from '@/filter.ts';
|
||||||
import { reqmeister } from '@/reqmeister.ts';
|
import { reqmeister } from '@/reqmeister.ts';
|
||||||
import { type DittoEvent } from '@/store.ts';
|
import { type DittoEvent } from '@/storages/types.ts';
|
||||||
import { getTagSet } from '@/tags.ts';
|
import { getTagSet } from '@/tags.ts';
|
||||||
|
|
||||||
const debug = Debug('ditto:queries');
|
const debug = Debug('ditto:queries');
|
||||||
|
|
|
@ -8,7 +8,7 @@ import {
|
||||||
isMicrofilter,
|
isMicrofilter,
|
||||||
type MicroFilter,
|
type MicroFilter,
|
||||||
} from '@/filter.ts';
|
} from '@/filter.ts';
|
||||||
import { type EventStore, GetEventsOpts } from '@/store.ts';
|
import { type EventStore, GetEventsOpts } from '@/storages/types.ts';
|
||||||
import { Time } from '@/utils/time.ts';
|
import { Time } from '@/utils/time.ts';
|
||||||
|
|
||||||
const debug = Debug('ditto:reqmeister');
|
const debug = Debug('ditto:reqmeister');
|
||||||
|
|
|
@ -4,9 +4,10 @@ import { Debug, type Event, Kysely, type SelectQueryBuilder } from '@/deps.ts';
|
||||||
import { type DittoFilter } from '@/filter.ts';
|
import { type DittoFilter } from '@/filter.ts';
|
||||||
import { isDittoInternalKind, isParameterizedReplaceableKind, isReplaceableKind } from '@/kinds.ts';
|
import { isDittoInternalKind, isParameterizedReplaceableKind, isReplaceableKind } from '@/kinds.ts';
|
||||||
import { jsonMetaContentSchema } from '@/schemas/nostr.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 { 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. */
|
/** Function to decide whether or not to index a tag. */
|
||||||
type TagCondition = ({ event, count, value }: {
|
type TagCondition = ({ event, count, value }: {
|
||||||
event: Event;
|
event: Event;
|
||||||
|
|
|
@ -1,8 +1,9 @@
|
||||||
import { Debug, type Event, type Filter, LRUCache, matchFilter } from '@/deps.ts';
|
import { Debug, type Event, type Filter, LRUCache, matchFilter } from '@/deps.ts';
|
||||||
import { normalizeFilters } from '@/filter.ts';
|
import { normalizeFilters } from '@/filter.ts';
|
||||||
import { type EventStore, type GetEventsOpts } from '@/store.ts';
|
|
||||||
import { EventSet } from '@/utils/event-set.ts';
|
import { EventSet } from '@/utils/event-set.ts';
|
||||||
|
|
||||||
|
import { type EventStore, type GetEventsOpts } from './types.ts';
|
||||||
|
|
||||||
/** In-memory data store for events. */
|
/** In-memory data store for events. */
|
||||||
class Memorelay implements EventStore {
|
class Memorelay implements EventStore {
|
||||||
#debug = Debug('ditto:memorelay');
|
#debug = Debug('ditto:memorelay');
|
||||||
|
|
|
@ -1,7 +1,8 @@
|
||||||
import { type DittoEvent, type EventStore, type GetEventsOpts, type StoreEventOpts } from '@/store.ts';
|
|
||||||
import { type DittoFilter, normalizeFilters } from '@/filter.ts';
|
import { type DittoFilter, normalizeFilters } from '@/filter.ts';
|
||||||
import { EventSet } from '@/utils/event-set.ts';
|
import { EventSet } from '@/utils/event-set.ts';
|
||||||
|
|
||||||
|
import { type DittoEvent, type EventStore, type GetEventsOpts, type StoreEventOpts } from './types.ts';
|
||||||
|
|
||||||
interface OptimizerOpts {
|
interface OptimizerOpts {
|
||||||
db: EventStore;
|
db: EventStore;
|
||||||
cache: EventStore;
|
cache: EventStore;
|
||||||
|
|
|
@ -2,8 +2,8 @@ import { Conf } from '@/config.ts';
|
||||||
import { findUser } from '@/db/users.ts';
|
import { findUser } from '@/db/users.ts';
|
||||||
import { lodash, nip19, type UnsignedEvent } from '@/deps.ts';
|
import { lodash, nip19, type UnsignedEvent } from '@/deps.ts';
|
||||||
import { jsonMetaContentSchema } from '@/schemas/nostr.ts';
|
import { jsonMetaContentSchema } from '@/schemas/nostr.ts';
|
||||||
|
import { type DittoEvent } from '@/storages/types.ts';
|
||||||
import { verifyNip05Cached } from '@/utils/nip05.ts';
|
import { verifyNip05Cached } from '@/utils/nip05.ts';
|
||||||
import { type DittoEvent } from '@/store.ts';
|
|
||||||
import { Nip05, nostrDate, nostrNow, parseNip05 } from '@/utils.ts';
|
import { Nip05, nostrDate, nostrNow, parseNip05 } from '@/utils.ts';
|
||||||
import { renderEmojis } from '@/views/mastodon/emojis.ts';
|
import { renderEmojis } from '@/views/mastodon/emojis.ts';
|
||||||
|
|
||||||
|
|
|
@ -6,7 +6,7 @@ import { getMediaLinks, parseNoteContent } from '@/note.ts';
|
||||||
import { getAuthor } from '@/queries.ts';
|
import { getAuthor } from '@/queries.ts';
|
||||||
import { jsonMediaDataSchema } from '@/schemas/nostr.ts';
|
import { jsonMediaDataSchema } from '@/schemas/nostr.ts';
|
||||||
import { eventsDB } from '@/storages.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 { nostrDate } from '@/utils.ts';
|
||||||
import { unfurlCardCached } from '@/utils/unfurl.ts';
|
import { unfurlCardCached } from '@/utils/unfurl.ts';
|
||||||
import { accountFromPubkey, renderAccount } from '@/views/mastodon/accounts.ts';
|
import { accountFromPubkey, renderAccount } from '@/views/mastodon/accounts.ts';
|
||||||
|
|
Loading…
Reference in New Issue