@welshman/app 0.0.34 → 0.0.35
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/src/collection.d.ts +3 -4
- package/build/src/{collection.mjs → collection.js} +5 -5
- package/build/src/collection.js.map +1 -0
- package/build/src/commands.d.ts +12 -13
- package/build/src/{commands.mjs → commands.js} +7 -7
- package/build/src/commands.js.map +1 -0
- package/build/src/context.d.ts +1 -1
- package/build/src/{context.mjs → context.js} +6 -6
- package/build/src/context.js.map +1 -0
- package/build/src/core.d.ts +0 -1
- package/build/src/{core.mjs → core.js} +6 -6
- package/build/src/core.js.map +1 -0
- package/build/src/feeds.d.ts +3 -3
- package/build/src/{feeds.mjs → feeds.js} +26 -22
- package/build/src/feeds.js.map +1 -0
- package/build/src/follows.d.ts +1 -2
- package/build/src/{follows.mjs → follows.js} +7 -7
- package/build/src/follows.js.map +1 -0
- package/build/src/{freshness.mjs → freshness.js} +4 -4
- package/build/src/freshness.js.map +1 -0
- package/build/src/handles.d.ts +0 -1
- package/build/src/{handles.mjs → handles.js} +14 -11
- package/build/src/handles.js.map +1 -0
- package/build/src/index.d.ts +34 -26
- package/build/src/index.js +27 -0
- package/build/src/index.js.map +1 -0
- package/build/src/mutes.d.ts +1 -2
- package/build/src/{mutes.mjs → mutes.js} +8 -8
- package/build/src/mutes.js.map +1 -0
- package/build/src/plaintext.d.ts +1 -1
- package/build/src/{plaintext.mjs → plaintext.js} +5 -5
- package/build/src/plaintext.js.map +1 -0
- package/build/src/profiles.d.ts +0 -1
- package/build/src/{profiles.mjs → profiles.js} +9 -11
- package/build/src/profiles.js.map +1 -0
- package/build/src/relaySelections.d.ts +1 -2
- package/build/src/{relaySelections.mjs → relaySelections.js} +7 -7
- package/build/src/relaySelections.js.map +1 -0
- package/build/src/relays.d.ts +1 -2
- package/build/src/{relays.mjs → relays.js} +67 -37
- package/build/src/relays.js.map +1 -0
- package/build/src/router.d.ts +30 -30
- package/build/src/router.js +244 -0
- package/build/src/router.js.map +1 -0
- package/build/src/search.d.ts +3 -4
- package/build/src/{search.mjs → search.js} +15 -18
- package/build/src/search.js.map +1 -0
- package/build/src/session.d.ts +9 -9
- package/build/src/{session.mjs → session.js} +3 -3
- package/build/src/session.js.map +1 -0
- package/build/src/storage.d.ts +7 -38
- package/build/src/{storage.mjs → storage.js} +17 -15
- package/build/src/storage.js.map +1 -0
- package/build/src/{subscribe.mjs → subscribe.js} +2 -2
- package/build/src/subscribe.js.map +1 -0
- package/build/src/sync.d.ts +1 -1
- package/build/src/{sync.mjs → sync.js} +8 -9
- package/build/src/sync.js.map +1 -0
- package/build/src/tags.d.ts +1 -1
- package/build/src/{tags.mjs → tags.js} +5 -5
- package/build/src/tags.js.map +1 -0
- package/build/src/thunk.d.ts +4 -5
- package/build/src/{thunk.mjs → thunk.js} +11 -11
- package/build/src/thunk.js.map +1 -0
- package/build/src/{topics.mjs → topics.js} +4 -4
- package/build/src/topics.js.map +1 -0
- package/build/src/user.d.ts +0 -1
- package/build/src/{user.mjs → user.js} +8 -8
- package/build/src/user.js.map +1 -0
- package/build/src/{util.mjs → util.js} +1 -1
- package/build/src/util.js.map +1 -0
- package/build/src/{wot.mjs → wot.js} +8 -8
- package/build/src/wot.js.map +1 -0
- package/build/src/zappers.d.ts +1 -2
- package/build/src/{zappers.mjs → zappers.js} +7 -7
- package/build/src/zappers.js.map +1 -0
- package/build/tsconfig.tsbuildinfo +1 -0
- package/package.json +11 -16
- package/build/src/collection.cjs +0 -56
- package/build/src/collection.cjs.map +0 -1
- package/build/src/collection.mjs.map +0 -1
- package/build/src/commands.cjs +0 -34
- package/build/src/commands.cjs.map +0 -1
- package/build/src/commands.mjs.map +0 -1
- package/build/src/context.cjs +0 -43
- package/build/src/context.cjs.map +0 -1
- package/build/src/context.mjs.map +0 -1
- package/build/src/core.cjs +0 -36
- package/build/src/core.cjs.map +0 -1
- package/build/src/core.mjs.map +0 -1
- package/build/src/feeds.cjs +0 -93
- package/build/src/feeds.cjs.map +0 -1
- package/build/src/feeds.mjs.map +0 -1
- package/build/src/follows.cjs +0 -25
- package/build/src/follows.cjs.map +0 -1
- package/build/src/follows.mjs.map +0 -1
- package/build/src/freshness.cjs +0 -20
- package/build/src/freshness.cjs.map +0 -1
- package/build/src/freshness.mjs.map +0 -1
- package/build/src/handles.cjs +0 -84
- package/build/src/handles.cjs.map +0 -1
- package/build/src/handles.mjs.map +0 -1
- package/build/src/index.cjs +0 -43
- package/build/src/index.cjs.map +0 -1
- package/build/src/index.mjs +0 -27
- package/build/src/index.mjs.map +0 -1
- package/build/src/mutes.cjs +0 -28
- package/build/src/mutes.cjs.map +0 -1
- package/build/src/mutes.mjs.map +0 -1
- package/build/src/plaintext.cjs +0 -38
- package/build/src/plaintext.cjs.map +0 -1
- package/build/src/plaintext.mjs.map +0 -1
- package/build/src/profiles.cjs +0 -45
- package/build/src/profiles.cjs.map +0 -1
- package/build/src/profiles.mjs.map +0 -1
- package/build/src/relaySelections.cjs +0 -43
- package/build/src/relaySelections.cjs.map +0 -1
- package/build/src/relaySelections.mjs.map +0 -1
- package/build/src/relays.cjs +0 -178
- package/build/src/relays.cjs.map +0 -1
- package/build/src/relays.mjs.map +0 -1
- package/build/src/router.cjs +0 -259
- package/build/src/router.cjs.map +0 -1
- package/build/src/router.mjs +0 -241
- package/build/src/router.mjs.map +0 -1
- package/build/src/search.cjs +0 -84
- package/build/src/search.cjs.map +0 -1
- package/build/src/search.mjs.map +0 -1
- package/build/src/session.cjs +0 -61
- package/build/src/session.cjs.map +0 -1
- package/build/src/session.mjs.map +0 -1
- package/build/src/storage.cjs +0 -177
- package/build/src/storage.cjs.map +0 -1
- package/build/src/storage.mjs.map +0 -1
- package/build/src/subscribe.cjs +0 -47
- package/build/src/subscribe.cjs.map +0 -1
- package/build/src/subscribe.mjs.map +0 -1
- package/build/src/sync.cjs +0 -45
- package/build/src/sync.cjs.map +0 -1
- package/build/src/sync.mjs.map +0 -1
- package/build/src/tags.cjs +0 -94
- package/build/src/tags.cjs.map +0 -1
- package/build/src/tags.mjs.map +0 -1
- package/build/src/thunk.cjs +0 -153
- package/build/src/thunk.cjs.map +0 -1
- package/build/src/thunk.mjs.map +0 -1
- package/build/src/topics.cjs +0 -23
- package/build/src/topics.cjs.map +0 -1
- package/build/src/topics.mjs.map +0 -1
- package/build/src/user.cjs +0 -45
- package/build/src/user.cjs.map +0 -1
- package/build/src/user.mjs.map +0 -1
- package/build/src/util.cjs +0 -56
- package/build/src/util.cjs.map +0 -1
- package/build/src/util.mjs.map +0 -1
- package/build/src/wot.cjs +0 -79
- package/build/src/wot.cjs.map +0 -1
- package/build/src/wot.mjs.map +0 -1
- package/build/src/zappers.cjs +0 -63
- package/build/src/zappers.cjs.map +0 -1
- package/build/src/zappers.mjs.map +0 -1
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
import { type
|
|
3
|
-
import { type Maybe } from '@welshman/lib';
|
|
1
|
+
import { type Readable } from "svelte/store";
|
|
2
|
+
import { type Maybe } from "@welshman/lib";
|
|
4
3
|
export declare const collection: <T, LoadArgs extends any[]>({ name, store, getKey, load, }: {
|
|
5
4
|
name: string;
|
|
6
5
|
store: Readable<T[]>;
|
|
7
6
|
getKey: (item: T) => string;
|
|
8
|
-
load?: (
|
|
7
|
+
load?: (key: string, ...args: LoadArgs) => Promise<any>;
|
|
9
8
|
}) => {
|
|
10
9
|
indexStore: import("@welshman/store").ReadableWithGetter<Map<string, T>>;
|
|
11
10
|
deriveItem: (key: Maybe<string>, ...args: LoadArgs) => Readable<T | undefined>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { readable, derived } from
|
|
2
|
-
import { indexBy, now } from
|
|
3
|
-
import { withGetter } from
|
|
4
|
-
import { getFreshness, setFreshnessThrottled } from "./freshness.
|
|
1
|
+
import { readable, derived } from "svelte/store";
|
|
2
|
+
import { indexBy, now } from "@welshman/lib";
|
|
3
|
+
import { withGetter } from "@welshman/store";
|
|
4
|
+
import { getFreshness, setFreshnessThrottled } from "./freshness.js";
|
|
5
5
|
export const collection = ({ name, store, getKey, load, }) => {
|
|
6
6
|
const indexStore = withGetter(derived(store, $items => indexBy(getKey, $items)));
|
|
7
7
|
const pending = new Map();
|
|
@@ -49,4 +49,4 @@ export const collection = ({ name, store, getKey, load, }) => {
|
|
|
49
49
|
};
|
|
50
50
|
return { indexStore, deriveItem, loadItem };
|
|
51
51
|
};
|
|
52
|
-
//# sourceMappingURL=collection.
|
|
52
|
+
//# sourceMappingURL=collection.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"collection.js","sourceRoot":"","sources":["../../src/collection.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,QAAQ,EAAE,OAAO,EAAgB,MAAM,cAAc,CAAA;AAC7D,OAAO,EAAC,OAAO,EAAc,GAAG,EAAC,MAAM,eAAe,CAAA;AACtD,OAAO,EAAC,UAAU,EAAC,MAAM,iBAAiB,CAAA;AAC1C,OAAO,EAAC,YAAY,EAAE,qBAAqB,EAAC,MAAM,gBAAgB,CAAA;AAElE,MAAM,CAAC,MAAM,UAAU,GAAG,CAA4B,EACpD,IAAI,EACJ,KAAK,EACL,MAAM,EACN,IAAI,GAML,EAAE,EAAE;IACH,MAAM,UAAU,GAAG,UAAU,CAAC,OAAO,CAAC,KAAK,EAAE,MAAM,CAAC,EAAE,CAAC,OAAO,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC,CAAA;IAChF,MAAM,OAAO,GAAG,IAAI,GAAG,EAA6B,CAAA;IACpD,MAAM,YAAY,GAAG,IAAI,GAAG,EAAkB,CAAA;IAE9C,MAAM,QAAQ,GAAG,KAAK,EAAE,GAAW,EAAE,GAAG,IAAc,EAAE,EAAE;QACxD,MAAM,KAAK,GAAG,UAAU,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,CAAA;QAEvC,mDAAmD;QACnD,IAAI,CAAC,IAAI,EAAE,CAAC;YACV,OAAO,KAA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AAC;QAED,OAAO,KAAK,CAAA;IACd,CAAC,CAAA;IAED,MAAM,UAAU,GAAG,CAAC,GAAkB,EAAE,GAAG,IAAc,EAAE,EAAE;QAC3D,IAAI,CAAC,GAAG,EAAE,CAAC;YACT,OAAO,QAAQ,CAAC,SAAS,CAAC,CAAA;QAC5B,CAAC;QAED,sFAAsF;QACtF,oCAAoC;QACpC,QAAQ,CAAC,GAAG,EAAE,GAAG,IAAI,CAAC,CAAA;QAEtB,OAAO,OAAO,CAAC,UAAU,EAAE,MAAM,CAAC,EAAE,CAAC,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAA;IACvD,CAAC,CAAA;IAED,OAAO,EAAC,UAAU,EAAE,UAAU,EAAE,QAAQ,EAAC,CAAA;AAC3C,CAAC,CAAA"}
|
package/build/src/commands.d.ts
CHANGED
|
@@ -1,29 +1,28 @@
|
|
|
1
|
-
/// <reference types="svelte" />
|
|
2
1
|
export declare const unfollow: (value: string) => Promise<{
|
|
3
2
|
event: import("@welshman/util").TrustedEvent;
|
|
4
|
-
request: import("./thunk").ThunkRequest;
|
|
3
|
+
request: import("./thunk.js").ThunkRequest;
|
|
5
4
|
controller: AbortController;
|
|
6
|
-
result: import("@welshman/lib").Deferred<import("./thunk").ThunkStatusByUrl>;
|
|
7
|
-
status: import("svelte/store").Writable<import("./thunk").ThunkStatusByUrl>;
|
|
5
|
+
result: import("@welshman/lib").Deferred<import("./thunk.js").ThunkStatusByUrl>;
|
|
6
|
+
status: import("svelte/store").Writable<import("./thunk.js").ThunkStatusByUrl>;
|
|
8
7
|
}>;
|
|
9
8
|
export declare const follow: (tag: string[]) => Promise<{
|
|
10
9
|
event: import("@welshman/util").TrustedEvent;
|
|
11
|
-
request: import("./thunk").ThunkRequest;
|
|
10
|
+
request: import("./thunk.js").ThunkRequest;
|
|
12
11
|
controller: AbortController;
|
|
13
|
-
result: import("@welshman/lib").Deferred<import("./thunk").ThunkStatusByUrl>;
|
|
14
|
-
status: import("svelte/store").Writable<import("./thunk").ThunkStatusByUrl>;
|
|
12
|
+
result: import("@welshman/lib").Deferred<import("./thunk.js").ThunkStatusByUrl>;
|
|
13
|
+
status: import("svelte/store").Writable<import("./thunk.js").ThunkStatusByUrl>;
|
|
15
14
|
}>;
|
|
16
15
|
export declare const unmute: (value: string) => Promise<{
|
|
17
16
|
event: import("@welshman/util").TrustedEvent;
|
|
18
|
-
request: import("./thunk").ThunkRequest;
|
|
17
|
+
request: import("./thunk.js").ThunkRequest;
|
|
19
18
|
controller: AbortController;
|
|
20
|
-
result: import("@welshman/lib").Deferred<import("./thunk").ThunkStatusByUrl>;
|
|
21
|
-
status: import("svelte/store").Writable<import("./thunk").ThunkStatusByUrl>;
|
|
19
|
+
result: import("@welshman/lib").Deferred<import("./thunk.js").ThunkStatusByUrl>;
|
|
20
|
+
status: import("svelte/store").Writable<import("./thunk.js").ThunkStatusByUrl>;
|
|
22
21
|
}>;
|
|
23
22
|
export declare const mute: (tag: string[]) => Promise<{
|
|
24
23
|
event: import("@welshman/util").TrustedEvent;
|
|
25
|
-
request: import("./thunk").ThunkRequest;
|
|
24
|
+
request: import("./thunk.js").ThunkRequest;
|
|
26
25
|
controller: AbortController;
|
|
27
|
-
result: import("@welshman/lib").Deferred<import("./thunk").ThunkStatusByUrl>;
|
|
28
|
-
status: import("svelte/store").Writable<import("./thunk").ThunkStatusByUrl>;
|
|
26
|
+
result: import("@welshman/lib").Deferred<import("./thunk.js").ThunkStatusByUrl>;
|
|
27
|
+
status: import("svelte/store").Writable<import("./thunk.js").ThunkStatusByUrl>;
|
|
29
28
|
}>;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { get } from
|
|
2
|
-
import { ctx } from
|
|
3
|
-
import { addToListPublicly, removeFromList, makeList, FOLLOWS, MUTES } from
|
|
4
|
-
import { userFollows, userMutes } from "./user.
|
|
5
|
-
import { nip44EncryptToSelf } from "./session.
|
|
6
|
-
import { publishThunk } from "./thunk.
|
|
1
|
+
import { get } from "svelte/store";
|
|
2
|
+
import { ctx } from "@welshman/lib";
|
|
3
|
+
import { addToListPublicly, removeFromList, makeList, FOLLOWS, MUTES } from "@welshman/util";
|
|
4
|
+
import { userFollows, userMutes } from "./user.js";
|
|
5
|
+
import { nip44EncryptToSelf } from "./session.js";
|
|
6
|
+
import { publishThunk } from "./thunk.js";
|
|
7
7
|
export const unfollow = async (value) => {
|
|
8
8
|
const list = get(userFollows) || makeList({ kind: FOLLOWS });
|
|
9
9
|
const event = await removeFromList(list, value).reconcile(nip44EncryptToSelf);
|
|
@@ -24,4 +24,4 @@ export const mute = async (tag) => {
|
|
|
24
24
|
const event = await addToListPublicly(list, tag).reconcile(nip44EncryptToSelf);
|
|
25
25
|
return publishThunk({ event, relays: ctx.app.router.FromUser().getUrls() });
|
|
26
26
|
};
|
|
27
|
-
//# sourceMappingURL=commands.
|
|
27
|
+
//# sourceMappingURL=commands.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"commands.js","sourceRoot":"","sources":["../../src/commands.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,GAAG,EAAC,MAAM,cAAc,CAAA;AAChC,OAAO,EAAC,GAAG,EAAC,MAAM,eAAe,CAAA;AACjC,OAAO,EAAC,iBAAiB,EAAE,cAAc,EAAE,QAAQ,EAAE,OAAO,EAAE,KAAK,EAAC,MAAM,gBAAgB,CAAA;AAC1F,OAAO,EAAC,WAAW,EAAE,SAAS,EAAC,MAAM,WAAW,CAAA;AAChD,OAAO,EAAC,kBAAkB,EAAC,MAAM,cAAc,CAAA;AAC/C,OAAO,EAAC,YAAY,EAAC,MAAM,YAAY,CAAA;AAEvC,MAAM,CAAC,MAAM,QAAQ,GAAG,KAAK,EAAE,KAAa,EAAE,EAAE;IAC9C,MAAM,IAAI,GAAG,GAAG,CAAC,WAAW,CAAC,IAAI,QAAQ,CAAC,EAAC,IAAI,EAAE,OAAO,EAAC,CAAC,CAAA;IAC1D,MAAM,KAAK,GAAG,MAAM,cA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AAI,QAAQ,CAAC,EAAC,IAAI,EAAE,KAAK,EAAC,CAAC,CAAA;IACtD,MAAM,KAAK,GAAG,MAAM,iBAAiB,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC,SAAS,CAAC,kBAAkB,CAAC,CAAA;IAE9E,OAAO,YAAY,CAAC,EAAC,KAAK,EAAE,MAAM,EAAE,GAAG,CAAC,GAAG,CAAC,MAAM,CAAC,QAAQ,EAAE,CAAC,OAAO,EAAE,EAAC,CAAC,CAAA;AAC3E,CAAC,CAAA"}
|
package/build/src/context.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Subscription, RelaysAndFilters, NetContext } from "@welshman/net";
|
|
2
2
|
import type { TrustedEvent, StampedEvent } from "@welshman/util";
|
|
3
|
-
import type { Router } from
|
|
3
|
+
import type { Router } from "./router.js";
|
|
4
4
|
export type AppContext = {
|
|
5
5
|
router: Router;
|
|
6
6
|
requestDelay: number;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { partition } from "@welshman/lib";
|
|
2
|
-
import { defaultOptimizeSubscriptions, getDefaultNetContext as originalGetDefaultNetContext } from "@welshman/net";
|
|
2
|
+
import { defaultOptimizeSubscriptions, getDefaultNetContext as originalGetDefaultNetContext, } from "@welshman/net";
|
|
3
3
|
import { LOCAL_RELAY_URL, isEphemeralKind, isDVMKind, unionFilters } from "@welshman/util";
|
|
4
|
-
import { tracker, repository } from "./core.
|
|
5
|
-
import { makeRouter, getFilterSelections } from "./router.
|
|
6
|
-
import { signer } from "./session.
|
|
4
|
+
import { tracker, repository } from "./core.js";
|
|
5
|
+
import { makeRouter, getFilterSelections } from "./router.js";
|
|
6
|
+
import { signer } from "./session.js";
|
|
7
7
|
export const getDefaultNetContext = (overrides = {}) => ({
|
|
8
8
|
...originalGetDefaultNetContext(),
|
|
9
|
-
signEvent: async (event) =>
|
|
9
|
+
signEvent: async (event) => signer.get()?.sign(event),
|
|
10
10
|
onEvent: (url, event) => {
|
|
11
11
|
if (isEphemeralKind(event.kind) || isDVMKind(event.kind))
|
|
12
12
|
return;
|
|
@@ -35,4 +35,4 @@ export const getDefaultAppContext = (overrides = {}) => ({
|
|
|
35
35
|
requestTimeout: 3000,
|
|
36
36
|
...overrides,
|
|
37
37
|
});
|
|
38
|
-
//# sourceMappingURL=context.
|
|
38
|
+
//# sourceMappingURL=context.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"context.js","sourceRoot":"","sources":["../../src/context.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,SAAS,EAAC,MAAM,eAAe,CAAA;AACvC,OAAO,EACL,4BAA4B,EAC5B,oBAAoB,IAAI,4BAA4B,GACrD,MAAM,eAAe,CAAA;AAEtB,OAAO,EAAC,eAAe,EAAE,eAAe,EAAE,SAAS,EAAE,YAAY,EAAC,MAAM,gBAAgB,CAAA;AAExF,OAAO,EAAC,OAAO,EAAE,UAAU,EAAC,MAAM,WAAW,CAAA;AAC7C,OAAO,EAAC,UAAU,EAAE,mBAAmB,EAAC,MAAM,aAAa,CAAA;AAC3D,OAAO,EAAC,MAAM,EAAC,MAAM,cAAc,CAAA;AAYnC,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,YAAiC,EAAE,EAAE,EAAE,CAAC,CAAC;IAC5E,GAAG,4BAA4B,EAAE;IACjC,SAAS,EAAE,KAAK,EAAE,KAAmB,EAAE,EAAE,CAAC,MAAM,CAAC,GAAG,EAAE,EAAE,IAAI,CAAC,KAAK,CAAC;IACnE,OAAO,EAAE,CAAC,GAAW,EAAE,KAAmB,EAAE,EAAE;QAC5C,IAAI,eAAe,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,SAAS,CAAC,KAAK,CAAC,IAAI,CAAC;YAAE,OAAM;QAEhE,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,EAAE,EAAE,GAAG,CAAC,CAAA;QAC5B,UAAU,CAAC,OAAO,CAAC,KAAK,CAAC,CAAA;IAC3B,CAAC;IACD,SAAS,EAAE,CAAC,GAAW,EAAE,KAAmB,EAAE,EAAE,CAAC,UAAU,CAAC,SAAS,CAAC,KAAK,CAAC;IAC5E,qBAAqB,EAAE,CAAC,IAAoB,EAAE,EAAE;QAC9C,MAAM,CAAC,UAAU,EAAE,aAAa,CAAC,GAAG,SAAS,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,OAAO,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC,EAAE,IAAI,CAAC,CAAA;QACzF,MAAM,OAAO,GAAG,YAAY,CAAC,aAAa,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,CAAA;QAC/E,MAAM,UAAU,GAAuB,4BAA4B,CAAC,UAAU,CAAC,CAAA;QAE/E,UAAU,CAAC,IAAI,CAAC,EAAC,MAAM,EAAE,CAAC,eAAe,CAAC,EAAE,OAAO,EAAC,CAAC,CAAA;QAErD,IAAI,OAAO,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YACvB,KAAK,MAAM,SAAS,IAAI,mBAAmB,CAAC,OAAO,CAAC,EAAE,CAAC;gBACrD,UAAU,CAAC,IAAI,CAAC,SAAS,CAAC,CAAA;YAC5B,CAAC;QACH,CAAC;QAED,OAAO,UAAU,CAAA;IACnB,CAAC;IACD,GAAG,SAAS;CACb,CAAC,CAAA;AAEF,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,YAAiC,EAAE,EAAE,EAAE,CAAC,CAAC;IAC5E,MAAM,EAAE,UAAU,EAAE;IACpB,YAAY,EAAE,EAAE;IAChB,WAAW,EAAE,GAAG;IAChB,cAAc,EAAE,IAAI;IACpB,GAAG,SAAS;CACb,CAAC,CAAA"}
|
package/build/src/core.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { throttle } from
|
|
1
|
+
import { throttle } from "@welshman/lib";
|
|
2
2
|
import { Repository, Relay } from "@welshman/util";
|
|
3
3
|
import { Tracker } from "@welshman/net";
|
|
4
4
|
import { custom } from "@welshman/store";
|
|
@@ -12,8 +12,8 @@ export const makeRepositoryStore = ({ throttle: t = 300 } = {}) => custom(setter
|
|
|
12
12
|
onUpdate = throttle(t, onUpdate);
|
|
13
13
|
}
|
|
14
14
|
onUpdate();
|
|
15
|
-
repository.on(
|
|
16
|
-
return () => repository.off(
|
|
15
|
+
repository.on("update", onUpdate);
|
|
16
|
+
return () => repository.off("update", onUpdate);
|
|
17
17
|
}, {
|
|
18
18
|
set: (other) => repository.load(other.dump()),
|
|
19
19
|
});
|
|
@@ -23,9 +23,9 @@ export const makeTrackerStore = ({ throttle: t = 300 } = {}) => custom(setter =>
|
|
|
23
23
|
onUpdate = throttle(t, onUpdate);
|
|
24
24
|
}
|
|
25
25
|
onUpdate();
|
|
26
|
-
tracker.on(
|
|
27
|
-
return () => tracker.off(
|
|
26
|
+
tracker.on("update", onUpdate);
|
|
27
|
+
return () => tracker.off("update", onUpdate);
|
|
28
28
|
}, {
|
|
29
29
|
set: (other) => tracker.load(other.relaysById),
|
|
30
30
|
});
|
|
31
|
-
//# sourceMappingURL=core.
|
|
31
|
+
//# sourceMappingURL=core.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"core.js","sourceRoot":"","sources":["../../src/core.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,QAAQ,EAAC,MAAM,eAAe,CAAA;AACtC,OAAO,EAAC,UAAU,EAAE,KAAK,EAAC,MAAM,gBAAgB,CAAA;AAEhD,OAAO,EAAC,OAAO,EAAC,MAAM,eAAe,CAAA;AACrC,OAAO,EAAC,MAAM,EAAC,MAAM,iBAAiB,CAAA;AAEtC,MAAM,CAAC,MAAM,UAAU,GAAG,IAAI,UAAU,EAAgB,CAAA;AAExD,MAAM,CAAC,MAAM,KAAK,GAAG,IAAI,KAAK,CAAC,UAAU,CAAC,CAAA;AAE1C,MAAM,CAAC,MAAM,OAAO,GAAG,IAAI,OAAO,EAA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I,CAAC,KAAK,CAAC,UAAU,CAAC;CACxD,CACF,CAAA"}
|
package/build/src/feeds.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { FeedController } from
|
|
2
|
-
import type { RequestOpts, FeedOptions, DVMOpts, Feed } from
|
|
1
|
+
import { FeedController } from "@welshman/feeds";
|
|
2
|
+
import type { RequestOpts, FeedOptions, DVMOpts, Feed } from "@welshman/feeds";
|
|
3
3
|
export declare const request: ({ filters, relays, onEvent }: RequestOpts) => Promise<void>;
|
|
4
4
|
export declare const requestDVM: ({ kind, onEvent, ...request }: DVMOpts) => Promise<void>;
|
|
5
5
|
export declare const getPubkeysForScope: (scope: string) => string[];
|
|
6
6
|
export declare const getPubkeysForWOTRange: (min: number, max: number) => string[];
|
|
7
|
-
type _FeedOptions = Partial<Omit<FeedOptions,
|
|
7
|
+
type _FeedOptions = Partial<Omit<FeedOptions, "feed">> & {
|
|
8
8
|
feed: Feed;
|
|
9
9
|
};
|
|
10
10
|
export declare const createFeedController: (options: _FeedOptions) => FeedController;
|
|
@@ -1,20 +1,19 @@
|
|
|
1
|
-
import { ctx, nthEq, now } from
|
|
2
|
-
import { createEvent, getPubkeyTagValues } from
|
|
3
|
-
import { Scope, FeedController } from
|
|
4
|
-
import { makeDvmRequest, DVMEvent } from
|
|
5
|
-
import { makeSecret, Nip01Signer } from
|
|
6
|
-
import { pubkey, signer } from "./session.
|
|
7
|
-
import { getFilterSelections } from "./router.
|
|
8
|
-
import { loadRelaySelections } from "./relaySelections.
|
|
9
|
-
import { wotGraph, maxWot, getFollows, getNetwork, getFollowers } from "./wot.
|
|
10
|
-
import { load } from "./subscribe.
|
|
1
|
+
import { ctx, nthEq, now } from "@welshman/lib";
|
|
2
|
+
import { createEvent, getPubkeyTagValues } from "@welshman/util";
|
|
3
|
+
import { Scope, FeedController } from "@welshman/feeds";
|
|
4
|
+
import { makeDvmRequest, DVMEvent } from "@welshman/dvm";
|
|
5
|
+
import { makeSecret, Nip01Signer } from "@welshman/signer";
|
|
6
|
+
import { pubkey, signer } from "./session.js";
|
|
7
|
+
import { getFilterSelections } from "./router.js";
|
|
8
|
+
import { loadRelaySelections } from "./relaySelections.js";
|
|
9
|
+
import { wotGraph, maxWot, getFollows, getNetwork, getFollowers } from "./wot.js";
|
|
10
|
+
import { load } from "./subscribe.js";
|
|
11
11
|
export const request = async ({ filters = [{}], relays = [], onEvent }) => {
|
|
12
12
|
if (relays.length > 0) {
|
|
13
13
|
await load({ onEvent, filters, relays });
|
|
14
14
|
}
|
|
15
15
|
else {
|
|
16
|
-
await Promise.all(getFilterSelections(filters)
|
|
17
|
-
.map(opts => load({ onEvent, ...opts })));
|
|
16
|
+
await Promise.all(getFilterSelections(filters).map(opts => load({ onEvent, ...opts })));
|
|
18
17
|
}
|
|
19
18
|
};
|
|
20
19
|
export const requestDVM = async ({ kind, onEvent, ...request }) => {
|
|
@@ -30,16 +29,16 @@ export const requestDVM = async ({ kind, onEvent, ...request }) => {
|
|
|
30
29
|
const relays = request.relays
|
|
31
30
|
? ctx.app.router.FromRelays(request.relays).getUrls()
|
|
32
31
|
: ctx.app.router.FromPubkeys(getPubkeyTagValues(tags)).getUrls();
|
|
33
|
-
if (!tags.some(nthEq(0,
|
|
32
|
+
if (!tags.some(nthEq(0, "expiration"))) {
|
|
34
33
|
tags.push(["expiration", String(now() + 60)]);
|
|
35
34
|
}
|
|
36
|
-
if (!tags.some(nthEq(0,
|
|
35
|
+
if (!tags.some(nthEq(0, "relays"))) {
|
|
37
36
|
tags.push(["relays", ...relays]);
|
|
38
37
|
}
|
|
39
|
-
if (!tags.some(nthEq(1,
|
|
38
|
+
if (!tags.some(nthEq(1, "user"))) {
|
|
40
39
|
tags.push(["param", "user", pubkey]);
|
|
41
40
|
}
|
|
42
|
-
if (!tags.some(nthEq(1,
|
|
41
|
+
if (!tags.some(nthEq(1, "max_results"))) {
|
|
43
42
|
tags.push(["param", "max_results", "200"]);
|
|
44
43
|
}
|
|
45
44
|
const event = await $signer.sign(createEvent(kind, { tags }));
|
|
@@ -57,11 +56,16 @@ export const getPubkeysForScope = (scope) => {
|
|
|
57
56
|
return [];
|
|
58
57
|
}
|
|
59
58
|
switch (scope) {
|
|
60
|
-
case Scope.Self:
|
|
61
|
-
|
|
62
|
-
case Scope.
|
|
63
|
-
|
|
64
|
-
|
|
59
|
+
case Scope.Self:
|
|
60
|
+
return [$pubkey];
|
|
61
|
+
case Scope.Follows:
|
|
62
|
+
return getFollows($pubkey);
|
|
63
|
+
case Scope.Network:
|
|
64
|
+
return getNetwork($pubkey);
|
|
65
|
+
case Scope.Followers:
|
|
66
|
+
return getFollowers($pubkey);
|
|
67
|
+
default:
|
|
68
|
+
return [];
|
|
65
69
|
}
|
|
66
70
|
};
|
|
67
71
|
export const getPubkeysForWOTRange = (min, max) => {
|
|
@@ -82,4 +86,4 @@ export const createFeedController = (options) => new FeedController({
|
|
|
82
86
|
getPubkeysForWOTRange,
|
|
83
87
|
...options,
|
|
84
88
|
});
|
|
85
|
-
//# sourceMappingURL=feeds.
|
|
89
|
+
//# sourceMappingURL=feeds.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"feeds.js","sourceRoot":"","sources":["../../src/feeds.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,GAAG,EAAE,KAAK,EAAE,GAAG,EAAC,MAAM,eAAe,CAAA;AAC7C,OAAO,EAAC,WAAW,EAAE,kBAAkB,EAAC,MAAM,gBAAgB,CAAA;AAC9D,OAAO,EAAC,KAAK,EAAE,cAAc,EAAC,MAAM,iBAAiB,CAAA;AAErD,OAAO,EAAC,cAAc,EAAE,QAAQ,EAAC,MAAM,eAAe,CAAA;AACtD,OAAO,EAAC,UAAU,EAAE,WAAW,EAAC,MAAM,kBAAkB,CAAA;AACxD,OAAO,EAAC,MAAM,EAAE,MAAM,EAAC,MAAM,cAAc,CAAA;AAC3C,OAAO,EAAC,mBAAmB,EAAC,MAAM,aAAa,CAAA;AAC/C,OAAO,E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D,IAAI,KAAK,IAAI,YAAY,IAAI,KAAK,IAAI,YAAY,EAAE,CAAC;YACnD,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;QACnB,CAAC;IACH,CAAC;IAED,OAAO,OAAO,CAAA;AAChB,CAAC,CAAA;AAID,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,OAAqB,EAAE,EAAE,CAC5D,IAAI,cAAc,CAAC;IACjB,OAAO;IACP,UAAU;IACV,kBAAkB;IAClB,qBAAqB;IACrB,GAAG,OAAO;CACX,CAAC,CAAA"}
|
package/build/src/follows.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
import { type PublishedList } from '@welshman/util';
|
|
1
|
+
import { type PublishedList } from "@welshman/util";
|
|
3
2
|
import { type SubscribeRequestWithHandlers } from "@welshman/net";
|
|
4
3
|
export declare const follows: import("@welshman/store").WritableWithGetter<PublishedList[]>;
|
|
5
4
|
export declare const followsByPubkey: import("@welshman/store").ReadableWithGetter<Map<string, PublishedList>>, deriveFollows: (key: import("@welshman/lib").Maybe<string>, request?: Partial<SubscribeRequestWithHandlers> | undefined) => import("svelte/store").Readable<PublishedList | undefined>, loadFollows: (key: string, request?: Partial<SubscribeRequestWithHandlers> | undefined) => Promise<PublishedList | undefined>;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { FOLLOWS, asDecryptedEvent, readList } from
|
|
2
|
-
import { deriveEventsMapped } from
|
|
3
|
-
import { repository } from "./core.
|
|
4
|
-
import { load } from "./subscribe.
|
|
5
|
-
import { collection } from "./collection.
|
|
6
|
-
import { loadRelaySelections } from "./relaySelections.
|
|
1
|
+
import { FOLLOWS, asDecryptedEvent, readList } from "@welshman/util";
|
|
2
|
+
import { deriveEventsMapped } from "@welshman/store";
|
|
3
|
+
import { repository } from "./core.js";
|
|
4
|
+
import { load } from "./subscribe.js";
|
|
5
|
+
import { collection } from "./collection.js";
|
|
6
|
+
import { loadRelaySelections } from "./relaySelections.js";
|
|
7
7
|
export const follows = deriveEventsMapped(repository, {
|
|
8
8
|
filters: [{ kinds: [FOLLOWS] }],
|
|
9
9
|
itemToEvent: item => item.event,
|
|
@@ -18,4 +18,4 @@ export const { indexStore: followsByPubkey, deriveItem: deriveFollows, loadItem:
|
|
|
18
18
|
await load({ ...request, filters: [{ kinds: [FOLLOWS], authors: [pubkey] }] });
|
|
19
19
|
},
|
|
20
20
|
});
|
|
21
|
-
//# sourceMappingURL=follows.
|
|
21
|
+
//# sourceMappingURL=follows.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"follows.js","sourceRoot":"","sources":["../../src/follows.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,OAAO,EAAE,gBAAgB,EAAE,QAAQ,EAAC,MAAM,gBAAgB,CAAA;AAGlE,OAAO,EAAC,kBAAkB,EAAC,MAAM,iBAAiB,CAAA;AAClD,OAAO,EAAC,UAAU,EAAC,MAAM,WAAW,CAAA;AACpC,OAAO,EAAC,IAAI,EAAC,MAAM,gBAAgB,CAAA;AACnC,OAAO,EAAC,UAAU,EAAC,MAAM,iBAAiB,CAAA;AAC1C,OAAO,EAAC,mBAAmB,EAAC,MAAM,sBAAsB,CAAA;AAExD,MAAM,CAAC,MAAM,OAAO,GAAG,kBAAkB,CAAgB,UAAU,EAAE;IACnE,OAAO,EAAE,CAAC,EAAC,KAAK,EAAE,CAAC,OAAO,CAAC,EAAC,CAAC;IAC7B,WAAW,EAAE,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,KAAK;IAC/B,WAAW,EAAE,CAAC,KAAmB,EAAE,EAAE,CAAC,QAAQ,CAAC,gBAAgB,CAAC,KAAK,CAAC,CAAC;CACxE,CAAC,CAAA;AAEF,MAAM,CAAC,MAAM,EACX,UAAU,EAAE,eAAe,EAC3B,UAAU,EAAE,aAAa,EACzB,QAAQ,EAAE,WAAW,GACtB,GAAG,UAAU,CAAC;IACb,IAAI,EAAE,SAAS;IACf,KAAK,EAAE,OAAO;IACd,MAAM,EAAE,OAAO,CAAC,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC,MAAM;IACvC,IAAI,EAAE,KAAK,EAAE,MAAc,EAAE,UAAiD,EAAE,EAAE,EAAE;QAClF,MAAM,mBAAmB,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;QAC1C,MAAM,IAAI,CAAC,EAAC,GAAG,OAAO,EAAE,OAAO,EAAE,CAAC,EAAC,KAAK,EAAE,CAAC,OAAO,CAAC,EAAE,OAAO,EAAE,CAAC,MAAM,CAAC,EAAC,CAAC,EAAC,CAAC,CAAA;IAC5E,CAAC;CACF,CAAC,CAAA"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { writable } from
|
|
2
|
-
import { assoc, batch } from
|
|
3
|
-
import { withGetter } from
|
|
1
|
+
import { writable } from "svelte/store";
|
|
2
|
+
import { assoc, batch } from "@welshman/lib";
|
|
3
|
+
import { withGetter } from "@welshman/store";
|
|
4
4
|
export const freshness = withGetter(writable({}));
|
|
5
5
|
export const getFreshnessKey = (ns, key) => `${ns}:${key}`;
|
|
6
6
|
export const getFreshness = (ns, key) => freshness.get()[getFreshnessKey(ns, key)] || 0;
|
|
@@ -11,4 +11,4 @@ export const setFreshnessThrottled = batch(100, (updates) => freshness.update($f
|
|
|
11
11
|
}
|
|
12
12
|
return $freshness;
|
|
13
13
|
}));
|
|
14
|
-
//# sourceMappingURL=freshness.
|
|
14
|
+
//# sourceMappingURL=freshness.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"freshness.js","sourceRoot":"","sources":["../../src/freshness.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,QAAQ,EAAC,MAAM,cAAc,CAAA;AACrC,OAAO,EAAC,KAAK,EAAE,KAAK,EAAC,MAAM,eAAe,CAAA;AAC1C,OAAO,EAAC,UAAU,EAAC,MAAM,iBAAiB,CAAA;AAQ1C,MAAM,CAAC,MAAM,SAAS,GAAG,UAAU,CAAC,QAAQ,CAAyB,EAAE,CAAC,CAAC,CAAA;AAEzE,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,EAAU,EAAE,GAAW,EAAE,EAAE,CAAC,GAAG,EAAE,IAAI,GAAG,EAAE,CAAA;AAE1E,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,EAAU,EAAE,GAAW,EAAE,EAAE,CACtD,SAAS,CAAC,GAAG,EAAE,CAAC,eAAe,CAAC,EAAE,EAAE,GAAG,CAAC,CAAC,IAAI,CAAC,CAAA;AAEhD,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,EAAC,EAAE,EAAE,GAAG,EAAE,EAAE,EAAkB,EAAE,EAAE,CACtE,SAAS,CAAC,MAAM,CAAC,KAAK,CAAC,eAAe,CAAC,EAAE,EAAE,GAAG,CAAC,EAAE,EAAE,CAAC,CAAC,CAAA;AAEvD,MAAM,CAAC,MAAM,qBAAqB,GAAG,KAAK,CAAC,GAAG,EAAE,CAAC,OAA0B,EAAE,EAAE,CAC7E,SAAS,CAAC,MAAM,CAAC,UAAU,CAAC,EAAE;IAC5B,KAAK,MAAM,EAAC,EAAE,EAAE,GAAG,EAAE,EAAE,EAAC,IAAI,OAAO,EAAE,CAAC;QACpC,UAAU,CAAC,eAAe,CAAC,EAAE,EAAE,GAAG,CAAC,CAAC,GAAG,EAAE,CAAA;IAC3C,CAAC;IAED,OAAO,UAAU,CAAA;AACnB,CAAC,CAAC,CACH,CAAA"}
|
package/build/src/handles.d.ts
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { writable, derived } from
|
|
2
|
-
import { ctx, tryCatch, fetchJson, uniq, batcher, postJson, last } from
|
|
3
|
-
import { collection } from "./collection.
|
|
4
|
-
import { deriveProfile } from "./profiles.
|
|
1
|
+
import { writable, derived } from "svelte/store";
|
|
2
|
+
import { ctx, tryCatch, fetchJson, uniq, batcher, postJson, last } from "@welshman/lib";
|
|
3
|
+
import { collection } from "./collection.js";
|
|
4
|
+
import { deriveProfile } from "./profiles.js";
|
|
5
5
|
export const NIP05_REGEX = /^(?:([\w.+-]+)@)?([\w_-]+(\.[\w_-]+)+)$/;
|
|
6
6
|
export async function queryProfile(nip05) {
|
|
7
7
|
const match = nip05.match(NIP05_REGEX);
|
|
8
8
|
if (!match)
|
|
9
9
|
return undefined;
|
|
10
|
-
const [_, name =
|
|
10
|
+
const [_, name = "_", domain] = match;
|
|
11
11
|
try {
|
|
12
|
-
const { names, relays = {}, nip46 = {} } = await fetchJson(`https://${domain}/.well-known/nostr.json?name=${name}`);
|
|
12
|
+
const { names, relays = {}, nip46 = {}, } = await fetchJson(`https://${domain}/.well-known/nostr.json?name=${name}`);
|
|
13
13
|
const pubkey = names[name];
|
|
14
14
|
if (!pubkey) {
|
|
15
15
|
return undefined;
|
|
@@ -32,12 +32,15 @@ export const fetchHandles = async (nip05s) => {
|
|
|
32
32
|
// Use dufflepud if we it's set up to protect user privacy, otherwise fetch directly
|
|
33
33
|
if (base) {
|
|
34
34
|
const res = await tryCatch(async () => await postJson(`${base}/handle/info`, { handles: nip05s }));
|
|
35
|
-
for (const { handle: nip05, info } of
|
|
35
|
+
for (const { handle: nip05, info } of res?.data || []) {
|
|
36
36
|
handlesByNip05.set(nip05, info);
|
|
37
37
|
}
|
|
38
38
|
}
|
|
39
39
|
else {
|
|
40
|
-
const results = await Promise.all(nip05s.map(async (nip05) => ({
|
|
40
|
+
const results = await Promise.all(nip05s.map(async (nip05) => ({
|
|
41
|
+
nip05,
|
|
42
|
+
info: await tryCatch(async () => await queryProfile(nip05)),
|
|
43
|
+
})));
|
|
41
44
|
for (const { nip05, info } of results) {
|
|
42
45
|
if (info) {
|
|
43
46
|
handlesByNip05.set(nip05, info);
|
|
@@ -64,12 +67,12 @@ export const { indexStore: handlesByNip05, deriveItem: deriveHandle, loadItem: l
|
|
|
64
67
|
}),
|
|
65
68
|
});
|
|
66
69
|
export const deriveHandleForPubkey = (pubkey, request = {}) => derived([handlesByNip05, deriveProfile(pubkey, request)], ([$handlesByNip05, $profile]) => {
|
|
67
|
-
if (
|
|
70
|
+
if (!$profile?.nip05) {
|
|
68
71
|
return undefined;
|
|
69
72
|
}
|
|
70
73
|
loadHandle($profile.nip05);
|
|
71
74
|
return $handlesByNip05.get($profile.nip05);
|
|
72
75
|
});
|
|
73
|
-
export const displayNip05 = (nip05) =>
|
|
76
|
+
export const displayNip05 = (nip05) => nip05?.startsWith("_@") ? last(nip05.split("@")) : nip05;
|
|
74
77
|
export const displayHandle = (handle) => displayNip05(handle.nip05);
|
|
75
|
-
//# sourceMappingURL=handles.
|
|
78
|
+
//# sourceMappingURL=handles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"handles.js","sourceRoot":"","sources":["../../src/handles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,QAAQ,EAAE,OAAO,EAAC,MAAM,cAAc,CAAA;AAE9C,OAAO,EAAC,GAAG,EAAE,QAAQ,EAAE,SAAS,EAAE,IAAI,EAAE,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAC,MAAM,eAAe,CAAA;AACrF,OAAO,EAAC,UAAU,EAAC,MAAM,iBAAiB,CAAA;AAC1C,OAAO,EAAC,aAAa,EAAC,MAAM,eAAe,CAAA;AAS3C,MAAM,CAAC,MAAM,WAAW,GAAG,yCAAyC,CAAA;AAEpE,MAAM,CAAC,KAAK,UAAU,YAAY,CAAC,KAAa;IAC9C,MAAM,KAAK,GAAG,KAAK,CAAC,KAAK,CAAC,WAAW,CAAC,CAAA;IAEtC,IAAI,CAAC,KAAK;QAAE,OAAO,SAAS,CAAA;IAE5B,MAAM,CAAC,CAAC,EAAE,IAAI,GAAG,GAAG,EAAE,MAAM,CAAC,GAAG,KAAK,CAAA;IAErC,IAAI,CAAC;QACH,MAAM,EACJ,KAAK,EACL,MAAM,GAAG,EAAE,EACX,KAAK,GAAG,EAAE,GACX,GAAG,MAAM,SAAS,CAAC,WAAW,MAAM,gCAAgC,IAAI,EAAE,CAAC,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,aAAa,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,EAAE,CAAC,CAAC,eAAe,EAAE,QAAQ,CAAC,EAAE,EAAE;IACxF,IAAI,CAAC,QAAQ,EAAE,KAAK,EAAE,CAAC;QACrB,OAAO,SAAS,CAAA;IAClB,CAAC;IAED,UAAU,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAA;IAE1B,OAAO,eAAe,CAAC,GAAG,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAA;AAC5C,CAAC,CAAC,CAAA;AAEJ,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,KAAa,EAAE,EAAE,CAC5C,KAAK,EAAE,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAA;AAE1D,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,MAAc,EAAE,EAAE,CAAC,YAAY,CAAC,MAAM,CAAC,KAAK,CAAC,CAAA"}
|
package/build/src/index.d.ts
CHANGED
|
@@ -1,26 +1,34 @@
|
|
|
1
|
-
export * from
|
|
2
|
-
export * from
|
|
3
|
-
export * from
|
|
4
|
-
export * from
|
|
5
|
-
export * from
|
|
6
|
-
export * from
|
|
7
|
-
export * from
|
|
8
|
-
export * from
|
|
9
|
-
export * from
|
|
10
|
-
export * from
|
|
11
|
-
export * from
|
|
12
|
-
export * from
|
|
13
|
-
export * from
|
|
14
|
-
export * from
|
|
15
|
-
export * from
|
|
16
|
-
export * from
|
|
17
|
-
export * from
|
|
18
|
-
export * from
|
|
19
|
-
export * from
|
|
20
|
-
export * from
|
|
21
|
-
export * from
|
|
22
|
-
export * from
|
|
23
|
-
export * from
|
|
24
|
-
export * from
|
|
25
|
-
export * from
|
|
26
|
-
export * from
|
|
1
|
+
export * from "./context.js";
|
|
2
|
+
export * from "./core.js";
|
|
3
|
+
export * from "./collection.js";
|
|
4
|
+
export * from "./commands.js";
|
|
5
|
+
export * from "./feeds.js";
|
|
6
|
+
export * from "./freshness.js";
|
|
7
|
+
export * from "./follows.js";
|
|
8
|
+
export * from "./handles.js";
|
|
9
|
+
export * from "./mutes.js";
|
|
10
|
+
export * from "./plaintext.js";
|
|
11
|
+
export * from "./profiles.js";
|
|
12
|
+
export * from "./relays.js";
|
|
13
|
+
export * from "./relaySelections.js";
|
|
14
|
+
export * from "./router.js";
|
|
15
|
+
export * from "./search.js";
|
|
16
|
+
export * from "./session.js";
|
|
17
|
+
export * from "./storage.js";
|
|
18
|
+
export * from "./subscribe.js";
|
|
19
|
+
export * from "./sync.js";
|
|
20
|
+
export * from "./tags.js";
|
|
21
|
+
export * from "./thunk.js";
|
|
22
|
+
export * from "./topics.js";
|
|
23
|
+
export * from "./user.js";
|
|
24
|
+
export * from "./util.js";
|
|
25
|
+
export * from "./wot.js";
|
|
26
|
+
export * from "./zappers.js";
|
|
27
|
+
import type { NetContext } from "@welshman/net";
|
|
28
|
+
import type { AppContext } from "./context.js";
|
|
29
|
+
declare module "@welshman/lib" {
|
|
30
|
+
interface Context {
|
|
31
|
+
net: NetContext;
|
|
32
|
+
app: AppContext;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
export * from "./context.js";
|
|
2
|
+
export * from "./core.js";
|
|
3
|
+
export * from "./collection.js";
|
|
4
|
+
export * from "./commands.js";
|
|
5
|
+
export * from "./feeds.js";
|
|
6
|
+
export * from "./freshness.js";
|
|
7
|
+
export * from "./follows.js";
|
|
8
|
+
export * from "./handles.js";
|
|
9
|
+
export * from "./mutes.js";
|
|
10
|
+
export * from "./plaintext.js";
|
|
11
|
+
export * from "./profiles.js";
|
|
12
|
+
export * from "./relays.js";
|
|
13
|
+
export * from "./relaySelections.js";
|
|
14
|
+
export * from "./router.js";
|
|
15
|
+
export * from "./search.js";
|
|
16
|
+
export * from "./session.js";
|
|
17
|
+
export * from "./storage.js";
|
|
18
|
+
export * from "./subscribe.js";
|
|
19
|
+
export * from "./sync.js";
|
|
20
|
+
export * from "./tags.js";
|
|
21
|
+
export * from "./thunk.js";
|
|
22
|
+
export * from "./topics.js";
|
|
23
|
+
export * from "./user.js";
|
|
24
|
+
export * from "./util.js";
|
|
25
|
+
export * from "./wot.js";
|
|
26
|
+
export * from "./zappers.js";
|
|
27
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAA;AAC5B,cAAc,WAAW,CAAA;AACzB,cAAc,iBAAiB,CAAA;AAC/B,cAAc,eAAe,CAAA;AAC7B,cAAc,YAAY,CAAA;AAC1B,cAAc,gBAAgB,CAAA;AAC9B,cAAc,cAAc,CAAA;AAC5B,cAAc,cAAc,CAAA;AAC5B,cAAc,YAAY,CAAA;AAC1B,cAAc,gBAAgB,CAAA;AAC9B,cAAc,eAAe,CAAA;AAC7B,cAAc,aAAa,CAAA;AAC3B,cAAc,sBAAsB,CAAA;AACpC,cAAc,aAAa,CAAA;AAC3B,cAAc,aAAa,CAAA;AAC3B,cAAc,cAAc,CAAA;AAC5B,cAAc,cAAc,CAAA;AAC5B,cAAc,gBAAgB,CAAA;AAC9B,cAAc,WAAW,CAAA;AACzB,cAAc,WAAW,CAAA;AACzB,cAAc,YAAY,CAAA;AAC1B,cAAc,aAAa,CAAA;AAC3B,cAAc,WAAW,CAAA;AACzB,cAAc,WAAW,CAAA;AACzB,cAAc,UAAU,CAAA;AACxB,cAAc,cAAc,CAAA"}
|
package/build/src/mutes.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
import { type PublishedList } from '@welshman/util';
|
|
1
|
+
import { type PublishedList } from "@welshman/util";
|
|
3
2
|
import { type SubscribeRequestWithHandlers } from "@welshman/net";
|
|
4
3
|
export declare const mutes: import("@welshman/store").WritableWithGetter<PublishedList[]>;
|
|
5
4
|
export declare const mutesByPubkey: import("@welshman/store").ReadableWithGetter<Map<string, PublishedList>>, deriveMutes: (key: import("@welshman/lib").Maybe<string>, request?: Partial<SubscribeRequestWithHandlers> | undefined) => import("svelte/store").Readable<PublishedList | undefined>, loadMutes: (key: string, request?: Partial<SubscribeRequestWithHandlers> | undefined) => Promise<PublishedList | undefined>;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { MUTES, asDecryptedEvent, readList } from
|
|
2
|
-
import { deriveEventsMapped } from
|
|
3
|
-
import { repository } from "./core.
|
|
4
|
-
import { load } from "./subscribe.
|
|
5
|
-
import { collection } from "./collection.
|
|
6
|
-
import { ensurePlaintext } from "./plaintext.
|
|
7
|
-
import { loadRelaySelections } from "./relaySelections.
|
|
1
|
+
import { MUTES, asDecryptedEvent, readList } from "@welshman/util";
|
|
2
|
+
import { deriveEventsMapped } from "@welshman/store";
|
|
3
|
+
import { repository } from "./core.js";
|
|
4
|
+
import { load } from "./subscribe.js";
|
|
5
|
+
import { collection } from "./collection.js";
|
|
6
|
+
import { ensurePlaintext } from "./plaintext.js";
|
|
7
|
+
import { loadRelaySelections } from "./relaySelections.js";
|
|
8
8
|
export const mutes = deriveEventsMapped(repository, {
|
|
9
9
|
filters: [{ kinds: [MUTES] }],
|
|
10
10
|
itemToEvent: item => item.event,
|
|
@@ -21,4 +21,4 @@ export const { indexStore: mutesByPubkey, deriveItem: deriveMutes, loadItem: loa
|
|
|
21
21
|
await load({ ...request, filters: [{ kinds: [MUTES], authors: [pubkey] }] });
|
|
22
22
|
},
|
|
23
23
|
});
|
|
24
|
-
//# sourceMappingURL=mutes.
|
|
24
|
+
//# sourceMappingURL=mutes.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mutes.js","sourceRoot":"","sources":["../../src/mutes.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,KAAK,EAAE,gBAAgB,EAAE,QAAQ,EAAC,MAAM,gBAAgB,CAAA;AAGhE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C,CAAA"}
|
package/build/src/plaintext.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { TrustedEvent } from
|
|
1
|
+
import type { TrustedEvent } from "@welshman/util";
|
|
2
2
|
export declare const plaintext: import("@welshman/store").WritableWithGetter<Record<string, string>>;
|
|
3
3
|
export declare const getPlaintext: (e: TrustedEvent) => string;
|
|
4
4
|
export declare const setPlaintext: (e: TrustedEvent, content: string) => void;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { writable } from
|
|
2
|
-
import { assoc } from
|
|
3
|
-
import { withGetter } from
|
|
1
|
+
import { writable } from "svelte/store";
|
|
2
|
+
import { assoc } from "@welshman/lib";
|
|
3
|
+
import { withGetter } from "@welshman/store";
|
|
4
4
|
import { decrypt } from "@welshman/signer";
|
|
5
|
-
import { getSigner, getSession } from "./session.
|
|
5
|
+
import { getSigner, getSession } from "./session.js";
|
|
6
6
|
export const plaintext = withGetter(writable({}));
|
|
7
7
|
export const getPlaintext = (e) => plaintext.get()[e.id];
|
|
8
8
|
export const setPlaintext = (e, content) => plaintext.update(assoc(e.id, content));
|
|
@@ -29,4 +29,4 @@ export const ensurePlaintext = async (e) => {
|
|
|
29
29
|
}
|
|
30
30
|
return getPlaintext(e);
|
|
31
31
|
};
|
|
32
|
-
//# sourceMappingURL=plaintext.
|
|
32
|
+
//# sourceMappingURL=plaintext.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plaintext.js","sourceRoot":"","sources":["../../src/plaintext.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,QAAQ,EAAC,MAAM,cAAc,CAAA;AACrC,OAAO,EAAC,KAAK,EAAC,MAAM,eAAe,CAAA;AAEnC,OAAO,EAAC,UAAU,EAAC,MAAM,iBAAiB,CAAA;AAC1C,OAAO,EAAC,OAAO,EAAC,MAAM,kBAAkB,CAAA;AACxC,OAAO,EAAC,SAAS,EAAE,UAAU,EAAC,MAAM,cAAc,CAAA;AAElD,M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