applesauce-core 0.0.0-next-20250428223834 → 0.0.0-next-20250511152752

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.
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,17 @@
1
+ import { describe, expect, it } from "vitest";
2
+ import * as exports from "../index.js";
3
+ describe("exports", () => {
4
+ it("should export the expected functions", () => {
5
+ expect(Object.keys(exports).sort()).toMatchInlineSnapshot(`
6
+ [
7
+ "Database",
8
+ "EventStore",
9
+ "EventStoreSymbol",
10
+ "Helpers",
11
+ "Queries",
12
+ "QueryStore",
13
+ "logger",
14
+ ]
15
+ `);
16
+ });
17
+ });
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,17 @@
1
+ import { describe, expect, it } from "vitest";
2
+ import * as core from "../index.js";
3
+ describe("core", () => {
4
+ it("should export the correct functions", () => {
5
+ expect(Object.keys(core).sort()).toMatchInlineSnapshot(`
6
+ [
7
+ "Database",
8
+ "EventStore",
9
+ "EventStoreSymbol",
10
+ "Helpers",
11
+ "Queries",
12
+ "QueryStore",
13
+ "logger",
14
+ ]
15
+ `);
16
+ });
17
+ });
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,220 @@
1
+ import { describe, expect, it } from "vitest";
2
+ import * as exports from "../index.js";
3
+ describe("exports", () => {
4
+ it("should export the expected functions", () => {
5
+ expect(Object.keys(exports).sort()).toMatchInlineSnapshot(`
6
+ [
7
+ "AUDIO_EXT",
8
+ "BLOSSOM_SERVER_LIST_KIND",
9
+ "BookmarkHiddenSymbol",
10
+ "BookmarkPublicSymbol",
11
+ "COMMENT_KIND",
12
+ "ChannelMetadataSymbol",
13
+ "CommentReplyPointerSymbol",
14
+ "CommentRootPointerSymbol",
15
+ "ContactsRelaysSymbol",
16
+ "EventContentEncryptionMethod",
17
+ "EventIndexableTagsSymbol",
18
+ "EventUIDSymbol",
19
+ "FAVORITE_RELAYS_KIND",
20
+ "FromCacheSymbol",
21
+ "GROUPS_LIST_KIND",
22
+ "GROUP_MESSAGE_KIND",
23
+ "GiftWrapEventSymbol",
24
+ "GiftWrapSealSymbol",
25
+ "GroupsHiddenSymbol",
26
+ "GroupsPublicSymbol",
27
+ "HiddenContactsSymbol",
28
+ "HiddenContentSymbol",
29
+ "HiddenTagsSymbol",
30
+ "IMAGE_EXT",
31
+ "LRU",
32
+ "MailboxesInboxesSymbol",
33
+ "MailboxesOutboxesSymbol",
34
+ "MediaAttachmentsSymbol",
35
+ "MuteHiddenSymbol",
36
+ "MutePublicSymbol",
37
+ "NIP05_REGEX",
38
+ "Nip10ThreadRefsSymbol",
39
+ "PICTURE_POST_KIND",
40
+ "ProfileContentSymbol",
41
+ "PublicContactsSymbol",
42
+ "ReplaceableIdentifierSymbol",
43
+ "STREAM_EXT",
44
+ "SeenRelaysSymbol",
45
+ "SharedEventSymbol",
46
+ "UserStatusPointerSymbol",
47
+ "VIDEO_EXT",
48
+ "ZapAddressPointerSymbol",
49
+ "ZapEventPointerSymbol",
50
+ "ZapFromSymbol",
51
+ "ZapInvoiceSymbol",
52
+ "ZapRequestSymbol",
53
+ "addSeenRelay",
54
+ "areBlossomServersEqual",
55
+ "canHaveHiddenContent",
56
+ "canHaveHiddenTags",
57
+ "convertToUrl",
58
+ "createMutedWordsRegExp",
59
+ "createReplaceableAddress",
60
+ "decodeGroupPointer",
61
+ "decodeLNURL",
62
+ "decryptDirectMessage",
63
+ "encodeDecodeResult",
64
+ "encodeGroupPointer",
65
+ "fakeVerifyEvent",
66
+ "getAddressPointerForEvent",
67
+ "getAddressPointerFromATag",
68
+ "getAddressPointersFromList",
69
+ "getBlossomServersFromList",
70
+ "getBookmarks",
71
+ "getCachedValue",
72
+ "getChannelMetadataContent",
73
+ "getChannelPointer",
74
+ "getCommentAddressPointer",
75
+ "getCommentEventPointer",
76
+ "getCommentExternalPointer",
77
+ "getCommentReplyPointer",
78
+ "getCommentRootPointer",
79
+ "getContacts",
80
+ "getContentWarning",
81
+ "getCoordinateFromAddressPointer",
82
+ "getDeleteCoordinates",
83
+ "getDeleteIds",
84
+ "getDisplayName",
85
+ "getEmojiTag",
86
+ "getEmojis",
87
+ "getEventPointerForEvent",
88
+ "getEventPointerFromETag",
89
+ "getEventPointerFromQTag",
90
+ "getEventPointerFromThreadTag",
91
+ "getEventPointersFromList",
92
+ "getEventUID",
93
+ "getExternalPointerFromTag",
94
+ "getFileMetadata",
95
+ "getFileMetadataFromImetaTag",
96
+ "getGiftWrapEvent",
97
+ "getGiftWrapSeal",
98
+ "getGroupPointerFromGroupTag",
99
+ "getHashtagTag",
100
+ "getHiddenBookmarks",
101
+ "getHiddenContacts",
102
+ "getHiddenContent",
103
+ "getHiddenContentEncryptionMethods",
104
+ "getHiddenGroups",
105
+ "getHiddenMutedThings",
106
+ "getHiddenTags",
107
+ "getHiddenTagsEncryptionMethods",
108
+ "getInboxes",
109
+ "getIndexableTags",
110
+ "getInvoice",
111
+ "getListTags",
112
+ "getMediaAttachments",
113
+ "getMutedThings",
114
+ "getNip10References",
115
+ "getOrComputeCachedValue",
116
+ "getOutboxes",
117
+ "getPackName",
118
+ "getParentEventStore",
119
+ "getPicturePostAttachments",
120
+ "getPointerForEvent",
121
+ "getPointerFromTag",
122
+ "getProfileContent",
123
+ "getProfilePointerFromPTag",
124
+ "getProfilePointersFromList",
125
+ "getPubkeyFromDecodeResult",
126
+ "getPublicBookmarks",
127
+ "getPublicContacts",
128
+ "getPublicGroups",
129
+ "getPublicMutedThings",
130
+ "getRelaysFromContactsEvent",
131
+ "getRelaysFromList",
132
+ "getReplaceableAddress",
133
+ "getReplaceableIdentifier",
134
+ "getReplaceableUID",
135
+ "getSeenRelays",
136
+ "getSha256FromURL",
137
+ "getTagValue",
138
+ "getURLFilename",
139
+ "getUserStatusPointer",
140
+ "getZapAddressPointer",
141
+ "getZapEventPointer",
142
+ "getZapPayment",
143
+ "getZapPreimage",
144
+ "getZapRecipient",
145
+ "getZapRequest",
146
+ "getZapSender",
147
+ "getZapSplits",
148
+ "hasHiddenContent",
149
+ "hasHiddenTags",
150
+ "interpretThreadTags",
151
+ "isATag",
152
+ "isAddressPointer",
153
+ "isAddressPointerInList",
154
+ "isAudioURL",
155
+ "isCommentAddressPointer",
156
+ "isCommentEventPointer",
157
+ "isDTag",
158
+ "isETag",
159
+ "isEvent",
160
+ "isEventPointer",
161
+ "isEventPointerInList",
162
+ "isFilterEqual",
163
+ "isFromCache",
164
+ "isGiftWrapLocked",
165
+ "isHex",
166
+ "isHexKey",
167
+ "isHiddenContentLocked",
168
+ "isHiddenTagsLocked",
169
+ "isImageURL",
170
+ "isNameValueTag",
171
+ "isNip05",
172
+ "isPTag",
173
+ "isProfilePointerInList",
174
+ "isRTag",
175
+ "isReplaceable",
176
+ "isSafeRelayURL",
177
+ "isSameURL",
178
+ "isSha256",
179
+ "isStreamURL",
180
+ "isTTag",
181
+ "isValidList",
182
+ "isValidProfile",
183
+ "isValidZap",
184
+ "isVideoURL",
185
+ "lockHiddenContent",
186
+ "lockHiddenTags",
187
+ "markFromCache",
188
+ "matchFilter",
189
+ "matchFilters",
190
+ "matchMutes",
191
+ "mergeBlossomServers",
192
+ "mergeBookmarks",
193
+ "mergeContacts",
194
+ "mergeFilters",
195
+ "mergeMutes",
196
+ "mergeRelaySets",
197
+ "normalizeURL",
198
+ "parseBolt11",
199
+ "parseBookmarkTags",
200
+ "parseCoordinate",
201
+ "parseExternalPointer",
202
+ "parseFileMetadataTags",
203
+ "parseLNURLOrAddress",
204
+ "parseLightningAddress",
205
+ "parseMutedTags",
206
+ "parseNIP05Address",
207
+ "parseSharedEvent",
208
+ "processTags",
209
+ "safeParse",
210
+ "setCachedValue",
211
+ "setEventContentEncryptionMethod",
212
+ "stripInvisibleChar",
213
+ "unixNow",
214
+ "unlockGiftWrap",
215
+ "unlockHiddenContent",
216
+ "unlockHiddenTags",
217
+ ]
218
+ `);
219
+ });
220
+ });
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,220 @@
1
+ import { describe, expect, it } from "vitest";
2
+ import * as helpers from "../index.js";
3
+ describe("helpers", () => {
4
+ it("should export the correct functions", () => {
5
+ expect(Object.keys(helpers).sort()).toMatchInlineSnapshot(`
6
+ [
7
+ "AUDIO_EXT",
8
+ "BLOSSOM_SERVER_LIST_KIND",
9
+ "BookmarkHiddenSymbol",
10
+ "BookmarkPublicSymbol",
11
+ "COMMENT_KIND",
12
+ "ChannelMetadataSymbol",
13
+ "CommentReplyPointerSymbol",
14
+ "CommentRootPointerSymbol",
15
+ "ContactsRelaysSymbol",
16
+ "EventContentEncryptionMethod",
17
+ "EventIndexableTagsSymbol",
18
+ "EventUIDSymbol",
19
+ "FAVORITE_RELAYS_KIND",
20
+ "FromCacheSymbol",
21
+ "GROUPS_LIST_KIND",
22
+ "GROUP_MESSAGE_KIND",
23
+ "GiftWrapEventSymbol",
24
+ "GiftWrapSealSymbol",
25
+ "GroupsHiddenSymbol",
26
+ "GroupsPublicSymbol",
27
+ "HiddenContactsSymbol",
28
+ "HiddenContentSymbol",
29
+ "HiddenTagsSymbol",
30
+ "IMAGE_EXT",
31
+ "LRU",
32
+ "MailboxesInboxesSymbol",
33
+ "MailboxesOutboxesSymbol",
34
+ "MediaAttachmentsSymbol",
35
+ "MuteHiddenSymbol",
36
+ "MutePublicSymbol",
37
+ "NIP05_REGEX",
38
+ "Nip10ThreadRefsSymbol",
39
+ "PICTURE_POST_KIND",
40
+ "ProfileContentSymbol",
41
+ "PublicContactsSymbol",
42
+ "ReplaceableIdentifierSymbol",
43
+ "STREAM_EXT",
44
+ "SeenRelaysSymbol",
45
+ "SharedEventSymbol",
46
+ "UserStatusPointerSymbol",
47
+ "VIDEO_EXT",
48
+ "ZapAddressPointerSymbol",
49
+ "ZapEventPointerSymbol",
50
+ "ZapFromSymbol",
51
+ "ZapInvoiceSymbol",
52
+ "ZapRequestSymbol",
53
+ "addSeenRelay",
54
+ "areBlossomServersEqual",
55
+ "canHaveHiddenContent",
56
+ "canHaveHiddenTags",
57
+ "convertToUrl",
58
+ "createMutedWordsRegExp",
59
+ "createReplaceableAddress",
60
+ "decodeGroupPointer",
61
+ "decodeLNURL",
62
+ "decryptDirectMessage",
63
+ "encodeDecodeResult",
64
+ "encodeGroupPointer",
65
+ "fakeVerifyEvent",
66
+ "getAddressPointerForEvent",
67
+ "getAddressPointerFromATag",
68
+ "getAddressPointersFromList",
69
+ "getBlossomServersFromList",
70
+ "getBookmarks",
71
+ "getCachedValue",
72
+ "getChannelMetadataContent",
73
+ "getChannelPointer",
74
+ "getCommentAddressPointer",
75
+ "getCommentEventPointer",
76
+ "getCommentExternalPointer",
77
+ "getCommentReplyPointer",
78
+ "getCommentRootPointer",
79
+ "getContacts",
80
+ "getContentWarning",
81
+ "getCoordinateFromAddressPointer",
82
+ "getDeleteCoordinates",
83
+ "getDeleteIds",
84
+ "getDisplayName",
85
+ "getEmojiTag",
86
+ "getEmojis",
87
+ "getEventPointerForEvent",
88
+ "getEventPointerFromETag",
89
+ "getEventPointerFromQTag",
90
+ "getEventPointerFromThreadTag",
91
+ "getEventPointersFromList",
92
+ "getEventUID",
93
+ "getExternalPointerFromTag",
94
+ "getFileMetadata",
95
+ "getFileMetadataFromImetaTag",
96
+ "getGiftWrapEvent",
97
+ "getGiftWrapSeal",
98
+ "getGroupPointerFromGroupTag",
99
+ "getHashtagTag",
100
+ "getHiddenBookmarks",
101
+ "getHiddenContacts",
102
+ "getHiddenContent",
103
+ "getHiddenContentEncryptionMethods",
104
+ "getHiddenGroups",
105
+ "getHiddenMutedThings",
106
+ "getHiddenTags",
107
+ "getHiddenTagsEncryptionMethods",
108
+ "getInboxes",
109
+ "getIndexableTags",
110
+ "getInvoice",
111
+ "getListTags",
112
+ "getMediaAttachments",
113
+ "getMutedThings",
114
+ "getNip10References",
115
+ "getOrComputeCachedValue",
116
+ "getOutboxes",
117
+ "getPackName",
118
+ "getParentEventStore",
119
+ "getPicturePostAttachments",
120
+ "getPointerForEvent",
121
+ "getPointerFromTag",
122
+ "getProfileContent",
123
+ "getProfilePointerFromPTag",
124
+ "getProfilePointersFromList",
125
+ "getPubkeyFromDecodeResult",
126
+ "getPublicBookmarks",
127
+ "getPublicContacts",
128
+ "getPublicGroups",
129
+ "getPublicMutedThings",
130
+ "getRelaysFromContactsEvent",
131
+ "getRelaysFromList",
132
+ "getReplaceableAddress",
133
+ "getReplaceableIdentifier",
134
+ "getReplaceableUID",
135
+ "getSeenRelays",
136
+ "getSha256FromURL",
137
+ "getTagValue",
138
+ "getURLFilename",
139
+ "getUserStatusPointer",
140
+ "getZapAddressPointer",
141
+ "getZapEventPointer",
142
+ "getZapPayment",
143
+ "getZapPreimage",
144
+ "getZapRecipient",
145
+ "getZapRequest",
146
+ "getZapSender",
147
+ "getZapSplits",
148
+ "hasHiddenContent",
149
+ "hasHiddenTags",
150
+ "interpretThreadTags",
151
+ "isATag",
152
+ "isAddressPointer",
153
+ "isAddressPointerInList",
154
+ "isAudioURL",
155
+ "isCommentAddressPointer",
156
+ "isCommentEventPointer",
157
+ "isDTag",
158
+ "isETag",
159
+ "isEvent",
160
+ "isEventPointer",
161
+ "isEventPointerInList",
162
+ "isFilterEqual",
163
+ "isFromCache",
164
+ "isGiftWrapLocked",
165
+ "isHex",
166
+ "isHexKey",
167
+ "isHiddenContentLocked",
168
+ "isHiddenTagsLocked",
169
+ "isImageURL",
170
+ "isNameValueTag",
171
+ "isNip05",
172
+ "isPTag",
173
+ "isProfilePointerInList",
174
+ "isRTag",
175
+ "isReplaceable",
176
+ "isSafeRelayURL",
177
+ "isSameURL",
178
+ "isSha256",
179
+ "isStreamURL",
180
+ "isTTag",
181
+ "isValidList",
182
+ "isValidProfile",
183
+ "isValidZap",
184
+ "isVideoURL",
185
+ "lockHiddenContent",
186
+ "lockHiddenTags",
187
+ "markFromCache",
188
+ "matchFilter",
189
+ "matchFilters",
190
+ "matchMutes",
191
+ "mergeBlossomServers",
192
+ "mergeBookmarks",
193
+ "mergeContacts",
194
+ "mergeFilters",
195
+ "mergeMutes",
196
+ "mergeRelaySets",
197
+ "normalizeURL",
198
+ "parseBolt11",
199
+ "parseBookmarkTags",
200
+ "parseCoordinate",
201
+ "parseExternalPointer",
202
+ "parseFileMetadataTags",
203
+ "parseLNURLOrAddress",
204
+ "parseLightningAddress",
205
+ "parseMutedTags",
206
+ "parseNIP05Address",
207
+ "parseSharedEvent",
208
+ "processTags",
209
+ "safeParse",
210
+ "setCachedValue",
211
+ "setEventContentEncryptionMethod",
212
+ "stripInvisibleChar",
213
+ "unixNow",
214
+ "unlockGiftWrap",
215
+ "unlockHiddenContent",
216
+ "unlockHiddenTags",
217
+ ]
218
+ `);
219
+ });
220
+ });
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,72 @@
1
+ import { describe, expect, it } from "vitest";
2
+ import { kinds } from "nostr-tools";
3
+ import { npubEncode } from "nostr-tools/nip19";
4
+ import { getDisplayName } from "../profile.js";
5
+ import { FakeUser } from "../../__tests__/fixtures.js";
6
+ const user = new FakeUser();
7
+ const event = user.profile({
8
+ name: "Test User",
9
+ display_name: "Test User",
10
+ about: "Test User",
11
+ picture: "https://example.com/picture.png",
12
+ });
13
+ describe("getDisplayName", () => {
14
+ it("should return undefined when metadata is undefined and no fallback is provided", () => {
15
+ expect(getDisplayName(undefined)).toBeUndefined();
16
+ });
17
+ it("should return fallback when metadata is undefined", () => {
18
+ expect(getDisplayName(undefined, "fallback")).toBe("fallback");
19
+ });
20
+ it("should return display_name from ProfileContent", () => {
21
+ const profile = {
22
+ display_name: "Display Name",
23
+ name: "Name",
24
+ };
25
+ expect(getDisplayName(profile)).toBe("Display Name");
26
+ });
27
+ it("should return displayName from ProfileContent if display_name is not available", () => {
28
+ const profile = {
29
+ displayName: "Display Name",
30
+ name: "Name",
31
+ };
32
+ expect(getDisplayName(profile)).toBe("Display Name");
33
+ });
34
+ it("should return name from ProfileContent if display_name and displayName are not available", () => {
35
+ const profile = {
36
+ name: "Name",
37
+ };
38
+ expect(getDisplayName(profile)).toBe("Name");
39
+ });
40
+ it("should return fallback if no name properties are available in ProfileContent", () => {
41
+ const profile = {
42
+ about: "About me",
43
+ };
44
+ expect(getDisplayName(profile, "fallback")).toBe("fallback");
45
+ });
46
+ it("should trim the returned name", () => {
47
+ const profile = {
48
+ name: " Name with spaces ",
49
+ };
50
+ expect(getDisplayName(profile)).toBe("Name with spaces");
51
+ });
52
+ it("should extract profile content from a valid profile event", () => {
53
+ expect(getDisplayName(event)).toBe("Test User");
54
+ });
55
+ it("should use npub as fallback for invalid profile event", async () => {
56
+ const npub = npubEncode(user.pubkey);
57
+ const expectedFallback = `${npub.slice(0, 5 + 4)}…${npub.slice(-4)}`;
58
+ expect(getDisplayName(user.profile({}))).toBe(expectedFallback);
59
+ });
60
+ it("should use provided fallback for invalid profile event", () => {
61
+ const event = {
62
+ kind: kinds.Metadata,
63
+ pubkey: "pubkey123",
64
+ id: "id123",
65
+ sig: "sig123",
66
+ created_at: 123,
67
+ tags: [],
68
+ content: "Invalid JSON",
69
+ };
70
+ expect(getDisplayName(event, "Custom Fallback")).toBe("Custom Fallback");
71
+ });
72
+ });
@@ -7,3 +7,5 @@ export declare function isSha256(str: string): boolean;
7
7
  export declare function getBlossomServersFromList(event: {
8
8
  tags: string[][];
9
9
  } | string[][]): URL[];
10
+ /** A method that merges multiple arrays of blossom servers into a single array of unique servers */
11
+ export declare function mergeBlossomServers<T extends URL | string | (string | URL)>(...servers: (T | null | undefined | T[])[]): T[];
@@ -20,3 +20,21 @@ export function getBlossomServersFromList(event) {
20
20
  return undefined;
21
21
  });
22
22
  }
23
+ /** A method that merges multiple arrays of blossom servers into a single array of unique servers */
24
+ export function mergeBlossomServers(...servers) {
25
+ let merged = [];
26
+ const seen = new Set();
27
+ for (const arg of servers) {
28
+ let arr = Array.isArray(arg) ? arg : [arg];
29
+ for (const s of arr) {
30
+ if (s === null || s === undefined)
31
+ continue;
32
+ const key = new URL("/", s).toString();
33
+ if (seen.has(key))
34
+ continue;
35
+ seen.add(key);
36
+ merged.push(s);
37
+ }
38
+ }
39
+ return merged;
40
+ }
@@ -22,4 +22,8 @@ export declare function getProfileContent(event: NostrEvent): ProfileContent;
22
22
  /** Checks if the content of the kind 0 event is valid JSON */
23
23
  export declare function isValidProfile(profile?: NostrEvent): boolean;
24
24
  /** Gets the display name from a profile with fallbacks */
25
- export declare function getDisplayName(metadata?: ProfileContent): string | undefined;
25
+ export declare function getDisplayName(metadata: NostrEvent, fallback?: string): string;
26
+ export declare function getDisplayName(metadata: undefined): undefined;
27
+ export declare function getDisplayName(metadata: ProfileContent | undefined): string | undefined;
28
+ export declare function getDisplayName(metadata: ProfileContent | NostrEvent | undefined, fallback: string): string;
29
+ export declare function getDisplayName(metadata: ProfileContent | NostrEvent | undefined, fallback?: string): string | undefined;
@@ -1,4 +1,5 @@
1
1
  import { kinds } from "nostr-tools";
2
+ import { npubEncode } from "nostr-tools/nip19";
2
3
  import { getOrComputeCachedValue } from "./cache.js";
3
4
  export const ProfileContentSymbol = Symbol.for("profile-content");
4
5
  /** Returns the parsed profile content for a kind 0 event */
@@ -29,7 +30,22 @@ export function isValidProfile(profile) {
29
30
  return false;
30
31
  }
31
32
  }
32
- /** Gets the display name from a profile with fallbacks */
33
- export function getDisplayName(metadata) {
34
- return metadata?.display_name || metadata?.displayName || metadata?.name;
33
+ export function getDisplayName(metadata, fallback) {
34
+ if (!metadata)
35
+ return fallback;
36
+ // Get the metadata from the nostr event
37
+ if ("pubkey" in metadata && "id" in metadata && "sig" in metadata) {
38
+ // Set the fallback to the npub if not set
39
+ if (!fallback) {
40
+ const npub = npubEncode(metadata.pubkey);
41
+ fallback = npub.slice(0, 5 + 4) + "…" + npub.slice(-4);
42
+ }
43
+ // Get the profile content
44
+ if (isValidProfile(metadata))
45
+ metadata = getProfileContent(metadata);
46
+ else
47
+ metadata = undefined;
48
+ }
49
+ // Return the display name or fallback
50
+ return (metadata?.display_name || metadata?.displayName || metadata?.name || fallback)?.trim();
35
51
  }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,18 @@
1
+ import { describe, expect, it } from "vitest";
2
+ import * as exports from "../index.js";
3
+ describe("exports", () => {
4
+ it("should export the expected functions", () => {
5
+ expect(Object.keys(exports).sort()).toMatchInlineSnapshot(`
6
+ [
7
+ "TimeoutError",
8
+ "defined",
9
+ "firstValueFrom",
10
+ "getObservableValue",
11
+ "lastValueFrom",
12
+ "listenLatestUpdates",
13
+ "simpleTimeout",
14
+ "withImmediateValueOrDefault",
15
+ ]
16
+ `);
17
+ });
18
+ });
@@ -1,5 +1,7 @@
1
+ import { firstValueFrom, lastValueFrom } from "rxjs";
1
2
  export * from "./defined.js";
2
3
  export * from "./get-observable-value.js";
3
4
  export * from "./listen-latest-updates.js";
4
5
  export * from "./simple-timeout.js";
5
6
  export * from "./with-immediate-value.js";
7
+ export { firstValueFrom, lastValueFrom };
@@ -1,5 +1,8 @@
1
+ import { firstValueFrom, lastValueFrom } from "rxjs";
1
2
  export * from "./defined.js";
2
3
  export * from "./get-observable-value.js";
3
4
  export * from "./listen-latest-updates.js";
4
5
  export * from "./simple-timeout.js";
5
6
  export * from "./with-immediate-value.js";
7
+ // Re-export some useful rxjs functions
8
+ export { firstValueFrom, lastValueFrom };
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,11 @@
1
+ import { describe, expect, it } from "vitest";
2
+ import * as exports from "../index.js";
3
+ describe("exports", () => {
4
+ it("should export the expected functions", () => {
5
+ expect(Object.keys(exports).sort()).toMatchInlineSnapshot(`
6
+ [
7
+ "createDefer",
8
+ ]
9
+ `);
10
+ });
11
+ });
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,41 @@
1
+ import { describe, expect, it } from "vitest";
2
+ import * as exports from "../index.js";
3
+ describe("exports", () => {
4
+ it("should export the expected functions", () => {
5
+ expect(Object.keys(exports).sort()).toMatchInlineSnapshot(`
6
+ [
7
+ "BlockedRelays",
8
+ "ChannelHiddenQuery",
9
+ "ChannelMessagesQuery",
10
+ "ChannelMetadataQuery",
11
+ "ChannelMutedQuery",
12
+ "CommentsQuery",
13
+ "ContactsQuery",
14
+ "EventZapsQuery",
15
+ "FavoriteRelaySets",
16
+ "FavoriteRelays",
17
+ "HiddenContactsQuery",
18
+ "HiddenMuteQuery",
19
+ "MailboxesQuery",
20
+ "MultipleEventsQuery",
21
+ "MuteQuery",
22
+ "ProfileQuery",
23
+ "PublicContactsQuery",
24
+ "PublicMuteQuery",
25
+ "ReactionsQuery",
26
+ "ReplaceableQuery",
27
+ "ReplaceableSetQuery",
28
+ "RepliesQuery",
29
+ "SearchRelays",
30
+ "SingleEventQuery",
31
+ "ThreadQuery",
32
+ "TimelineQuery",
33
+ "UserBlossomServersQuery",
34
+ "UserBookmarkQuery",
35
+ "UserHiddenBookmarkQuery",
36
+ "UserPinnedQuery",
37
+ "UserPublicBookmarkQuery",
38
+ ]
39
+ `);
40
+ });
41
+ });
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,12 @@
1
+ import { describe, expect, it } from "vitest";
2
+ import * as exports from "../index.js";
3
+ describe("exports", () => {
4
+ it("should export the expected functions", () => {
5
+ expect(Object.keys(exports).sort()).toMatchInlineSnapshot(`
6
+ [
7
+ "Queries",
8
+ "QueryStore",
9
+ ]
10
+ `);
11
+ });
12
+ });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "applesauce-core",
3
- "version": "0.0.0-next-20250428223834",
3
+ "version": "0.0.0-next-20250511152752",
4
4
  "description": "",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",