applesauce-loaders 3.1.0 → 4.0.0
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/dist/loaders/address-loader.d.ts +2 -2
- package/dist/loaders/event-loader.d.ts +2 -2
- package/dist/loaders/social-graph.d.ts +2 -2
- package/dist/loaders/tag-value-loader.d.ts +2 -2
- package/dist/loaders/timeline-loader.d.ts +2 -2
- package/dist/loaders/user-lists-loader.d.ts +2 -2
- package/package.json +8 -8
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { mapEventsToStore } from "applesauce-core";
|
|
2
2
|
import { NostrEvent } from "nostr-tools";
|
|
3
3
|
import { Observable } from "rxjs";
|
|
4
4
|
import { CacheRequest, NostrRequest, UpstreamPool } from "../types.js";
|
|
@@ -34,7 +34,7 @@ export type AddressLoaderOptions = Partial<{
|
|
|
34
34
|
/** Max buffer size ( default 200 ) */
|
|
35
35
|
bufferSize: number;
|
|
36
36
|
/** An event store used to deduplicate events */
|
|
37
|
-
eventStore
|
|
37
|
+
eventStore?: Parameters<typeof mapEventsToStore>[0];
|
|
38
38
|
/** A method used to load events from a local cache */
|
|
39
39
|
cacheRequest: CacheRequest;
|
|
40
40
|
/** Whether to follow relay hints ( default true ) */
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { mapEventsToStore } from "applesauce-core";
|
|
2
2
|
import { NostrEvent } from "nostr-tools";
|
|
3
3
|
import { EventPointer } from "nostr-tools/nip19";
|
|
4
4
|
import { Observable } from "rxjs";
|
|
@@ -24,7 +24,7 @@ export type EventPointerLoaderOptions = Partial<{
|
|
|
24
24
|
/** Max buffer size ( default 200 ) */
|
|
25
25
|
bufferSize: number;
|
|
26
26
|
/** An event store used to deduplicate events */
|
|
27
|
-
eventStore
|
|
27
|
+
eventStore?: Parameters<typeof mapEventsToStore>[0];
|
|
28
28
|
/** A method used to load events from a local cache */
|
|
29
29
|
cacheRequest: CacheRequest;
|
|
30
30
|
/** Whether to follow relay hints ( default true ) */
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { mapEventsToStore } from "applesauce-core";
|
|
2
2
|
import { NostrEvent } from "nostr-tools";
|
|
3
3
|
import { ProfilePointer } from "nostr-tools/nip19";
|
|
4
4
|
import { Observable } from "rxjs";
|
|
@@ -9,7 +9,7 @@ export type SocialGraphLoader = (user: ProfilePointer & {
|
|
|
9
9
|
}) => Observable<NostrEvent>;
|
|
10
10
|
export type SocialGraphLoaderOptions = Partial<{
|
|
11
11
|
/** An event store to send all the events to */
|
|
12
|
-
eventStore
|
|
12
|
+
eventStore?: Parameters<typeof mapEventsToStore>[0];
|
|
13
13
|
/** The number of parallel requests to make (default 300) */
|
|
14
14
|
parallel: number;
|
|
15
15
|
/** Extra relays to load from */
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { mapEventsToStore } from "applesauce-core";
|
|
2
2
|
import { NostrEvent } from "nostr-tools";
|
|
3
3
|
import { Observable } from "rxjs";
|
|
4
4
|
import { CacheRequest, NostrRequest, UpstreamPool } from "../types.js";
|
|
@@ -26,7 +26,7 @@ export type TagValueLoaderOptions = {
|
|
|
26
26
|
/** An array of relays to always fetch from */
|
|
27
27
|
extraRelays?: string[] | Observable<string[]>;
|
|
28
28
|
/** An event store used to deduplicate events */
|
|
29
|
-
eventStore?:
|
|
29
|
+
eventStore?: Parameters<typeof mapEventsToStore>[0];
|
|
30
30
|
};
|
|
31
31
|
export type TagValueLoader = (pointer: TagValuePointer) => Observable<NostrEvent>;
|
|
32
32
|
/** Creates a loader that gets tag values from the cache */
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { mapEventsToStore } from "applesauce-core";
|
|
2
2
|
import { NostrEvent } from "nostr-tools";
|
|
3
3
|
import { Observable } from "rxjs";
|
|
4
4
|
import { CacheRequest, FilterRequest, NostrRequest, TimelessFilter, UpstreamPool } from "../types.js";
|
|
@@ -18,7 +18,7 @@ export type TimelineLoaderOptions = Partial<{
|
|
|
18
18
|
/** A method used to load the timeline from the cache */
|
|
19
19
|
cache: CacheRequest;
|
|
20
20
|
/** An event store to pass all the events to */
|
|
21
|
-
eventStore
|
|
21
|
+
eventStore?: Parameters<typeof mapEventsToStore>[0];
|
|
22
22
|
}> & CommonTimelineLoaderOptions;
|
|
23
23
|
/** A common timeline loader that takes an array of relays and a cache method */
|
|
24
24
|
export declare function createTimelineLoader(pool: UpstreamPool, relays: string[], filters: TimelessFilter[] | TimelessFilter, opts?: TimelineLoaderOptions): TimelineLoader;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { mapEventsToStore } from "applesauce-core";
|
|
2
2
|
import { NostrEvent } from "nostr-tools";
|
|
3
3
|
import { ProfilePointer } from "nostr-tools/nip19";
|
|
4
4
|
import { Observable } from "rxjs";
|
|
@@ -17,7 +17,7 @@ export type UserListsLoaderOptions = Partial<{
|
|
|
17
17
|
/** An array of extra relay to load from */
|
|
18
18
|
extraRelays?: string[] | Observable<string[]>;
|
|
19
19
|
/** An event store used to deduplicate events */
|
|
20
|
-
eventStore
|
|
20
|
+
eventStore?: Parameters<typeof mapEventsToStore>[0];
|
|
21
21
|
}>;
|
|
22
22
|
/**
|
|
23
23
|
* A special address loader that can request addressable events without specifying the identifier
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "applesauce-loaders",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "4.0.0",
|
|
4
4
|
"description": "A collection of observable based loaders built on rx-nostr",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -12,8 +12,7 @@
|
|
|
12
12
|
"author": "hzrd149",
|
|
13
13
|
"license": "MIT",
|
|
14
14
|
"files": [
|
|
15
|
-
"dist"
|
|
16
|
-
"applesauce"
|
|
15
|
+
"dist"
|
|
17
16
|
],
|
|
18
17
|
"exports": {
|
|
19
18
|
".": {
|
|
@@ -53,17 +52,17 @@
|
|
|
53
52
|
}
|
|
54
53
|
},
|
|
55
54
|
"dependencies": {
|
|
56
|
-
"applesauce-core": "^
|
|
55
|
+
"applesauce-core": "^4.0.0",
|
|
57
56
|
"nanoid": "^5.0.9",
|
|
58
|
-
"nostr-tools": "~2.
|
|
57
|
+
"nostr-tools": "~2.17",
|
|
59
58
|
"rxjs": "^7.8.1"
|
|
60
59
|
},
|
|
61
60
|
"devDependencies": {
|
|
62
61
|
"@hirez_io/observer-spy": "^2.2.0",
|
|
63
|
-
"applesauce-signers": "^
|
|
62
|
+
"applesauce-signers": "^4.0.0",
|
|
63
|
+
"rimraf": "^6.0.1",
|
|
64
64
|
"typescript": "^5.8.3",
|
|
65
|
-
"vitest": "^3.2.
|
|
66
|
-
"vitest-nostr": "^0.4.1",
|
|
65
|
+
"vitest": "^3.2.4",
|
|
67
66
|
"vitest-websocket-mock": "^0.5.0"
|
|
68
67
|
},
|
|
69
68
|
"funding": {
|
|
@@ -71,6 +70,7 @@
|
|
|
71
70
|
"url": "lightning:nostrudel@geyser.fund"
|
|
72
71
|
},
|
|
73
72
|
"scripts": {
|
|
73
|
+
"prebuild": "rimraf dist",
|
|
74
74
|
"build": "tsc",
|
|
75
75
|
"watch:build": "tsc --watch > /dev/null",
|
|
76
76
|
"test": "vitest run --passWithNoTests",
|