applesauce-core 1.2.0 → 2.1.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/README.md +7 -13
- package/dist/event-store/{database.d.ts → event-set.d.ts} +36 -21
- package/dist/event-store/{database.js → event-set.js} +98 -67
- package/dist/event-store/event-store.d.ts +64 -25
- package/dist/event-store/event-store.js +164 -207
- package/dist/event-store/index.d.ts +1 -1
- package/dist/event-store/index.js +1 -1
- package/dist/event-store/interface.d.ts +71 -13
- package/dist/helpers/app-handlers.d.ts +23 -0
- package/dist/helpers/app-handlers.js +68 -0
- package/dist/helpers/article.d.ts +9 -0
- package/dist/helpers/article.js +21 -0
- package/dist/helpers/bolt11.d.ts +1 -0
- package/dist/helpers/bolt11.js +2 -0
- package/dist/helpers/bookmarks.js +1 -2
- package/dist/helpers/emoji.d.ts +10 -2
- package/dist/helpers/emoji.js +21 -3
- package/dist/helpers/encrypted-content-cache.d.ts +15 -0
- package/dist/helpers/encrypted-content-cache.js +125 -0
- package/dist/helpers/encrypted-content.d.ts +48 -0
- package/dist/helpers/encrypted-content.js +65 -0
- package/dist/helpers/encryption.d.ts +5 -0
- package/dist/helpers/encryption.js +10 -0
- package/dist/helpers/event.d.ts +5 -8
- package/dist/helpers/event.js +25 -11
- package/dist/helpers/expiration.d.ts +6 -0
- package/dist/helpers/expiration.js +16 -0
- package/dist/helpers/filter.d.ts +1 -3
- package/dist/helpers/filter.js +1 -3
- package/dist/helpers/gift-wraps.d.ts +17 -5
- package/dist/helpers/gift-wraps.js +65 -27
- package/dist/helpers/groups.d.ts +5 -0
- package/dist/helpers/groups.js +12 -2
- package/dist/helpers/hidden-content.d.ts +27 -32
- package/dist/helpers/hidden-content.js +35 -65
- package/dist/helpers/hidden-tags.d.ts +23 -4
- package/dist/helpers/hidden-tags.js +39 -4
- package/dist/helpers/index.d.ts +11 -1
- package/dist/helpers/index.js +11 -1
- package/dist/helpers/legacy-messages.d.ts +21 -0
- package/dist/helpers/legacy-messages.js +39 -0
- package/dist/helpers/lists.d.ts +3 -1
- package/dist/helpers/lists.js +9 -3
- package/dist/helpers/messages.d.ts +11 -0
- package/dist/helpers/messages.js +19 -0
- package/dist/helpers/mutes.js +1 -1
- package/dist/helpers/pointers.d.ts +33 -9
- package/dist/helpers/pointers.js +80 -44
- package/dist/helpers/profile.d.ts +10 -2
- package/dist/helpers/profile.js +33 -4
- package/dist/helpers/reactions.d.ts +8 -0
- package/dist/helpers/reactions.js +56 -0
- package/dist/helpers/reports.d.ts +28 -0
- package/dist/helpers/reports.js +38 -0
- package/dist/helpers/share.d.ts +10 -1
- package/dist/helpers/share.js +22 -8
- package/dist/helpers/url.d.ts +4 -0
- package/dist/helpers/url.js +20 -0
- package/dist/helpers/user-status.js +2 -1
- package/dist/helpers/wrapped-messages.d.ts +23 -0
- package/dist/helpers/wrapped-messages.js +38 -0
- package/dist/helpers/zap.d.ts +8 -5
- package/dist/helpers/zap.js +11 -6
- package/dist/index.d.ts +2 -2
- package/dist/index.js +2 -2
- package/dist/models/blossom.d.ts +3 -0
- package/dist/models/blossom.js +8 -0
- package/dist/models/bookmarks.d.ts +8 -0
- package/dist/{queries → models}/bookmarks.js +9 -9
- package/dist/models/channels.d.ts +11 -0
- package/dist/{queries → models}/channels.js +9 -9
- package/dist/models/comments.d.ts +4 -0
- package/dist/models/comments.js +11 -0
- package/dist/models/common.d.ts +16 -0
- package/dist/models/common.js +176 -0
- package/dist/models/contacts.d.ts +8 -0
- package/dist/{queries → models}/contacts.js +10 -10
- package/dist/models/encrypted-content.d.ts +4 -0
- package/dist/models/encrypted-content.js +11 -0
- package/dist/models/gift-wrap.d.ts +7 -0
- package/dist/models/gift-wrap.js +20 -0
- package/dist/{queries → models}/index.d.ts +6 -2
- package/dist/{queries → models}/index.js +6 -2
- package/dist/models/legacy-messages.d.ts +8 -0
- package/dist/models/legacy-messages.js +29 -0
- package/dist/models/mailboxes.d.ts +6 -0
- package/dist/{queries → models}/mailboxes.js +2 -2
- package/dist/models/mutes.d.ts +8 -0
- package/dist/{queries → models}/mutes.js +9 -9
- package/dist/models/pins.d.ts +4 -0
- package/dist/{queries → models}/pins.js +3 -3
- package/dist/models/profile.d.ts +4 -0
- package/dist/models/profile.js +14 -0
- package/dist/models/reactions.d.ts +4 -0
- package/dist/{queries → models}/reactions.js +2 -2
- package/dist/models/relays.d.ts +27 -0
- package/dist/{queries → models}/relays.js +13 -13
- package/dist/{queries → models}/thread.d.ts +6 -5
- package/dist/{queries → models}/thread.js +4 -3
- package/dist/models/user-status.d.ts +11 -0
- package/dist/{queries → models}/user-status.js +5 -5
- package/dist/models/wrapped-messages.d.ts +25 -0
- package/dist/models/wrapped-messages.js +61 -0
- package/dist/models/zaps.d.ts +9 -0
- package/dist/{queries → models}/zaps.js +11 -3
- package/dist/observable/claim-events.d.ts +3 -3
- package/dist/observable/claim-events.js +4 -4
- package/dist/observable/claim-latest.d.ts +3 -3
- package/dist/observable/claim-latest.js +4 -4
- package/dist/observable/index.d.ts +3 -1
- package/dist/observable/index.js +3 -1
- package/dist/observable/map-events-timeline.d.ts +7 -0
- package/dist/observable/map-events-timeline.js +9 -0
- package/dist/observable/map-events-to-store.d.ts +5 -0
- package/dist/observable/map-events-to-store.js +12 -0
- package/dist/observable/simple-timeout.d.ts +1 -0
- package/dist/observable/simple-timeout.js +1 -0
- package/dist/observable/watch-event-updates.d.ts +7 -0
- package/dist/observable/watch-event-updates.js +25 -0
- package/package.json +11 -16
- package/dist/__tests__/exports.test.d.ts +0 -1
- package/dist/__tests__/exports.test.js +0 -17
- package/dist/__tests__/fixtures.d.ts +0 -8
- package/dist/__tests__/fixtures.js +0 -20
- package/dist/event-store/__tests__/event-store.test.d.ts +0 -1
- package/dist/event-store/__tests__/event-store.test.js +0 -354
- package/dist/helpers/__tests__/blossom.test.d.ts +0 -1
- package/dist/helpers/__tests__/blossom.test.js +0 -13
- package/dist/helpers/__tests__/bookmarks.test.d.ts +0 -1
- package/dist/helpers/__tests__/bookmarks.test.js +0 -88
- package/dist/helpers/__tests__/comment.test.d.ts +0 -1
- package/dist/helpers/__tests__/comment.test.js +0 -249
- package/dist/helpers/__tests__/contacts.test.d.ts +0 -1
- package/dist/helpers/__tests__/contacts.test.js +0 -34
- package/dist/helpers/__tests__/emoji.test.d.ts +0 -1
- package/dist/helpers/__tests__/emoji.test.js +0 -15
- package/dist/helpers/__tests__/event.test.d.ts +0 -1
- package/dist/helpers/__tests__/event.test.js +0 -36
- package/dist/helpers/__tests__/events.test.d.ts +0 -1
- package/dist/helpers/__tests__/events.test.js +0 -32
- package/dist/helpers/__tests__/exports.test.d.ts +0 -1
- package/dist/helpers/__tests__/exports.test.js +0 -220
- package/dist/helpers/__tests__/file-metadata.test.d.ts +0 -1
- package/dist/helpers/__tests__/file-metadata.test.js +0 -103
- package/dist/helpers/__tests__/hidden-tags.test.d.ts +0 -1
- package/dist/helpers/__tests__/hidden-tags.test.js +0 -29
- package/dist/helpers/__tests__/mailboxes.test.d.ts +0 -1
- package/dist/helpers/__tests__/mailboxes.test.js +0 -81
- package/dist/helpers/__tests__/mutes.test.d.ts +0 -1
- package/dist/helpers/__tests__/mutes.test.js +0 -55
- package/dist/helpers/__tests__/nip-19.test.d.ts +0 -1
- package/dist/helpers/__tests__/nip-19.test.js +0 -42
- package/dist/helpers/__tests__/relays.test.d.ts +0 -1
- package/dist/helpers/__tests__/relays.test.js +0 -21
- package/dist/helpers/__tests__/tags.test.d.ts +0 -1
- package/dist/helpers/__tests__/tags.test.js +0 -24
- package/dist/helpers/__tests__/threading.test.d.ts +0 -1
- package/dist/helpers/__tests__/threading.test.js +0 -41
- package/dist/helpers/direct-messages.d.ts +0 -4
- package/dist/helpers/direct-messages.js +0 -5
- package/dist/helpers/nip-19.d.ts +0 -18
- package/dist/helpers/nip-19.js +0 -56
- package/dist/observable/__tests__/claim-events.test.d.ts +0 -1
- package/dist/observable/__tests__/claim-events.test.js +0 -23
- package/dist/observable/__tests__/claim-latest.test.d.ts +0 -1
- package/dist/observable/__tests__/claim-latest.test.js +0 -37
- package/dist/observable/__tests__/exports.test.d.ts +0 -1
- package/dist/observable/__tests__/exports.test.js +0 -18
- package/dist/observable/__tests__/listen-latest-updates.test.d.ts +0 -1
- package/dist/observable/__tests__/listen-latest-updates.test.js +0 -55
- package/dist/observable/__tests__/simple-timeout.test.d.ts +0 -1
- package/dist/observable/__tests__/simple-timeout.test.js +0 -34
- package/dist/observable/listen-latest-updates.d.ts +0 -5
- package/dist/observable/listen-latest-updates.js +0 -12
- package/dist/promise/__tests__/exports.test.d.ts +0 -1
- package/dist/promise/__tests__/exports.test.js +0 -11
- package/dist/queries/__tests__/exports.test.d.ts +0 -1
- package/dist/queries/__tests__/exports.test.js +0 -41
- package/dist/queries/blossom.d.ts +0 -2
- package/dist/queries/blossom.js +0 -5
- package/dist/queries/bookmarks.d.ts +0 -8
- package/dist/queries/channels.d.ts +0 -11
- package/dist/queries/comments.d.ts +0 -4
- package/dist/queries/comments.js +0 -11
- package/dist/queries/contacts.d.ts +0 -8
- package/dist/queries/mailboxes.d.ts +0 -6
- package/dist/queries/mutes.d.ts +0 -8
- package/dist/queries/pins.d.ts +0 -4
- package/dist/queries/profile.d.ts +0 -4
- package/dist/queries/profile.js +0 -7
- package/dist/queries/reactions.d.ts +0 -4
- package/dist/queries/relays.d.ts +0 -27
- package/dist/queries/simple.d.ts +0 -16
- package/dist/queries/simple.js +0 -21
- package/dist/queries/user-status.d.ts +0 -11
- package/dist/queries/zaps.d.ts +0 -5
- package/dist/query-store/__tests__/exports.test.d.ts +0 -1
- package/dist/query-store/__tests__/exports.test.js +0 -12
- package/dist/query-store/__tests__/query-store.test.d.ts +0 -1
- package/dist/query-store/__tests__/query-store.test.js +0 -63
- package/dist/query-store/index.d.ts +0 -1
- package/dist/query-store/index.js +0 -1
- package/dist/query-store/query-store.d.ts +0 -54
- package/dist/query-store/query-store.js +0 -102
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
import { beforeEach, describe, expect, it } from "vitest";
|
|
2
|
-
import { subscribeSpyTo } from "@hirez_io/observer-spy";
|
|
3
|
-
import { of } from "rxjs";
|
|
4
|
-
import { EventStore } from "../../event-store/event-store.js";
|
|
5
|
-
import { listenLatestUpdates } from "../listen-latest-updates.js";
|
|
6
|
-
import { FakeUser } from "../../__tests__/fixtures.js";
|
|
7
|
-
let eventStore;
|
|
8
|
-
let user;
|
|
9
|
-
let event;
|
|
10
|
-
beforeEach(() => {
|
|
11
|
-
eventStore = new EventStore();
|
|
12
|
-
user = new FakeUser();
|
|
13
|
-
event = user.note("original content");
|
|
14
|
-
});
|
|
15
|
-
describe("listenLatestUpdates", () => {
|
|
16
|
-
it("should emit the initial event", () => {
|
|
17
|
-
const source = of(event);
|
|
18
|
-
const spy = subscribeSpyTo(source.pipe(listenLatestUpdates(eventStore)));
|
|
19
|
-
expect(spy.getValues()).toEqual([event]);
|
|
20
|
-
});
|
|
21
|
-
it("should emit the event again when it's updated in the event store", () => {
|
|
22
|
-
// Add the event to the store first
|
|
23
|
-
eventStore.add(event);
|
|
24
|
-
// Create a source that emits the event
|
|
25
|
-
const source = of(event);
|
|
26
|
-
const spy = subscribeSpyTo(source.pipe(listenLatestUpdates(eventStore)));
|
|
27
|
-
// Create an updated version of the event
|
|
28
|
-
Reflect.set(event, Symbol.for("new-prop"), "testing");
|
|
29
|
-
// Update the event in the store
|
|
30
|
-
eventStore.update(event);
|
|
31
|
-
// Should have received both the original and updated event
|
|
32
|
-
expect(spy.getValues()).toEqual([event, event]);
|
|
33
|
-
});
|
|
34
|
-
it("should not emit updates for other events", () => {
|
|
35
|
-
// Add the event to the store
|
|
36
|
-
eventStore.add(event);
|
|
37
|
-
// Create a source that emits the event
|
|
38
|
-
const source = of(event);
|
|
39
|
-
const spy = subscribeSpyTo(source.pipe(listenLatestUpdates(eventStore)));
|
|
40
|
-
// Create a different event
|
|
41
|
-
const otherEvent = user.note("other content");
|
|
42
|
-
// Add the other event to the store
|
|
43
|
-
eventStore.add(otherEvent);
|
|
44
|
-
// Should only have received the original event
|
|
45
|
-
expect(spy.getValues()).toEqual([event]);
|
|
46
|
-
});
|
|
47
|
-
it("should handle undefined initial event", () => {
|
|
48
|
-
const source = of(undefined);
|
|
49
|
-
const spy = subscribeSpyTo(source.pipe(listenLatestUpdates(eventStore)));
|
|
50
|
-
expect(spy.getValues()).toEqual([undefined]);
|
|
51
|
-
// Adding events to the store should not trigger emissions
|
|
52
|
-
eventStore.add(event);
|
|
53
|
-
expect(spy.getValues()).toEqual([undefined]);
|
|
54
|
-
});
|
|
55
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import { describe, it, expect } from "vitest";
|
|
2
|
-
import { Observable, Subject, firstValueFrom } from "rxjs";
|
|
3
|
-
import { simpleTimeout, TimeoutError } from "../simple-timeout.js";
|
|
4
|
-
describe("simpleTimeout operator", () => {
|
|
5
|
-
it("should throw TimeoutError after specified timeout period", async () => {
|
|
6
|
-
const subject = new Subject();
|
|
7
|
-
const obs = subject.pipe(simpleTimeout(10));
|
|
8
|
-
const promise = firstValueFrom(obs);
|
|
9
|
-
await expect(promise).rejects.toThrow(TimeoutError);
|
|
10
|
-
await expect(promise).rejects.toThrow("Timeout");
|
|
11
|
-
});
|
|
12
|
-
it("should throw TimeoutError with custom message", async () => {
|
|
13
|
-
const subject = new Subject();
|
|
14
|
-
const customMessage = "Custom timeout message";
|
|
15
|
-
const obs = subject.pipe(simpleTimeout(10, customMessage));
|
|
16
|
-
const promise = firstValueFrom(obs);
|
|
17
|
-
await expect(promise).rejects.toThrow(TimeoutError);
|
|
18
|
-
await expect(promise).rejects.toThrow(customMessage);
|
|
19
|
-
});
|
|
20
|
-
it("should not throw when value emitted before timeout", async () => {
|
|
21
|
-
const subject = new Subject();
|
|
22
|
-
const obs = subject.pipe(simpleTimeout(1000));
|
|
23
|
-
const promise = firstValueFrom(obs);
|
|
24
|
-
subject.next("test value");
|
|
25
|
-
await expect(promise).resolves.toBe("test value");
|
|
26
|
-
});
|
|
27
|
-
it("should complete without error when source emits non-null value before timeout", async () => {
|
|
28
|
-
const source = new Observable((subscriber) => {
|
|
29
|
-
subscriber.next("test value");
|
|
30
|
-
});
|
|
31
|
-
const result = await firstValueFrom(source.pipe(simpleTimeout(10)));
|
|
32
|
-
expect(result).toBe("test value");
|
|
33
|
-
});
|
|
34
|
-
});
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import { NostrEvent } from "nostr-tools";
|
|
2
|
-
import { MonoTypeOperatorFunction } from "rxjs";
|
|
3
|
-
import { IStreamEventStore } from "../event-store/interface.js";
|
|
4
|
-
/** Lists for any updates to the latest event and remits it */
|
|
5
|
-
export declare function listenLatestUpdates(eventStore: IStreamEventStore): MonoTypeOperatorFunction<NostrEvent | undefined>;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { filter, merge, tap } from "rxjs";
|
|
2
|
-
/** Lists for any updates to the latest event and remits it */
|
|
3
|
-
export function listenLatestUpdates(eventStore) {
|
|
4
|
-
return (source) => {
|
|
5
|
-
let latest;
|
|
6
|
-
return merge(
|
|
7
|
-
// Get the latest event
|
|
8
|
-
source.pipe(tap((value) => (latest = value))),
|
|
9
|
-
// listen for updates
|
|
10
|
-
eventStore.updates.pipe(filter((e) => e.id === latest?.id)));
|
|
11
|
-
};
|
|
12
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,11 +0,0 @@
|
|
|
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
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,41 +0,0 @@
|
|
|
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
|
-
});
|
package/dist/queries/blossom.js
DELETED
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import { map } from "rxjs/operators";
|
|
2
|
-
import { BLOSSOM_SERVER_LIST_KIND, getBlossomServersFromList } from "../helpers/blossom.js";
|
|
3
|
-
export function UserBlossomServersQuery(pubkey) {
|
|
4
|
-
return (store) => store.replaceable(BLOSSOM_SERVER_LIST_KIND, pubkey).pipe(map((event) => event && getBlossomServersFromList(event)));
|
|
5
|
-
}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { Bookmarks } from "../helpers/bookmarks.js";
|
|
2
|
-
import { Query } from "../query-store/index.js";
|
|
3
|
-
/** A query that returns all the bookmarks of a user */
|
|
4
|
-
export declare function UserBookmarkQuery(pubkey: string): Query<Bookmarks | undefined>;
|
|
5
|
-
/** A query that returns all the public bookmarks of a user */
|
|
6
|
-
export declare function UserPublicBookmarkQuery(pubkey: string): Query<Bookmarks | undefined>;
|
|
7
|
-
/** A query that returns all the hidden bookmarks of a user */
|
|
8
|
-
export declare function UserHiddenBookmarkQuery(pubkey: string): Query<Bookmarks | null | undefined>;
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { Query } from "applesauce-core";
|
|
2
|
-
import { NostrEvent } from "nostr-tools";
|
|
3
|
-
import { ChannelMetadataContent } from "../helpers/channels.js";
|
|
4
|
-
/** A query that returns a map of hidden messages Map<id, reason> */
|
|
5
|
-
export declare function ChannelHiddenQuery(channel: NostrEvent, authors?: string[]): Query<Map<string, string>>;
|
|
6
|
-
/** A query that returns all messages in a channel */
|
|
7
|
-
export declare function ChannelMessagesQuery(channel: NostrEvent): Query<NostrEvent[]>;
|
|
8
|
-
/** A query that returns the latest parsed metadata */
|
|
9
|
-
export declare function ChannelMetadataQuery(channel: NostrEvent): Query<ChannelMetadataContent | undefined>;
|
|
10
|
-
/** A query that returns a map of muted users Map<pubkey, reason> */
|
|
11
|
-
export declare function ChannelMutedQuery(channel: NostrEvent, authors?: string[]): Query<Map<string, string>>;
|
package/dist/queries/comments.js
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { COMMENT_KIND, getEventUID } from "../helpers/index.js";
|
|
2
|
-
import { isAddressableKind } from "nostr-tools/kinds";
|
|
3
|
-
/** Returns all NIP-22 comment replies for the event */
|
|
4
|
-
export function CommentsQuery(parent) {
|
|
5
|
-
return (events) => {
|
|
6
|
-
const filter = { kinds: [COMMENT_KIND], "#e": [parent.id] };
|
|
7
|
-
if (isAddressableKind(parent.kind))
|
|
8
|
-
filter["#a"] = [getEventUID(parent)];
|
|
9
|
-
return events.timeline(filter);
|
|
10
|
-
};
|
|
11
|
-
}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { ProfilePointer } from "nostr-tools/nip19";
|
|
2
|
-
import { Query } from "../query-store/index.js";
|
|
3
|
-
/** A query that returns all contacts for a user */
|
|
4
|
-
export declare function ContactsQuery(pubkey: string): Query<ProfilePointer[] | undefined>;
|
|
5
|
-
/** A query that returns all public contacts for a user */
|
|
6
|
-
export declare function PublicContactsQuery(pubkey: string): Query<ProfilePointer[] | undefined>;
|
|
7
|
-
/** A query that returns all hidden contacts for a user */
|
|
8
|
-
export declare function HiddenContactsQuery(pubkey: string): Query<ProfilePointer[] | null | undefined>;
|
package/dist/queries/mutes.d.ts
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { Mutes } from "../helpers/mutes.js";
|
|
2
|
-
import { Query } from "../query-store/index.js";
|
|
3
|
-
/** A query that returns all a users muted things */
|
|
4
|
-
export declare function MuteQuery(pubkey: string): Query<Mutes | undefined>;
|
|
5
|
-
/** A query that returns all a users public muted things */
|
|
6
|
-
export declare function PublicMuteQuery(pubkey: string): Query<Mutes | undefined>;
|
|
7
|
-
/** A query that returns all a users hidden muted things */
|
|
8
|
-
export declare function HiddenMuteQuery(pubkey: string): Query<Mutes | null | undefined>;
|
package/dist/queries/pins.d.ts
DELETED
package/dist/queries/profile.js
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { kinds } from "nostr-tools";
|
|
2
|
-
import { filter, map } from "rxjs/operators";
|
|
3
|
-
import { getProfileContent, isValidProfile } from "../helpers/profile.js";
|
|
4
|
-
/** A query that gets and parses the kind 0 metadata for a pubkey */
|
|
5
|
-
export function ProfileQuery(pubkey) {
|
|
6
|
-
return (events) => events.replaceable(kinds.Metadata, pubkey).pipe(filter(isValidProfile), map((event) => event && getProfileContent(event)));
|
|
7
|
-
}
|
package/dist/queries/relays.d.ts
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import { AddressPointer } from "nostr-tools/nip19";
|
|
2
|
-
import { ReadListTags } from "../helpers/lists.js";
|
|
3
|
-
import { Query } from "../query-store/query-store.js";
|
|
4
|
-
/**
|
|
5
|
-
* A query that returns all favorite relays for a pubkey
|
|
6
|
-
* @param pubkey - The pubkey to get the favorite relays for
|
|
7
|
-
* @param type - Which types of tags to read
|
|
8
|
-
*/
|
|
9
|
-
export declare function FavoriteRelays(pubkey: string, type?: ReadListTags): Query<string[] | undefined>;
|
|
10
|
-
/**
|
|
11
|
-
* A query that returns all favorite relay sets for a pubkey
|
|
12
|
-
* @param pubkey - The pubkey to get the favorite relay sets for
|
|
13
|
-
* @param type - Which types of tags to read
|
|
14
|
-
*/
|
|
15
|
-
export declare function FavoriteRelaySets(pubkey: string, type?: ReadListTags): Query<AddressPointer[] | undefined>;
|
|
16
|
-
/**
|
|
17
|
-
* A query that returns all search relays for a pubkey
|
|
18
|
-
* @param pubkey - The pubkey to get the search relays for
|
|
19
|
-
* @param type - Which types of tags to read
|
|
20
|
-
*/
|
|
21
|
-
export declare function SearchRelays(pubkey: string, type?: ReadListTags): Query<string[] | undefined>;
|
|
22
|
-
/**
|
|
23
|
-
* A query that returns all blocked relays for a pubkey
|
|
24
|
-
* @param pubkey - The pubkey to get the blocked relays for
|
|
25
|
-
* @param type - Which types of tags to read
|
|
26
|
-
*/
|
|
27
|
-
export declare function BlockedRelays(pubkey: string, type?: ReadListTags): Query<string[] | undefined>;
|
package/dist/queries/simple.d.ts
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { Filter, NostrEvent } from "nostr-tools";
|
|
2
|
-
import { Query } from "../query-store/index.js";
|
|
3
|
-
/** Creates a Query that returns a single event or undefined */
|
|
4
|
-
export declare function SingleEventQuery(id: string): Query<NostrEvent | undefined>;
|
|
5
|
-
/** Creates a Query that returns a multiple events in a map */
|
|
6
|
-
export declare function MultipleEventsQuery(ids: string[]): Query<Record<string, NostrEvent>>;
|
|
7
|
-
/** Creates a Query returning the latest version of a replaceable event */
|
|
8
|
-
export declare function ReplaceableQuery(kind: number, pubkey: string, d?: string): Query<NostrEvent | undefined>;
|
|
9
|
-
/** Creates a Query that returns an array of sorted events matching the filters */
|
|
10
|
-
export declare function TimelineQuery(filters: Filter | Filter[], includeOldVersion?: boolean): Query<NostrEvent[]>;
|
|
11
|
-
/** Creates a Query that returns a directory of events by their UID */
|
|
12
|
-
export declare function ReplaceableSetQuery(pointers: {
|
|
13
|
-
kind: number;
|
|
14
|
-
pubkey: string;
|
|
15
|
-
identifier?: string;
|
|
16
|
-
}[]): Query<Record<string, NostrEvent>>;
|
package/dist/queries/simple.js
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
/** Creates a Query that returns a single event or undefined */
|
|
2
|
-
export function SingleEventQuery(id) {
|
|
3
|
-
return (events) => events.event(id);
|
|
4
|
-
}
|
|
5
|
-
/** Creates a Query that returns a multiple events in a map */
|
|
6
|
-
export function MultipleEventsQuery(ids) {
|
|
7
|
-
return (events) => events.events(ids);
|
|
8
|
-
}
|
|
9
|
-
/** Creates a Query returning the latest version of a replaceable event */
|
|
10
|
-
export function ReplaceableQuery(kind, pubkey, d) {
|
|
11
|
-
return (events) => events.replaceable(kind, pubkey, d);
|
|
12
|
-
}
|
|
13
|
-
/** Creates a Query that returns an array of sorted events matching the filters */
|
|
14
|
-
export function TimelineQuery(filters, includeOldVersion) {
|
|
15
|
-
filters = Array.isArray(filters) ? filters : [filters];
|
|
16
|
-
return (events) => events.timeline(filters, includeOldVersion);
|
|
17
|
-
}
|
|
18
|
-
/** Creates a Query that returns a directory of events by their UID */
|
|
19
|
-
export function ReplaceableSetQuery(pointers) {
|
|
20
|
-
return (events) => events.replaceableSet(pointers);
|
|
21
|
-
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { NostrEvent } from "nostr-tools";
|
|
2
|
-
import { UserStatusPointer } from "../helpers/user-status.js";
|
|
3
|
-
import { Query } from "../query-store/index.js";
|
|
4
|
-
export type UserStatus = UserStatusPointer & {
|
|
5
|
-
event: NostrEvent;
|
|
6
|
-
content: string;
|
|
7
|
-
};
|
|
8
|
-
/** Creates a Query that returns a parsed {@link UserStatus} for a certain type */
|
|
9
|
-
export declare function UserStatusQuery(pubkey: string, type?: string): Query<UserStatus | undefined | null>;
|
|
10
|
-
/** Creates a Query that returns a directory of parsed {@link UserStatus} for a pubkey */
|
|
11
|
-
export declare function UserStatusesQuery(pubkey: string): Query<Record<string, UserStatus>>;
|
package/dist/queries/zaps.d.ts
DELETED
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import { AddressPointer, EventPointer } from "nostr-tools/nip19";
|
|
2
|
-
import { NostrEvent } from "nostr-tools";
|
|
3
|
-
import { Query } from "../query-store/index.js";
|
|
4
|
-
/** A query that gets all zap events for an event */
|
|
5
|
-
export declare function EventZapsQuery(id: string | EventPointer | AddressPointer): Query<NostrEvent[]>;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,12 +0,0 @@
|
|
|
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
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
import { describe, it, expect, beforeEach } from "vitest";
|
|
2
|
-
import { subscribeSpyTo } from "@hirez_io/observer-spy";
|
|
3
|
-
import { EventStore } from "../../event-store/event-store.js";
|
|
4
|
-
import { QueryStore } from "../query-store.js";
|
|
5
|
-
import { ProfileQuery } from "../../queries/profile.js";
|
|
6
|
-
import { SingleEventQuery } from "../../queries/simple.js";
|
|
7
|
-
let eventStore;
|
|
8
|
-
let queryStore;
|
|
9
|
-
const event = {
|
|
10
|
-
content: '{"name":"hzrd149","picture":"https://cdn.hzrd149.com/5ed3fe5df09a74e8c126831eac999364f9eb7624e2b86d521521b8021de20bdc.png","about":"JavaScript developer working on some nostr stuff\\n- noStrudel https://nostrudel.ninja/ \\n- Blossom https://github.com/hzrd149/blossom \\n- Applesauce https://hzrd149.github.io/applesauce/","website":"https://hzrd149.com","nip05":"_@hzrd149.com","lud16":"hzrd1499@minibits.cash","pubkey":"266815e0c9210dfa324c6cba3573b14bee49da4209a9456f9484e5106cd408a5","display_name":"hzrd149","displayName":"hzrd149","banner":""}',
|
|
11
|
-
created_at: 1738362529,
|
|
12
|
-
id: "e9df8d5898c4ccfbd21fcd59f3f48abb3ff0ab7259b19570e2f1756de1e9306b",
|
|
13
|
-
kind: 0,
|
|
14
|
-
pubkey: "266815e0c9210dfa324c6cba3573b14bee49da4209a9456f9484e5106cd408a5",
|
|
15
|
-
sig: "465a47b93626a587bf81dadc2b306b8f713a62db31d6ce1533198e9ae1e665a6eaf376a03250bf9ffbb02eb9059c8eafbd37ae1092d05d215757575bd8357586",
|
|
16
|
-
tags: [],
|
|
17
|
-
};
|
|
18
|
-
beforeEach(() => {
|
|
19
|
-
eventStore = new EventStore();
|
|
20
|
-
queryStore = new QueryStore(eventStore);
|
|
21
|
-
});
|
|
22
|
-
describe("createQuery", () => {
|
|
23
|
-
it("should emit synchronous value if it exists", () => {
|
|
24
|
-
let value = undefined;
|
|
25
|
-
eventStore.add(event);
|
|
26
|
-
queryStore.createQuery(ProfileQuery, event.pubkey).subscribe((v) => (value = v));
|
|
27
|
-
expect(value).not.toBe(undefined);
|
|
28
|
-
});
|
|
29
|
-
it("should not emit undefined if value exists", () => {
|
|
30
|
-
eventStore.add(event);
|
|
31
|
-
const spy = subscribeSpyTo(queryStore.createQuery(SingleEventQuery, event.id));
|
|
32
|
-
expect(spy.getValues()).toEqual([event]);
|
|
33
|
-
});
|
|
34
|
-
it("should emit synchronous undefined if value does not exists", () => {
|
|
35
|
-
let value = 0;
|
|
36
|
-
queryStore.createQuery(ProfileQuery, event.pubkey).subscribe((v) => {
|
|
37
|
-
value = v;
|
|
38
|
-
});
|
|
39
|
-
expect(value).not.toBe(0);
|
|
40
|
-
expect(value).toBe(undefined);
|
|
41
|
-
});
|
|
42
|
-
it("should share latest value", () => {
|
|
43
|
-
eventStore.add(event);
|
|
44
|
-
const spy = subscribeSpyTo(queryStore.createQuery(SingleEventQuery, event.id));
|
|
45
|
-
const spy2 = subscribeSpyTo(queryStore.createQuery(SingleEventQuery, event.id));
|
|
46
|
-
expect(spy.getValues()).toEqual([event]);
|
|
47
|
-
expect(spy2.getValues()).toEqual([event]);
|
|
48
|
-
});
|
|
49
|
-
});
|
|
50
|
-
describe("executeQuery", () => {
|
|
51
|
-
it("should resolve when value is already present", async () => {
|
|
52
|
-
eventStore.add(event);
|
|
53
|
-
expect(await queryStore.executeQuery(ProfileQuery, event.pubkey)).toEqual(expect.objectContaining({ name: "hzrd149" }));
|
|
54
|
-
});
|
|
55
|
-
it("should resolve when value is added to event store", async () => {
|
|
56
|
-
const p = queryStore.executeQuery(ProfileQuery, event.pubkey);
|
|
57
|
-
// delay adding the event
|
|
58
|
-
setTimeout(() => {
|
|
59
|
-
eventStore.add(event);
|
|
60
|
-
}, 10);
|
|
61
|
-
await expect(p).resolves.toEqual(expect.objectContaining({ name: "hzrd149" }));
|
|
62
|
-
});
|
|
63
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "./query-store.js";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "./query-store.js";
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
import { Observable } from "rxjs";
|
|
2
|
-
import { Filter, NostrEvent } from "nostr-tools";
|
|
3
|
-
import type { AddressPointer, EventPointer } from "nostr-tools/nip19";
|
|
4
|
-
import { IEventStore } from "../event-store/interface.js";
|
|
5
|
-
import * as Queries from "../queries/index.js";
|
|
6
|
-
export type Query<T extends unknown> = (events: IEventStore, store: QueryStore) => Observable<T>;
|
|
7
|
-
export type QueryConstructor<T extends unknown, Args extends Array<any>> = ((...args: Args) => Query<T>) & {
|
|
8
|
-
getKey?: (...args: Args) => string;
|
|
9
|
-
};
|
|
10
|
-
export declare class QueryStore {
|
|
11
|
-
static Queries: typeof Queries;
|
|
12
|
-
store: IEventStore;
|
|
13
|
-
constructor(store: IEventStore);
|
|
14
|
-
/** A directory of all active queries */
|
|
15
|
-
queries: Map<QueryConstructor<any, any[]>, Map<string, Observable<any>>>;
|
|
16
|
-
/** How long a query should be kept "warm" while nothing is subscribed to it */
|
|
17
|
-
queryKeepWarmTimeout: number;
|
|
18
|
-
/** Creates a cached query */
|
|
19
|
-
createQuery<T extends unknown, Args extends Array<any>>(queryConstructor: QueryConstructor<T, Args>, ...args: Args): Observable<T | undefined>;
|
|
20
|
-
/** Creates a query and waits for the next value */
|
|
21
|
-
executeQuery<T extends unknown, Args extends Array<any>>(queryConstructor: QueryConstructor<T, Args>, ...args: Args): Promise<T>;
|
|
22
|
-
/** Creates a SingleEventQuery */
|
|
23
|
-
event(id: string): Observable<import("nostr-tools").Event | undefined>;
|
|
24
|
-
/** Creates a MultipleEventsQuery */
|
|
25
|
-
events(ids: string[]): Observable<Record<string, import("nostr-tools").Event> | undefined>;
|
|
26
|
-
/** Creates a ReplaceableQuery */
|
|
27
|
-
replaceable(kind: number, pubkey: string, d?: string): Observable<import("nostr-tools").Event | undefined>;
|
|
28
|
-
/** Creates a ReplaceableSetQuery */
|
|
29
|
-
replaceableSet(pointers: {
|
|
30
|
-
kind: number;
|
|
31
|
-
pubkey: string;
|
|
32
|
-
identifier?: string;
|
|
33
|
-
}[]): Observable<Record<string, import("nostr-tools").Event> | undefined>;
|
|
34
|
-
/** Creates a TimelineQuery */
|
|
35
|
-
timeline(filters: Filter | Filter[], keepOldVersions?: boolean): Observable<import("nostr-tools").Event[] | undefined>;
|
|
36
|
-
/** Creates a ProfileQuery */
|
|
37
|
-
profile(pubkey: string): Observable<import("../helpers/profile.js").ProfileContent | undefined>;
|
|
38
|
-
/** Creates a ContactsQuery */
|
|
39
|
-
contacts(pubkey: string): Observable<import("nostr-tools/nip19").ProfilePointer[] | undefined>;
|
|
40
|
-
/** Creates a MuteQuery */
|
|
41
|
-
mutes(pubkey: string): Observable<import("../helpers/mutes.js").Mutes | undefined>;
|
|
42
|
-
/** Creates a ReactionsQuery */
|
|
43
|
-
reactions(event: NostrEvent): Observable<import("nostr-tools").Event[] | undefined>;
|
|
44
|
-
/** Creates a MailboxesQuery */
|
|
45
|
-
mailboxes(pubkey: string): Observable<{
|
|
46
|
-
inboxes: string[];
|
|
47
|
-
outboxes: string[];
|
|
48
|
-
} | undefined>;
|
|
49
|
-
/** Creates a query for a users blossom servers */
|
|
50
|
-
blossomServers(pubkey: string): Observable<URL[] | undefined>;
|
|
51
|
-
/** Creates a ThreadQuery */
|
|
52
|
-
thread(root: string | EventPointer | AddressPointer): Observable<Queries.Thread | undefined>;
|
|
53
|
-
}
|
|
54
|
-
export { Queries };
|
|
@@ -1,102 +0,0 @@
|
|
|
1
|
-
import { filter, finalize, firstValueFrom, ReplaySubject, share, timer } from "rxjs";
|
|
2
|
-
import hash_sum from "hash-sum";
|
|
3
|
-
import * as Queries from "../queries/index.js";
|
|
4
|
-
import { withImmediateValueOrDefault } from "../observable/with-immediate-value.js";
|
|
5
|
-
export class QueryStore {
|
|
6
|
-
static Queries = Queries;
|
|
7
|
-
store;
|
|
8
|
-
constructor(store) {
|
|
9
|
-
if (!store)
|
|
10
|
-
throw new Error("EventStore required");
|
|
11
|
-
this.store = store;
|
|
12
|
-
}
|
|
13
|
-
/** A directory of all active queries */
|
|
14
|
-
queries = new Map();
|
|
15
|
-
/** How long a query should be kept "warm" while nothing is subscribed to it */
|
|
16
|
-
queryKeepWarmTimeout = 60_000;
|
|
17
|
-
/** Creates a cached query */
|
|
18
|
-
createQuery(queryConstructor, ...args) {
|
|
19
|
-
let observables = this.queries.get(queryConstructor);
|
|
20
|
-
if (!observables) {
|
|
21
|
-
observables = new Map();
|
|
22
|
-
this.queries.set(queryConstructor, observables);
|
|
23
|
-
}
|
|
24
|
-
const key = queryConstructor.getKey ? queryConstructor.getKey(...args) : hash_sum(args);
|
|
25
|
-
let observable = observables.get(key);
|
|
26
|
-
if (!observable) {
|
|
27
|
-
const cleanup = () => {
|
|
28
|
-
if (observables.get(key) === observable)
|
|
29
|
-
observables.delete(key);
|
|
30
|
-
};
|
|
31
|
-
observable = queryConstructor(...args)(this.store, this).pipe(
|
|
32
|
-
// always emit undefined so the observable is sync
|
|
33
|
-
withImmediateValueOrDefault(undefined),
|
|
34
|
-
// remove the observable when its unsubscribed
|
|
35
|
-
finalize(cleanup),
|
|
36
|
-
// only create a single observable for all components
|
|
37
|
-
share({
|
|
38
|
-
connector: () => new ReplaySubject(1),
|
|
39
|
-
resetOnComplete: () => timer(this.queryKeepWarmTimeout),
|
|
40
|
-
resetOnRefCountZero: () => timer(this.queryKeepWarmTimeout),
|
|
41
|
-
}));
|
|
42
|
-
// set debug fields
|
|
43
|
-
Reflect.set(observable, "queryArgs", args);
|
|
44
|
-
observables.set(key, observable);
|
|
45
|
-
}
|
|
46
|
-
return observable;
|
|
47
|
-
}
|
|
48
|
-
/** Creates a query and waits for the next value */
|
|
49
|
-
async executeQuery(queryConstructor, ...args) {
|
|
50
|
-
const query = this.createQuery(queryConstructor, ...args).pipe(filter((v) => v !== undefined));
|
|
51
|
-
return firstValueFrom(query);
|
|
52
|
-
}
|
|
53
|
-
/** Creates a SingleEventQuery */
|
|
54
|
-
event(id) {
|
|
55
|
-
return this.createQuery(Queries.SingleEventQuery, id);
|
|
56
|
-
}
|
|
57
|
-
/** Creates a MultipleEventsQuery */
|
|
58
|
-
events(ids) {
|
|
59
|
-
return this.createQuery(Queries.MultipleEventsQuery, ids);
|
|
60
|
-
}
|
|
61
|
-
/** Creates a ReplaceableQuery */
|
|
62
|
-
replaceable(kind, pubkey, d) {
|
|
63
|
-
return this.createQuery(Queries.ReplaceableQuery, kind, pubkey, d);
|
|
64
|
-
}
|
|
65
|
-
/** Creates a ReplaceableSetQuery */
|
|
66
|
-
replaceableSet(pointers) {
|
|
67
|
-
return this.createQuery(Queries.ReplaceableSetQuery, pointers);
|
|
68
|
-
}
|
|
69
|
-
/** Creates a TimelineQuery */
|
|
70
|
-
timeline(filters, keepOldVersions) {
|
|
71
|
-
return this.createQuery(Queries.TimelineQuery, filters, keepOldVersions);
|
|
72
|
-
}
|
|
73
|
-
/** Creates a ProfileQuery */
|
|
74
|
-
profile(pubkey) {
|
|
75
|
-
return this.createQuery(Queries.ProfileQuery, pubkey);
|
|
76
|
-
}
|
|
77
|
-
/** Creates a ContactsQuery */
|
|
78
|
-
contacts(pubkey) {
|
|
79
|
-
return this.createQuery(Queries.ContactsQuery, pubkey);
|
|
80
|
-
}
|
|
81
|
-
/** Creates a MuteQuery */
|
|
82
|
-
mutes(pubkey) {
|
|
83
|
-
return this.createQuery(Queries.MuteQuery, pubkey);
|
|
84
|
-
}
|
|
85
|
-
/** Creates a ReactionsQuery */
|
|
86
|
-
reactions(event) {
|
|
87
|
-
return this.createQuery(Queries.ReactionsQuery, event);
|
|
88
|
-
}
|
|
89
|
-
/** Creates a MailboxesQuery */
|
|
90
|
-
mailboxes(pubkey) {
|
|
91
|
-
return this.createQuery(Queries.MailboxesQuery, pubkey);
|
|
92
|
-
}
|
|
93
|
-
/** Creates a query for a users blossom servers */
|
|
94
|
-
blossomServers(pubkey) {
|
|
95
|
-
return this.createQuery(Queries.UserBlossomServersQuery, pubkey);
|
|
96
|
-
}
|
|
97
|
-
/** Creates a ThreadQuery */
|
|
98
|
-
thread(root) {
|
|
99
|
-
return this.createQuery(Queries.ThreadQuery, root);
|
|
100
|
-
}
|
|
101
|
-
}
|
|
102
|
-
export { Queries };
|