forked from coracle/flotilla
Bump welshman
This commit is contained in:
Generated
+33
-33
@@ -27,15 +27,15 @@
|
||||
"@types/throttle-debounce": "^5.0.2",
|
||||
"@vite-pwa/assets-generator": "^0.2.6",
|
||||
"@vite-pwa/sveltekit": "^0.6.6",
|
||||
"@welshman/app": "~0.0.20",
|
||||
"@welshman/app": "~0.0.23",
|
||||
"@welshman/content": "~0.0.12",
|
||||
"@welshman/dvm": "~0.0.10",
|
||||
"@welshman/feeds": "~0.0.21",
|
||||
"@welshman/lib": "~0.0.23",
|
||||
"@welshman/net": "~0.0.31",
|
||||
"@welshman/signer": "~0.0.10",
|
||||
"@welshman/feeds": "~0.0.23",
|
||||
"@welshman/lib": "~0.0.24",
|
||||
"@welshman/net": "~0.0.33",
|
||||
"@welshman/signer": "~0.0.11",
|
||||
"@welshman/store": "~0.0.12",
|
||||
"@welshman/util": "~0.0.42",
|
||||
"@welshman/util": "~0.0.45",
|
||||
"daisyui": "^4.12.10",
|
||||
"date-picker-svelte": "^2.13.0",
|
||||
"dotenv": "^16.4.5",
|
||||
@@ -3639,18 +3639,18 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@welshman/app": {
|
||||
"version": "0.0.20",
|
||||
"resolved": "https://registry.npmjs.org/@welshman/app/-/app-0.0.20.tgz",
|
||||
"integrity": "sha512-hStVq7HUQAYvaT1lV8Z7e0zNU/qMMc/oXIoo3/o7B42aHomHuziUKtXCMCJvBhpStpT0x3atcmvWeTvsZwPPTw==",
|
||||
"version": "0.0.23",
|
||||
"resolved": "https://registry.npmjs.org/@welshman/app/-/app-0.0.23.tgz",
|
||||
"integrity": "sha512-WafnbcQ5htVivIastgXPXAk7Ysne9SZ9w0C/yrqj6ngY7XTldVulEK1IZg1/qaaYK5WFcg7DmZbEzPIRGPlRlA==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@welshman/dvm": "~0.0.10",
|
||||
"@welshman/feeds": "~0.0.20",
|
||||
"@welshman/lib": "~0.0.23",
|
||||
"@welshman/net": "~0.0.30",
|
||||
"@welshman/signer": "~0.0.10",
|
||||
"@welshman/store": "~0.0.11",
|
||||
"@welshman/util": "~0.0.42",
|
||||
"@welshman/feeds": "~0.0.23",
|
||||
"@welshman/lib": "~0.0.24",
|
||||
"@welshman/net": "~0.0.33",
|
||||
"@welshman/signer": "~0.0.11",
|
||||
"@welshman/store": "~0.0.12",
|
||||
"@welshman/util": "~0.0.45",
|
||||
"fuse.js": "^7.0.0",
|
||||
"idb": "^8.0.0",
|
||||
"svelte": "^4.2.18",
|
||||
@@ -3678,19 +3678,19 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@welshman/feeds": {
|
||||
"version": "0.0.21",
|
||||
"resolved": "https://registry.npmjs.org/@welshman/feeds/-/feeds-0.0.21.tgz",
|
||||
"integrity": "sha512-ssxHEQdYkXpSTBXL6NiXr+Cs7tat00K4ZS4YvoVIbV+PJgKW2e5NG6LKwZJUh7NzwVW+TjYUKlmiJQbGocTpFQ==",
|
||||
"version": "0.0.23",
|
||||
"resolved": "https://registry.npmjs.org/@welshman/feeds/-/feeds-0.0.23.tgz",
|
||||
"integrity": "sha512-EHS+C3ne4k8BLlEv6Medg9eQAEmOEUhh8eucYM/6bz/YF9+eQBXRdYtQI+9LAQnlmjgxA7Ul/2+mBt4kw+byNg==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@welshman/lib": "~0.0.23",
|
||||
"@welshman/util": "~0.0.42"
|
||||
"@welshman/lib": "~0.0.24",
|
||||
"@welshman/util": "~0.0.45"
|
||||
}
|
||||
},
|
||||
"node_modules/@welshman/lib": {
|
||||
"version": "0.0.23",
|
||||
"resolved": "https://registry.npmjs.org/@welshman/lib/-/lib-0.0.23.tgz",
|
||||
"integrity": "sha512-BmY14Sc8FpR7ERMl7B6pOXzoo8C1ifYd+YXMKIJSJjd5jh3DasVIX7euioXkOtPR7YiNOwbuEexZVn39k/NQLw==",
|
||||
"version": "0.0.24",
|
||||
"resolved": "https://registry.npmjs.org/@welshman/lib/-/lib-0.0.24.tgz",
|
||||
"integrity": "sha512-MQxCt02IzenSv2hpe/Y2/Gtki/evBprW4EqV7pwO7h2HAjfr1Lo1OYu0b2t6sSTbiFMdIkKIOOWYyeBEFggXQQ==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@scure/base": "^1.1.6",
|
||||
@@ -3701,9 +3701,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@welshman/net": {
|
||||
"version": "0.0.31",
|
||||
"resolved": "https://registry.npmjs.org/@welshman/net/-/net-0.0.31.tgz",
|
||||
"integrity": "sha512-7UcEuU65XJTtphjtgGPTNO0InOHm9iqvsmsmhRk7QTNALDkIcqofL3TjnI32zPYJhq5QVIO8tXj04iXsld0OdQ==",
|
||||
"version": "0.0.33",
|
||||
"resolved": "https://registry.npmjs.org/@welshman/net/-/net-0.0.33.tgz",
|
||||
"integrity": "sha512-v2wtVBHX6VpyK2nFRnL+bJLPrN80EkViJDyXN8cycJYC/aDOi/sMe9TJFK/iWHkyKPFhN/4jdf8mNm1qHEwT0A==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@welshman/lib": "~0.0.23",
|
||||
@@ -3713,9 +3713,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@welshman/signer": {
|
||||
"version": "0.0.10",
|
||||
"resolved": "https://registry.npmjs.org/@welshman/signer/-/signer-0.0.10.tgz",
|
||||
"integrity": "sha512-6PNnWN2BbmjSEBXvpO9RSQg+TOCXZHnMf0r/OeW1a4KfUkRgeevDg0TqVQLnvO9xYNi6rnrFLcrSqiVvVeag4g==",
|
||||
"version": "0.0.11",
|
||||
"resolved": "https://registry.npmjs.org/@welshman/signer/-/signer-0.0.11.tgz",
|
||||
"integrity": "sha512-1OGGocazvbakjIjN5LcR72fBvZeAG0jnPqRYShHVdeGFpsg5UiUyCiqUf7Dyd8fo6KOYk/HVsv0O6f7Pb6I52g==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@welshman/lib": "~0.0.23",
|
||||
@@ -3739,12 +3739,12 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@welshman/util": {
|
||||
"version": "0.0.42",
|
||||
"resolved": "https://registry.npmjs.org/@welshman/util/-/util-0.0.42.tgz",
|
||||
"integrity": "sha512-pNMHZuORLsIdIsrM3mid5ESSdNgrzNHCrn1mF0XG1/g+ihKgfcAQwSburnoeWtgGiS4z9MqkcUPFkwwZ6LdWZg==",
|
||||
"version": "0.0.45",
|
||||
"resolved": "https://registry.npmjs.org/@welshman/util/-/util-0.0.45.tgz",
|
||||
"integrity": "sha512-6ktWY/LQsBqVYN+PIfT7Aob48QDf4XjXOI1aDJ7tsewaG4FKuMDy9rfHE7/FjVMGhYrKsugaL2GBVFcS4UfRTg==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@welshman/lib": "~0.0.23",
|
||||
"@welshman/lib": "~0.0.24",
|
||||
"nostr-tools": "^2.7.2"
|
||||
}
|
||||
},
|
||||
|
||||
+6
-6
@@ -52,15 +52,15 @@
|
||||
"@types/throttle-debounce": "^5.0.2",
|
||||
"@vite-pwa/assets-generator": "^0.2.6",
|
||||
"@vite-pwa/sveltekit": "^0.6.6",
|
||||
"@welshman/app": "~0.0.20",
|
||||
"@welshman/app": "~0.0.23",
|
||||
"@welshman/content": "~0.0.12",
|
||||
"@welshman/dvm": "~0.0.10",
|
||||
"@welshman/feeds": "~0.0.21",
|
||||
"@welshman/lib": "~0.0.23",
|
||||
"@welshman/net": "~0.0.31",
|
||||
"@welshman/signer": "~0.0.10",
|
||||
"@welshman/feeds": "~0.0.23",
|
||||
"@welshman/lib": "~0.0.24",
|
||||
"@welshman/net": "~0.0.33",
|
||||
"@welshman/signer": "~0.0.11",
|
||||
"@welshman/store": "~0.0.12",
|
||||
"@welshman/util": "~0.0.42",
|
||||
"@welshman/util": "~0.0.45",
|
||||
"daisyui": "^4.12.10",
|
||||
"date-picker-svelte": "^2.13.0",
|
||||
"dotenv": "^16.4.5",
|
||||
|
||||
+5
-8
@@ -22,7 +22,7 @@ import {
|
||||
} from "@welshman/util"
|
||||
import type {TrustedEvent, EventTemplate, List} from "@welshman/util"
|
||||
import type {SubscribeRequestWithHandlers, Subscription} from "@welshman/net"
|
||||
import {PublishStatus, AuthStatus, ConnectionStatus} from "@welshman/net"
|
||||
import {PublishStatus, AuthStatus, SocketStatus} from "@welshman/net"
|
||||
import {Nip59, makeSecret, stamp, Nip46Broker} from "@welshman/signer"
|
||||
import type {Nip46Handler} from "@welshman/signer"
|
||||
import {
|
||||
@@ -268,8 +268,7 @@ export const setInboxRelayPolicy = (url: string, enabled: boolean) => {
|
||||
export const checkRelayAccess = async (url: string, claim = "") => {
|
||||
const connection = ctx.net.pool.get(url)
|
||||
|
||||
await connection.auth.attemptIfRequested()
|
||||
await connection.auth.waitIfPending()
|
||||
await connection.auth.attempt()
|
||||
|
||||
const thunk = publishThunk({
|
||||
event: createEvent(AUTH_JOIN, {tags: [["claim", claim]]}),
|
||||
@@ -298,11 +297,10 @@ export const checkRelayProfile = async (url: string) => {
|
||||
|
||||
export const checkRelayConnection = async (url: string) => {
|
||||
const connection = ctx.net.pool.get(url)
|
||||
const okStatuses = [ConnectionStatus.Ok, ConnectionStatus.Slow]
|
||||
|
||||
await connection.ensureConnected()
|
||||
await connection.socket.open()
|
||||
|
||||
if (!okStatuses.includes(connection.meta.getStatus())) {
|
||||
if (connection.socket.status !== SocketStatus.Open) {
|
||||
return `Failed to connect`
|
||||
}
|
||||
}
|
||||
@@ -311,8 +309,7 @@ export const checkRelayAuth = async (url: string) => {
|
||||
const connection = ctx.net.pool.get(url)
|
||||
const okStatuses = [AuthStatus.None, AuthStatus.Ok]
|
||||
|
||||
await connection.auth.attemptIfRequested()
|
||||
await connection.auth.waitIfPending()
|
||||
await connection.auth.attempt()
|
||||
|
||||
if (!okStatuses.includes(connection.auth.status)) {
|
||||
return `Failed to authenticate: "${connection.auth.message}"`
|
||||
|
||||
@@ -1,47 +0,0 @@
|
||||
<script lang="ts">
|
||||
import {onMount} from "svelte"
|
||||
import {sortBy, flatten} from "@welshman/lib"
|
||||
import {feedFromFilter} from "@welshman/feeds"
|
||||
import {NOTE, getAncestorTags} from "@welshman/util"
|
||||
import {deriveEvents} from "@welshman/store"
|
||||
import {repository, feedLoader} from "@welshman/app"
|
||||
import {createScroller} from "@lib/html"
|
||||
import Spinner from "@lib/components/Spinner.svelte"
|
||||
import NoteItem from "@app/components/NoteItem.svelte"
|
||||
|
||||
export let url
|
||||
export let pubkey
|
||||
|
||||
const filter = {kinds: [NOTE], authors: [pubkey]}
|
||||
const events = deriveEvents(repository, {filters: [filter]})
|
||||
const loader = feedLoader.getLoader(feedFromFilter(filter), {})
|
||||
|
||||
let element: Element
|
||||
|
||||
onMount(() => {
|
||||
const scroller = createScroller({
|
||||
element,
|
||||
onScroll: async () => {
|
||||
const $loader = await loader
|
||||
|
||||
$loader(5)
|
||||
},
|
||||
})
|
||||
|
||||
return () => scroller.stop()
|
||||
})
|
||||
</script>
|
||||
|
||||
<div class="flex max-w-full flex-col gap-4 p-4" bind:this={element}>
|
||||
<div class="flex flex-col gap-2">
|
||||
{#each sortBy(e => -e.created_at, $events) as event (event.id)}
|
||||
{#if flatten(Object.values(getAncestorTags(event.tags))).length === 0}
|
||||
<NoteItem {url} {event} />
|
||||
{/if}
|
||||
{:else}
|
||||
<p class="flex center my-12">
|
||||
<Spinner loading />
|
||||
</p>
|
||||
{/each}
|
||||
</div>
|
||||
</div>
|
||||
@@ -1,10 +1,11 @@
|
||||
<script lang="ts">
|
||||
import {onMount} from "svelte"
|
||||
import {sortBy, flatten} from "@welshman/lib"
|
||||
import {deriveEvents} from "@welshman/store"
|
||||
import {feedFromFilter} from "@welshman/feeds"
|
||||
import {NOTE, getAncestorTags} from "@welshman/util"
|
||||
import type {TrustedEvent} from "@welshman/util"
|
||||
import {feedLoader} from "@welshman/app"
|
||||
import {repository, createFeedController} from "@welshman/app"
|
||||
import {createScroller} from "@lib/html"
|
||||
import Spinner from "@lib/components/Spinner.svelte"
|
||||
import NoteItem from "@app/components/NoteItem.svelte"
|
||||
@@ -13,25 +14,17 @@
|
||||
export let pubkey
|
||||
|
||||
const filter = {kinds: [NOTE], authors: [pubkey]}
|
||||
const loader = feedLoader.getLoader(feedFromFilter(filter), {
|
||||
onEvent: (e: TrustedEvent) => {
|
||||
events = sortBy(e => -e.created_at, [...events, e])
|
||||
},
|
||||
})
|
||||
const events = deriveEvents(repository, {filters: [filter]})
|
||||
|
||||
let element: Element
|
||||
let events: TrustedEvent[] = []
|
||||
|
||||
onMount(() => {
|
||||
const ctrl = createFeedController({feed: feedFromFilter(filter)})
|
||||
const scroller = createScroller({
|
||||
element,
|
||||
delay: 300,
|
||||
threshold: 3000,
|
||||
onScroll: async () => {
|
||||
const $loader = await loader
|
||||
|
||||
$loader(5)
|
||||
},
|
||||
onScroll: () => ctrl.load(5)
|
||||
})
|
||||
|
||||
return () => scroller.stop()
|
||||
@@ -40,7 +33,7 @@
|
||||
|
||||
<div class="col-4" bind:this={element}>
|
||||
<div class="flex flex-col gap-2">
|
||||
{#each events as event (event.id)}
|
||||
{#each sortBy(e => -e.created_at, $events) as event (event.id)}
|
||||
{#if flatten(Object.values(getAncestorTags(event.tags))).length === 0}
|
||||
<NoteItem {url} {event} />
|
||||
{/if}
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
|
||||
const relay = deriveRelay(url)
|
||||
|
||||
$: connections = $relay?.stats?.connect_count || 0
|
||||
$: connections = $relay?.stats?.open_count || 0
|
||||
</script>
|
||||
|
||||
<div class="card2 card2-sm bg-alt column gap-2">
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
|
||||
onMount(() => {
|
||||
const filter = {kinds: [WRAP], "#p": [$pubkey!]}
|
||||
const relays = ctx.app.router.InboxRelays().getUrls()
|
||||
const relays = ctx.app.router.UserInbox().getUrls()
|
||||
const sub = subscribe({filters: [{...filter, since: ago(WEEK)}], relays})
|
||||
|
||||
pullConservatively({filters: [filter], relays})
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
|
||||
pullConservatively({
|
||||
filters: [filter],
|
||||
relays: ctx.app.router.InboxRelays().getUrls(),
|
||||
relays: ctx.app.router.UserInbox().getUrls(),
|
||||
})
|
||||
|
||||
return () => sub.close()
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
import type {Filter} from "@welshman/util"
|
||||
import {feedsFromFilters, makeIntersectionFeed, makeRelayFeed} from "@welshman/feeds"
|
||||
import {nthEq} from "@welshman/lib"
|
||||
import {feedLoader, userMutes} from "@welshman/app"
|
||||
import {createFeedController, userMutes} from "@welshman/app"
|
||||
import {createScroller} from "@lib/html"
|
||||
import Icon from "@lib/components/Icon.svelte"
|
||||
import Button from "@lib/components/Button.svelte"
|
||||
@@ -24,11 +24,6 @@
|
||||
const mutedPubkeys = getPubkeyTagValues(getListTags($userMutes))
|
||||
const filters: Filter[] = [{kinds: [THREAD]}, {kinds: [COMMENT], "#K": [String(THREAD)]}]
|
||||
const feed = makeIntersectionFeed(makeRelayFeed(url), feedsFromFilters(filters))
|
||||
const loader = feedLoader.getLoader(feed, {
|
||||
onExhausted: () => {
|
||||
loading = false
|
||||
},
|
||||
})
|
||||
|
||||
const openMenu = () => pushDrawer(MenuSpace, {url})
|
||||
|
||||
@@ -39,6 +34,13 @@
|
||||
let element: Element
|
||||
|
||||
onMount(() => {
|
||||
const ctrl = createFeedController({
|
||||
feed: feedsFromFilters(filters),
|
||||
onExhausted: () => {
|
||||
loading = false
|
||||
},
|
||||
})
|
||||
|
||||
const unsub = subscribePersistent({
|
||||
filters: filters.map(assoc('since', ago(30))),
|
||||
relays: [url],
|
||||
@@ -48,13 +50,7 @@
|
||||
element,
|
||||
delay: 300,
|
||||
threshold: 3000,
|
||||
onScroll: async () => {
|
||||
const $loader = await loader
|
||||
|
||||
await $loader(5)
|
||||
|
||||
limit += 5
|
||||
},
|
||||
onScroll: () => ctrl.load(5),
|
||||
})
|
||||
|
||||
return () => {
|
||||
|
||||
Reference in New Issue
Block a user