Rename files

This commit is contained in:
2023-06-21 16:48:35 +01:00
parent 0cd43a731e
commit 7ec602cc16
51 changed files with 98 additions and 98 deletions

View File

@ -2,10 +2,10 @@ import { v4 as uuid } from "uuid";
import debug from "debug";
import { unwrap, ExternalStore, unixNowMs } from "@snort/shared";
import { DefaultConnectTimeout } from "./Const";
import { ConnectionStats } from "./ConnectionStats";
import { NostrEvent, ReqCommand, TaggedRawEvent, u256 } from "./Nostr";
import { RelayInfo } from "./RelayInfo";
import { DefaultConnectTimeout } from "./const";
import { ConnectionStats } from "./connection-stats";
import { NostrEvent, ReqCommand, TaggedRawEvent, u256 } from "./nostr";
import { RelayInfo } from "./relay-info";
export type AuthHandler = (challenge: string, relay: string) => Promise<NostrEvent | undefined>;

View File

@ -1,6 +1,6 @@
import * as utils from "@noble/curves/abstract/utils";
import { bech32 } from "@scure/base";
import { HexKey } from "./Nostr";
import { HexKey } from "./nostr";
export enum NostrPrefix {
PublicKey = "npub",

View File

@ -1,4 +1,4 @@
import { RelaySettings } from "./Connection";
import { RelaySettings } from "./connection";
export interface NostrEvent {
id: u256;

View File

@ -3,11 +3,11 @@ import debug from "debug";
import { unixNowMs, unwrap } from "@snort/shared";
import { Connection, ReqFilter, Nips, TaggedRawEvent } from ".";
import { reqFilterEq } from "./Utils";
import { NoteStore } from "./NoteCollection";
import { flatMerge } from "./RequestMerger";
import { BuiltRawReqFilter } from "./RequestBuilder";
import { expandFilter } from "./RequestExpander";
import { reqFilterEq } from "./utisl";
import { NoteStore } from "./note-collection";
import { flatMerge } from "./request-merger";
import { BuiltRawReqFilter } from "./request-builder";
import { expandFilter } from "./request-expander";
/**
* Tracing for relay query status

View File

@ -1,8 +1,8 @@
import { FeedCache } from "@snort/shared";
import { sha256, decodeInvoice, InvoiceDetails } from "@snort/shared";
import { HexKey, NostrEvent } from "Nostr";
import { findTag } from "./Utils";
import { MetadataCache } from "./Cache";
import { HexKey, NostrEvent } from "./nostr";
import { findTag } from "./utisl";
import { MetadataCache } from "./cache";
function getInvoice(zap: NostrEvent): InvoiceDetails | undefined {
const bolt11 = findTag(zap, "bolt11");

View File

@ -1,5 +1,5 @@
import { MetadataCache, RelayMetrics, UsersRelays } from ".";
import { NostrEvent } from "../Nostr";
import { NostrEvent } from "../nostr";
import Dexie, { Table } from "dexie";
const NAME = "snort-system";

View File

@ -1,8 +1,8 @@
import { EventKind, HexKey, NostrPrefix, NostrEvent } from ".";
import { HashtagRegex } from "./Const";
import { HashtagRegex } from "./const";
import { getPublicKey, unixNow } from "@snort/shared";
import { EventExt } from "./EventExt";
import { tryParseNostrLink } from "./NostrLink";
import { EventExt } from "./event-ext";
import { tryParseNostrLink } from "./nostr-link";
export class EventBuilder {
#kind?: EventKind;

View File

@ -15,9 +15,9 @@ import {
UserMetadata,
} from ".";
import { EventBuilder } from "./EventBuilder";
import { EventExt } from "./EventExt";
import { findTag } from "./Utils";
import { EventBuilder } from "./event-builder";
import { EventExt } from "./event-ext";
import { findTag } from "./utisl";
const Nip7Queue: Array<WorkQueueItem> = [];
processWorkQueue(Nip7Queue);

View File

@ -1,32 +1,32 @@
import { AuthHandler, RelaySettings, ConnectionStateSnapshot } from "./Connection";
import { RequestBuilder } from "./RequestBuilder";
import { NoteStore } from "./NoteCollection";
import { Query } from "./Query";
import { NostrEvent, ReqFilter } from "./Nostr";
import { AuthHandler, RelaySettings, ConnectionStateSnapshot } from "./connection";
import { RequestBuilder } from "./request-builder";
import { NoteStore } from "./note-collection";
import { Query } from "./query";
import { NostrEvent, ReqFilter } from "./nostr";
export * from "./NostrSystem";
export { default as EventKind } from "./EventKind";
export * from "./Nostr";
export * from "./Links";
export * from "./Nips";
export * from "./RelayInfo";
export * from "./EventExt";
export * from "./Connection";
export * from "./NoteCollection";
export * from "./RequestBuilder";
export * from "./EventPublisher";
export * from "./EventBuilder";
export * from "./NostrLink";
export * from "./ProfileCache";
export * from "./Zaps";
export * from "./nostr-system";
export { default as EventKind } from "./event-kind";
export * from "./nostr";
export * from "./links";
export * from "./nips";
export * from "./relay-info";
export * from "./event-ext";
export * from "./connection";
export * from "./note-collection";
export * from "./request-builder";
export * from "./event-publisher";
export * from "./event-builder";
export * from "./nostr-link";
export * from "./profile-cache";
export * from "./zaps";
export * from "./impl/nip4";
export * from "./impl/nip44";
export * from "./Cache";
export * from "./Cache/UserRelayCache";
export * from "./Cache/UserCache";
export * from "./Cache/RelayMetricCache";
export * from "./cache/index";
export * from "./cache/user-relays";
export * from "./cache/user-metadata";
export * from "./cache/relay-metric";
export interface SystemInterface {
/**

View File

@ -1,13 +1,13 @@
import debug from "debug";
import { unwrap, sanitizeRelayUrl, ExternalStore, FeedCache } from "@snort/shared";
import { NostrEvent, TaggedRawEvent } from "./Nostr";
import { AuthHandler, Connection, RelaySettings, ConnectionStateSnapshot } from "./Connection";
import { Query } from "./Query";
import { RelayCache } from "./GossipModel";
import { NoteStore } from "./NoteCollection";
import { BuiltRawReqFilter, RequestBuilder } from "./RequestBuilder";
import { RelayMetricHandler } from "./RelayMetricHandler";
import { NostrEvent, TaggedRawEvent } from "./nostr";
import { AuthHandler, Connection, RelaySettings, ConnectionStateSnapshot } from "./connection";
import { Query } from "./query";
import { RelayCache } from "./gossip-model";
import { NoteStore } from "./note-collection";
import { BuiltRawReqFilter, RequestBuilder } from "./request-builder";
import { RelayMetricHandler } from "./relay-metric-handler";
import {
MetadataCache,
ProfileLoaderService,

View File

@ -1,6 +1,6 @@
import { appendDedupe } from "@snort/shared";
import { TaggedRawEvent, u256 } from ".";
import { findTag } from "./Utils";
import { findTag } from "./utisl";
export interface StoreSnapshot<TSnapshot> {
data: TSnapshot | undefined;

View File

@ -2,8 +2,8 @@
import debug from "debug";
import { unixNowMs, FeedCache } from "@snort/shared";
import { EventKind, HexKey, SystemInterface, TaggedRawEvent, PubkeyReplaceableNoteStore, RequestBuilder } from ".";
import { ProfileCacheExpire } from "./Const";
import { mapEventToProfile, MetadataCache } from "./Cache";
import { ProfileCacheExpire } from "./const";
import { mapEventToProfile, MetadataCache } from "./cache";
const MetadataRelays = [
"wss://purplepag.es"

View File

@ -1,6 +1,6 @@
import { FeedCache } from "@snort/shared";
import { Connection } from "Connection";
import { RelayMetrics } from "Cache";
import { Connection } from "connection";
import { RelayMetrics } from "cache";
export class RelayMetricHandler {
readonly #cache: FeedCache<RelayMetrics>;

View File

@ -3,10 +3,10 @@ import { v4 as uuid } from "uuid";
import { appendDedupe, sanitizeRelayUrl, unixNowMs } from "@snort/shared";
import { ReqFilter, u256, HexKey, EventKind } from ".";
import { diffFilters } from "./RequestSplitter";
import { RelayCache, splitAllByWriteRelays, splitByWriteRelays } from "./GossipModel";
import { mergeSimilar } from "./RequestMerger";
import { FlatReqFilter, expandFilter } from "./RequestExpander";
import { diffFilters } from "./request-splitter";
import { RelayCache, splitAllByWriteRelays, splitByWriteRelays } from "./gossip-model";
import { mergeSimilar } from "./request-merger";
import { FlatReqFilter, expandFilter } from "./request-expander";
/**
* Which strategy is used when building REQ filters

View File

@ -1,4 +1,4 @@
import { ReqFilter } from "./Nostr";
import { ReqFilter } from "./nostr";
export interface FlatReqFilter {
keys: number

View File

@ -1,4 +1,4 @@
import { NostrEvent, ReqFilter } from "./Nostr";
import { NostrEvent, ReqFilter } from "./nostr";
export function eventMatchesFilter(ev: NostrEvent, filter: ReqFilter) {
if (!(filter.ids?.includes(ev.id) ?? false)) {

View File

@ -1,6 +1,6 @@
import { distance } from "@snort/shared";
import { ReqFilter } from ".";
import { FlatReqFilter } from "./RequestExpander";
import { FlatReqFilter } from "./request-expander";
/**
* Keys which can change the entire meaning of the filter outside the array types

View File

@ -1,6 +1,6 @@
import { flatFilterEq } from "./Utils";
import { FlatReqFilter } from "./RequestExpander";
import { flatMerge } from "./RequestMerger";
import { flatFilterEq } from "./utisl";
import { FlatReqFilter } from "./request-expander";
import { flatMerge } from "./request-merger";
export function diffFilters(prev: Array<FlatReqFilter>, next: Array<FlatReqFilter>, calcRemoved?: boolean) {
const added = [];

View File

@ -1,11 +1,11 @@
import { ExternalStore } from "@snort/shared";
import { SystemSnapshot, SystemInterface } from ".";
import { AuthHandler, ConnectionStateSnapshot, RelaySettings } from "./Connection";
import { NostrEvent } from "./Nostr";
import { NoteStore } from "./NoteCollection";
import { Query } from "./Query";
import { RequestBuilder } from "./RequestBuilder";
import { AuthHandler, ConnectionStateSnapshot, RelaySettings } from "./connection";
import { NostrEvent } from "./nostr";
import { NoteStore } from "./note-collection";
import { Query } from "./query";
import { RequestBuilder } from "./request-builder";
export class SystemWorker extends ExternalStore<SystemSnapshot> implements SystemInterface {
#port: MessagePort;

View File

@ -1,7 +1,7 @@
import { equalProp } from "@snort/shared";
import { FlatReqFilter } from "./RequestExpander";
import { NostrEvent, ReqFilter } from "./Nostr";
import { FlatReqFilter } from "./request-expander";
import { NostrEvent, ReqFilter } from "./nostr";
export function findTag(e: NostrEvent, tag: string) {
const maybeTag = e.tags.find(evTag => {