applesauce-actions 0.0.0-next-20250217190527 → 0.0.0-next-20250220230505

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "applesauce-actions",
3
- "version": "0.0.0-next-20250217190527",
3
+ "version": "0.0.0-next-20250220230505",
4
4
  "description": "A package for performing common nostr actions",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -22,8 +22,8 @@
22
22
  }
23
23
  },
24
24
  "dependencies": {
25
- "applesauce-core": "0.0.0-next-20250217190527",
26
- "applesauce-factory": "0.0.0-next-20250217190527",
25
+ "applesauce-core": "0.0.0-next-20250220230505",
26
+ "applesauce-factory": "0.0.0-next-20250220230505",
27
27
  "debug": "^4.4.0",
28
28
  "nostr-tools": "^2.10.4",
29
29
  "rxjs": "^7.8.1"
@@ -1,15 +0,0 @@
1
- import { NostrEvent } from "nostr-tools";
2
- import { AddressPointer, EventPointer } from "nostr-tools/nip19";
3
- export declare const BookmarkPublicSymbol: unique symbol;
4
- export declare const BookmarkHiddenSymbol: unique symbol;
5
- export type Bookmarks = {
6
- notes: EventPointer[];
7
- articles: AddressPointer[];
8
- hashtags: string[];
9
- urls: string[];
10
- };
11
- export declare function parseBookmarkTags(tags: string[][]): Bookmarks;
12
- /** Returns the public bookmarks of the event */
13
- export declare function getBookmarks(bookmark: NostrEvent): Bookmarks;
14
- /** Returns the bookmarks of the event if its unlocked */
15
- export declare function getHiddenBookmarks(bookmark: NostrEvent): Bookmarks | undefined;
@@ -1,26 +0,0 @@
1
- import { getAddressPointerFromATag, getEventPointerFromETag, getHiddenTags } from "applesauce-core/helpers";
2
- import { kinds } from "nostr-tools";
3
- import { getOrComputeCachedValue } from "applesauce-core/helpers/cache";
4
- export const BookmarkPublicSymbol = Symbol.for("bookmark-public");
5
- export const BookmarkHiddenSymbol = Symbol.for("bookmark-hidden");
6
- export function parseBookmarkTags(tags) {
7
- const notes = tags.filter((t) => t[0] === "e" && t[1]).map(getEventPointerFromETag);
8
- const articles = tags
9
- .filter((t) => t[0] === "a" && t[1])
10
- .map(getAddressPointerFromATag)
11
- .filter((addr) => addr.kind === kinds.LongFormArticle);
12
- const hashtags = tags.filter((t) => t[0] === "t" && t[1]).map((t) => t[1]);
13
- const urls = tags.filter((t) => t[0] === "r" && t[1]).map((t) => t[1]);
14
- return { notes, articles, hashtags, urls };
15
- }
16
- /** Returns the public bookmarks of the event */
17
- export function getBookmarks(bookmark) {
18
- return getOrComputeCachedValue(bookmark, BookmarkPublicSymbol, () => parseBookmarkTags(bookmark.tags));
19
- }
20
- /** Returns the bookmarks of the event if its unlocked */
21
- export function getHiddenBookmarks(bookmark) {
22
- return getOrComputeCachedValue(bookmark, BookmarkHiddenSymbol, () => {
23
- const tags = getHiddenTags(bookmark);
24
- return tags && parseBookmarkTags(tags);
25
- });
26
- }
@@ -1,5 +0,0 @@
1
- import { NostrEvent } from "nostr-tools";
2
- export declare const ContactsRelaysSymbol: unique symbol;
3
- export declare const ContactsPeopleSymbol: unique symbol;
4
- export declare function getContactsPeople(contacts: NostrEvent): import("nostr-tools/nip19").ProfilePointer[];
5
- export declare function relaysFromContactsEvent(event: NostrEvent): Map<string, "all" | "inbox" | "outbox"> | null;
@@ -1,30 +0,0 @@
1
- import { getProfilePointerFromPTag, isPTag, safeRelayUrl } from "applesauce-core/helpers";
2
- import { getOrComputeCachedValue } from "applesauce-core/helpers/cache";
3
- export const ContactsRelaysSymbol = Symbol.for("contacts-relays");
4
- export const ContactsPeopleSymbol = Symbol.for("contacts-people");
5
- export function getContactsPeople(contacts) {
6
- return getOrComputeCachedValue(contacts, ContactsPeopleSymbol, () => contacts.tags.filter(isPTag).map(getProfilePointerFromPTag));
7
- }
8
- export function relaysFromContactsEvent(event) {
9
- return getOrComputeCachedValue(event, ContactsRelaysSymbol, () => {
10
- try {
11
- const relayJson = JSON.parse(event.content);
12
- const relays = new Map();
13
- for (const [url, opts] of Object.entries(relayJson)) {
14
- const safeUrl = safeRelayUrl(url);
15
- if (!safeUrl)
16
- continue;
17
- if (opts.write && opts.read)
18
- relays.set(safeUrl, "all");
19
- else if (opts.read)
20
- relays.set(safeUrl, "inbox");
21
- else if (opts.write)
22
- relays.set(safeUrl, "outbox");
23
- }
24
- return relays;
25
- }
26
- catch (error) {
27
- return null;
28
- }
29
- });
30
- }
@@ -1,28 +0,0 @@
1
- import { AddressPointer, EventPointer, ProfilePointer } from "nostr-tools/nip19";
2
- import { NostrEvent } from "nostr-tools";
3
- /**
4
- * Checks if an event pointer is anywhere in a list or set
5
- * NOTE: Ignores the `relay` field in EventPointer
6
- * NOTE: This will check the hidden tags if the list has hidden tags and they are unlocked
7
- */
8
- export declare function isEventPointerInList(list: NostrEvent, pointer: string | EventPointer): boolean;
9
- /**
10
- * Checks if an address pointer is anywhere in a list or set
11
- * NOTE: Ignores the `relay` field in AddressPointer
12
- * NOTE: This will check the hidden tags if the list has hidden tags and they are unlocked
13
- */
14
- export declare function isAddressPointerInList(list: NostrEvent, pointer: string | AddressPointer): boolean;
15
- /**
16
- * Checks if an profile pointer is anywhere in a list or set
17
- * NOTE: Ignores the `relay` field in ProfilePointer
18
- * NOTE: This will check the hidden tags if the list has hidden tags and they are unlocked
19
- */
20
- export declare function isProfilePointerInList(list: NostrEvent, pointer: string | ProfilePointer): boolean;
21
- /** Returns all the EventPointer in a list or set */
22
- export declare function getEventPointersFromList(list: NostrEvent): EventPointer[];
23
- /** Returns all the AddressPointer in a list or set */
24
- export declare function getAddressPointersFromList(list: NostrEvent): AddressPointer[];
25
- /** Returns all the ProfilePointer in a list or set */
26
- export declare function getProfilePointersFromList(list: NostrEvent): ProfilePointer[];
27
- /** Returns if an event is a valid list or set */
28
- export declare function isValidList(event: NostrEvent): boolean;
@@ -1,62 +0,0 @@
1
- import { getAddressPointerFromATag, getCoordinateFromAddressPointer, getEventPointerFromETag, getHiddenTags, getProfilePointerFromPTag, getReplaceableIdentifier, isATag, isETag, isPTag, processTags, } from "applesauce-core/helpers";
2
- import { isParameterizedReplaceableKind, isReplaceableKind } from "nostr-tools/kinds";
3
- function listGetAllTags(list) {
4
- const hidden = getHiddenTags(list);
5
- return hidden ? [...hidden, ...list.tags] : list.tags;
6
- }
7
- /**
8
- * Checks if an event pointer is anywhere in a list or set
9
- * NOTE: Ignores the `relay` field in EventPointer
10
- * NOTE: This will check the hidden tags if the list has hidden tags and they are unlocked
11
- */
12
- export function isEventPointerInList(list, pointer) {
13
- const id = typeof pointer === "string" ? pointer : pointer.id;
14
- return listGetAllTags(list).some((t) => t[0] === "e" && t[1] === id);
15
- }
16
- /**
17
- * Checks if an address pointer is anywhere in a list or set
18
- * NOTE: Ignores the `relay` field in AddressPointer
19
- * NOTE: This will check the hidden tags if the list has hidden tags and they are unlocked
20
- */
21
- export function isAddressPointerInList(list, pointer) {
22
- const cord = typeof pointer === "string" ? pointer : getCoordinateFromAddressPointer(pointer);
23
- return listGetAllTags(list).some((t) => t[0] === "a" && t[1] === cord);
24
- }
25
- /**
26
- * Checks if an profile pointer is anywhere in a list or set
27
- * NOTE: Ignores the `relay` field in ProfilePointer
28
- * NOTE: This will check the hidden tags if the list has hidden tags and they are unlocked
29
- */
30
- export function isProfilePointerInList(list, pointer) {
31
- const pubkey = typeof pointer === "string" ? pointer : pointer.pubkey;
32
- return listGetAllTags(list).some((t) => t[0] === "p" && t[1] === pubkey);
33
- }
34
- /** Returns all the EventPointer in a list or set */
35
- export function getEventPointersFromList(list) {
36
- return processTags(listGetAllTags(list), (tag) => (isETag(tag) ? tag : undefined), getEventPointerFromETag);
37
- }
38
- /** Returns all the AddressPointer in a list or set */
39
- export function getAddressPointersFromList(list) {
40
- return processTags(listGetAllTags(list), (t) => (isATag(t) ? t : undefined), getAddressPointerFromATag);
41
- }
42
- /** Returns all the ProfilePointer in a list or set */
43
- export function getProfilePointersFromList(list) {
44
- return processTags(listGetAllTags(list), (t) => (isPTag(t) ? t : undefined), getProfilePointerFromPTag);
45
- }
46
- /** Returns if an event is a valid list or set */
47
- export function isValidList(event) {
48
- try {
49
- if (isParameterizedReplaceableKind(event.kind)) {
50
- // event is a set
51
- // ensure the set has an identifier
52
- getReplaceableIdentifier(event);
53
- return true;
54
- }
55
- else if (isReplaceableKind(event.kind) && event.kind >= 10000 && event.kind < 20000) {
56
- // event is a list
57
- return true;
58
- }
59
- }
60
- catch (error) { }
61
- return false;
62
- }
@@ -1,10 +0,0 @@
1
- import { GroupPointer } from "applesauce-core/helpers/groups";
2
- import { NostrEvent } from "nostr-tools";
3
- export declare const GroupsPublicSymbol: unique symbol;
4
- export declare const GroupsHiddenSymbol: unique symbol;
5
- /** gets a {@link GroupPointer} from a "group" tag */
6
- export declare function getGroupPointerFromGroupTag(tag: string[]): GroupPointer;
7
- /** Returns all the public groups from a k:10009 list */
8
- export declare function getPublicGroups(bookmark: NostrEvent): GroupPointer[];
9
- /** Returns all the hidden groups from a k:10009 list */
10
- export declare function getHiddenGroups(bookmark: NostrEvent): GroupPointer[] | undefined;
@@ -1,20 +0,0 @@
1
- import { getHiddenTags, getOrComputeCachedValue, processTags } from "applesauce-core/helpers";
2
- export const GroupsPublicSymbol = Symbol.for("groups-public");
3
- export const GroupsHiddenSymbol = Symbol.for("groups-hidden");
4
- /** gets a {@link GroupPointer} from a "group" tag */
5
- export function getGroupPointerFromGroupTag(tag) {
6
- const [_, id, relay, name] = tag;
7
- return { id, relay, name };
8
- }
9
- /** Returns all the public groups from a k:10009 list */
10
- export function getPublicGroups(bookmark) {
11
- return getOrComputeCachedValue(bookmark, GroupsPublicSymbol, () => processTags(bookmark.tags.filter((t) => t[0] === "group"), getGroupPointerFromGroupTag));
12
- }
13
- /** Returns all the hidden groups from a k:10009 list */
14
- export function getHiddenGroups(bookmark) {
15
- return getOrComputeCachedValue(bookmark, GroupsHiddenSymbol, () => {
16
- const tags = getHiddenTags(bookmark);
17
- return (tags &&
18
- processTags(bookmark.tags.filter((t) => t[0] === "group"), getGroupPointerFromGroupTag));
19
- });
20
- }
@@ -1,7 +0,0 @@
1
- export * from "./general.js";
2
- export * from "./mute.js";
3
- export * from "./pin.js";
4
- export * from "./contacts.js";
5
- export * from "./bookmark.js";
6
- export * from "./groups.js";
7
- export * as Operations from "./operations/index.js";
@@ -1,7 +0,0 @@
1
- export * from "./general.js";
2
- export * from "./mute.js";
3
- export * from "./pin.js";
4
- export * from "./contacts.js";
5
- export * from "./bookmark.js";
6
- export * from "./groups.js";
7
- export * as Operations from "./operations/index.js";
@@ -1,14 +0,0 @@
1
- import { NostrEvent } from "nostr-tools";
2
- export declare const MutePublicSymbol: unique symbol;
3
- export declare const MuteHiddenSymbol: unique symbol;
4
- export type Mutes = {
5
- pubkeys: Set<string>;
6
- threads: Set<string>;
7
- hashtags: Set<string>;
8
- words: Set<string>;
9
- };
10
- export declare function parseMutedTags(tags: string[][]): Mutes;
11
- /** Returns muted things */
12
- export declare function getMutedThings(mute: NostrEvent): Mutes;
13
- /** Returns the hidden muted content if the event is unlocked */
14
- export declare function getHiddenMutedThings(mute: NostrEvent): Mutes | undefined;
@@ -1,22 +0,0 @@
1
- import { getHiddenTags, isETag, isPTag, isTTag } from "applesauce-core/helpers";
2
- import { getOrComputeCachedValue } from "applesauce-core/helpers/cache";
3
- export const MutePublicSymbol = Symbol.for("mute-public");
4
- export const MuteHiddenSymbol = Symbol.for("mute-hidden");
5
- export function parseMutedTags(tags) {
6
- const pubkeys = new Set(tags.filter(isPTag).map((t) => t[1]));
7
- const threads = new Set(tags.filter(isETag).map((t) => t[1]));
8
- const hashtags = new Set(tags.filter(isTTag).map((t) => t[1].toLocaleLowerCase()));
9
- const words = new Set(tags.filter((t) => t[0] === "word" && t[1]).map((t) => t[1].toLocaleLowerCase()));
10
- return { pubkeys, threads, hashtags, words };
11
- }
12
- /** Returns muted things */
13
- export function getMutedThings(mute) {
14
- return getOrComputeCachedValue(mute, MutePublicSymbol, (e) => parseMutedTags(e.tags));
15
- }
16
- /** Returns the hidden muted content if the event is unlocked */
17
- export function getHiddenMutedThings(mute) {
18
- return getOrComputeCachedValue(mute, MuteHiddenSymbol, () => {
19
- const tags = getHiddenTags(mute);
20
- return tags && parseMutedTags(tags);
21
- });
22
- }
@@ -1,12 +0,0 @@
1
- import { AddressPointer, EventPointer, ProfilePointer } from "nostr-tools/nip19";
2
- import { TagOperation } from "applesauce-factory/operations";
3
- export declare function addPubkeyTag(pubkey: string | ProfilePointer): TagOperation;
4
- export declare function removePubkeyTag(pubkey: string | ProfilePointer): TagOperation;
5
- export declare function addEventTag(id: string | EventPointer): TagOperation;
6
- export declare function removeEvent(id: string | EventPointer): TagOperation;
7
- export declare function addCoordinateTag(cord: string | AddressPointer): TagOperation;
8
- export declare function removeCoordinateTag(cord: string | AddressPointer): TagOperation;
9
- /** Adds a name / value tag from a list */
10
- export declare function addNameValueTag(tag: string[]): TagOperation;
11
- /** Removes a name / value tag from a list */
12
- export declare function removeNameValueTag(tag: string[]): TagOperation;
@@ -1,40 +0,0 @@
1
- import { getCoordinateFromAddressPointer } from "applesauce-core/helpers";
2
- import { createATagFromAddressPointer, createETagFromEventPointer, ensureNamedValueTag, } from "applesauce-factory/helpers";
3
- export function addPubkeyTag(pubkey) {
4
- pubkey = typeof pubkey !== "string" ? pubkey.pubkey : pubkey;
5
- return (tags) => [...tags, ["p", pubkey]];
6
- }
7
- export function removePubkeyTag(pubkey) {
8
- pubkey = typeof pubkey !== "string" ? pubkey.pubkey : pubkey;
9
- return (tags) => tags.filter((t) => !(t[0] === "p" && t[1] === pubkey));
10
- }
11
- export function addEventTag(id) {
12
- if (typeof id === "string")
13
- return (tags) => [...tags, ["e", id]];
14
- else
15
- return (tags) => [...tags, createETagFromEventPointer(id)];
16
- }
17
- export function removeEvent(id) {
18
- if (typeof id === "string")
19
- return (tags) => tags.filter((t) => !(t[0] === "e" && t[1] === id));
20
- else
21
- return (tags) => tags.filter((t) => !(t[0] === "e" && t[1] === id.id));
22
- }
23
- export function addCoordinateTag(cord) {
24
- if (typeof cord === "string")
25
- return (tags) => [...tags, ["a", cord]];
26
- else
27
- return (tags) => [...tags, createATagFromAddressPointer(cord)];
28
- }
29
- export function removeCoordinateTag(cord) {
30
- cord = typeof cord !== "string" ? getCoordinateFromAddressPointer(cord) : cord;
31
- return (tags) => tags.filter((t) => !(t[0] === "a" && t[1] === cord));
32
- }
33
- /** Adds a name / value tag from a list */
34
- export function addNameValueTag(tag) {
35
- return (tags) => ensureNamedValueTag(tags, tag);
36
- }
37
- /** Removes a name / value tag from a list */
38
- export function removeNameValueTag(tag) {
39
- return (tags) => tags.filter((t) => !(t[0] === tag[0] && t[1] === tag[1]));
40
- }
@@ -1,6 +0,0 @@
1
- import { GroupPointer } from "applesauce-core/helpers/groups";
2
- import { TagOperation } from "applesauce-factory/operations";
3
- /** Adds a "group" tag to a list */
4
- export declare function addGroupTag(group: GroupPointer): TagOperation;
5
- /** Removes a "group" tag from a list */
6
- export declare function removeGroupTag(group: GroupPointer): TagOperation;
@@ -1,15 +0,0 @@
1
- import { createGroupTagFromGroupPointer } from "applesauce-factory/helpers";
2
- /** Adds a "group" tag to a list */
3
- export function addGroupTag(group) {
4
- return (tags) => {
5
- const existing = tags.find((t) => t[0] === "group" && t[1] === group.id && t[2] === group.relay);
6
- if (existing)
7
- return tags.map((tag) => (tag === existing ? createGroupTagFromGroupPointer(group) : tag));
8
- else
9
- return [...tags, createGroupTagFromGroupPointer(group)];
10
- };
11
- }
12
- /** Removes a "group" tag from a list */
13
- export function removeGroupTag(group) {
14
- return (tags) => tags.filter((tag) => tag[0] === "group" && tag[1] === group.id && tag[2] === group.relay);
15
- }
@@ -1,3 +0,0 @@
1
- export * from "./common.js";
2
- export * from "./relay.js";
3
- export * from "./groups.js";
@@ -1,3 +0,0 @@
1
- export * from "./common.js";
2
- export * from "./relay.js";
3
- export * from "./groups.js";
@@ -1,3 +0,0 @@
1
- import { TagOperation } from "applesauce-factory/operations";
2
- export declare function addRelayTag(url: string | URL): TagOperation;
3
- export declare function removeRelayTag(url: string | URL): TagOperation;
@@ -1,8 +0,0 @@
1
- export function addRelayTag(url) {
2
- url = typeof url === "string" ? url : String(url);
3
- return (tags) => [...tags, ["relay", url]];
4
- }
5
- export function removeRelayTag(url) {
6
- url = typeof url === "string" ? url : String(url);
7
- return (tags) => tags.filter((t) => !(t[0] === "relay" && t[1] === url));
8
- }
@@ -1,4 +0,0 @@
1
- import { NostrEvent } from "nostr-tools";
2
- export declare const PinnedNotesSymbol: unique symbol;
3
- /** Returns a set of muted threads */
4
- export declare function getPinnedNotes(pin: NostrEvent): import("nostr-tools/nip19").EventPointer[];
@@ -1,7 +0,0 @@
1
- import { getEventPointerFromETag, isETag } from "applesauce-core/helpers";
2
- import { getOrComputeCachedValue } from "applesauce-core/helpers/cache";
3
- export const PinnedNotesSymbol = Symbol.for("pinned-notes");
4
- /** Returns a set of muted threads */
5
- export function getPinnedNotes(pin) {
6
- return getOrComputeCachedValue(pin, PinnedNotesSymbol, (e) => e.tags.filter(isETag).map(getEventPointerFromETag));
7
- }
@@ -1,8 +0,0 @@
1
- import { Query } from "applesauce-core";
2
- import { Bookmarks } from "../helpers/bookmark.js";
3
- export declare function UserBookmarkQuery(pubkey: string): Query<Bookmarks | undefined>;
4
- export declare function UserHiddenBookmarkQuery(pubkey: string): Query<(Bookmarks & {
5
- locked: false;
6
- }) | {
7
- locked: true;
8
- } | undefined>;
@@ -1,23 +0,0 @@
1
- import { kinds } from "nostr-tools";
2
- import { map } from "rxjs/operators";
3
- import { isHiddenTagsLocked } from "applesauce-core/helpers";
4
- import { getBookmarks, getHiddenBookmarks } from "../helpers/bookmark.js";
5
- export function UserBookmarkQuery(pubkey) {
6
- return {
7
- key: pubkey,
8
- run: (store) => store.replaceable(kinds.Mutelist, pubkey).pipe(map((event) => event && getBookmarks(event))),
9
- };
10
- }
11
- export function UserHiddenBookmarkQuery(pubkey) {
12
- return {
13
- key: pubkey,
14
- run: (store) => store.replaceable(kinds.Mutelist, pubkey).pipe(map((event) => {
15
- if (!event)
16
- return undefined;
17
- const bookmarks = getHiddenBookmarks(event);
18
- if (isHiddenTagsLocked(event) || !bookmarks)
19
- return { locked: true };
20
- return { locked: false, ...bookmarks };
21
- })),
22
- };
23
- }
@@ -1,3 +0,0 @@
1
- import { Query } from "applesauce-core";
2
- import { ProfilePointer } from "nostr-tools/nip19";
3
- export declare function UserContactsQuery(pubkey: string): Query<ProfilePointer[] | undefined>;
@@ -1,9 +0,0 @@
1
- import { kinds } from "nostr-tools";
2
- import { map } from "rxjs/operators";
3
- import { getContactsPeople } from "../helpers/contacts.js";
4
- export function UserContactsQuery(pubkey) {
5
- return {
6
- key: pubkey,
7
- run: (store) => store.replaceable(kinds.Mutelist, pubkey).pipe(map((event) => event && getContactsPeople(event))),
8
- };
9
- }
@@ -1,4 +0,0 @@
1
- export * from "./mute.js";
2
- export * from "./pin.js";
3
- export * from "./bookmark.js";
4
- export * from "./contacts.js";
@@ -1,4 +0,0 @@
1
- export * from "./mute.js";
2
- export * from "./pin.js";
3
- export * from "./bookmark.js";
4
- export * from "./contacts.js";
@@ -1,8 +0,0 @@
1
- import { Query } from "applesauce-core";
2
- import { Mutes } from "../helpers/mute.js";
3
- export declare function UserMuteQuery(pubkey: string): Query<Mutes | undefined>;
4
- export declare function UserHiddenMuteQuery(pubkey: string): Query<(Mutes & {
5
- locked: false;
6
- }) | {
7
- locked: true;
8
- } | undefined>;
@@ -1,23 +0,0 @@
1
- import { kinds } from "nostr-tools";
2
- import { map } from "rxjs/operators";
3
- import { isHiddenTagsLocked } from "applesauce-core/helpers";
4
- import { getHiddenMutedThings, getMutedThings } from "../helpers/mute.js";
5
- export function UserMuteQuery(pubkey) {
6
- return {
7
- key: pubkey,
8
- run: (store) => store.replaceable(kinds.Mutelist, pubkey).pipe(map((event) => event && getMutedThings(event))),
9
- };
10
- }
11
- export function UserHiddenMuteQuery(pubkey) {
12
- return {
13
- key: pubkey,
14
- run: (store) => store.replaceable(kinds.Mutelist, pubkey).pipe(map((event) => {
15
- if (!event)
16
- return undefined;
17
- const muted = getHiddenMutedThings(event);
18
- if (isHiddenTagsLocked(event) || !muted)
19
- return { locked: true };
20
- return { locked: false, ...muted };
21
- })),
22
- };
23
- }
@@ -1,3 +0,0 @@
1
- import { Query } from "applesauce-core";
2
- import { EventPointer } from "nostr-tools/nip19";
3
- export declare function UserPinnedNotesQuery(pubkey: string): Query<EventPointer[] | undefined>;
@@ -1,9 +0,0 @@
1
- import { kinds } from "nostr-tools";
2
- import { map } from "rxjs/operators";
3
- import { getPinnedNotes } from "../helpers/pin.js";
4
- export function UserPinnedNotesQuery(pubkey) {
5
- return {
6
- key: pubkey,
7
- run: (store) => store.replaceable(kinds.Pinlist, pubkey).pipe(map((event) => event && getPinnedNotes(event))),
8
- };
9
- }