Move zap parsing to @snort/system

This commit is contained in:
2023-06-21 16:08:48 +01:00
parent e9bc25bd88
commit 75fd4fb7aa
32 changed files with 206 additions and 193 deletions

View File

@ -3,7 +3,7 @@ import { db, EventInteraction } from "Db";
import { LoginStore } from "Login";
import { sha256 } from "SnortUtils";
class EventInteractionCache extends FeedCache<EventInteraction> {
export class EventInteractionCache extends FeedCache<EventInteraction> {
constructor() {
super("EventInteraction", db.eventInteraction);
}
@ -40,5 +40,3 @@ class EventInteractionCache extends FeedCache<EventInteraction> {
return [...this.cache.values()];
}
}
export const InteractionCache = new EventInteractionCache();

View File

@ -1,7 +1,7 @@
import { Payment, db } from "Db";
import { FeedCache } from "@snort/shared";
class Payments extends FeedCache<Payment> {
export class Payments extends FeedCache<Payment> {
constructor() {
super("PaymentsCache", db.payments);
}
@ -14,5 +14,3 @@ class Payments extends FeedCache<Payment> {
return [...this.cache.values()];
}
}
export const PaymentsCache = new Payments();

View File

@ -1,11 +1,14 @@
import { UserProfileCache, UserRelaysCache, RelayMetricCache } from "@snort/system";
import { InteractionCache } from "./EventInteractionCache";
import { EventInteractionCache } from "./EventInteractionCache";
import { ChatCache } from "./ChatCache";
import { Payments } from "./PaymentsCache";
export const UserCache = new UserProfileCache();
export const UserRelays = new UserRelaysCache();
export const RelayMetrics = new RelayMetricCache();
export const Chats = new ChatCache();
export const PaymentsCache = new Payments();
export const InteractionCache = new EventInteractionCache();
export async function preload(follows?: Array<string>) {
const preloads = [