applesauce-common 6.2.0 → 7.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 +1 -0
- package/dist/casts/_circular-import.d.ts +3 -0
- package/dist/casts/_circular-import.js +3 -0
- package/dist/casts/app-handler.d.ts +56 -0
- package/dist/casts/app-handler.js +105 -0
- package/dist/casts/app-recommendation.d.ts +26 -0
- package/dist/casts/app-recommendation.js +41 -0
- package/dist/casts/external-identities.d.ts +9 -0
- package/dist/casts/external-identities.js +14 -0
- package/dist/casts/forum-thread.d.ts +17 -0
- package/dist/casts/forum-thread.js +31 -0
- package/dist/casts/git-issue.d.ts +18 -0
- package/dist/casts/git-issue.js +26 -0
- package/dist/casts/git-patch.d.ts +49 -0
- package/dist/casts/git-patch.js +88 -0
- package/dist/casts/git-pull-request.d.ts +67 -0
- package/dist/casts/git-pull-request.js +122 -0
- package/dist/casts/git-repository.d.ts +9 -0
- package/dist/casts/git-repository.js +16 -0
- package/dist/casts/git-thread.d.ts +33 -0
- package/dist/casts/git-thread.js +65 -0
- package/dist/casts/index.d.ts +12 -0
- package/dist/casts/index.js +12 -0
- package/dist/casts/napplet-handlers.d.ts +39 -0
- package/dist/casts/napplet-handlers.js +91 -0
- package/dist/casts/napplet.d.ts +98 -0
- package/dist/casts/napplet.js +196 -0
- package/dist/casts/note.d.ts +8 -0
- package/dist/casts/note.js +21 -1
- package/dist/casts/nsite.d.ts +134 -0
- package/dist/casts/nsite.js +249 -0
- package/dist/casts/profile.d.ts +20 -0
- package/dist/casts/profile.js +30 -0
- package/dist/casts/reaction.d.ts +1 -1
- package/dist/casts/relay-discovery.d.ts +4 -0
- package/dist/casts/relay-discovery.js +9 -1
- package/dist/casts/report.d.ts +28 -15
- package/dist/casts/report.js +42 -19
- package/dist/casts/share.d.ts +1 -1
- package/dist/casts/torrent.d.ts +5 -0
- package/dist/casts/torrent.js +8 -1
- package/dist/casts/trusted-assertions.d.ts +2 -0
- package/dist/casts/trusted-assertions.js +19 -18
- package/dist/casts/user-status.d.ts +33 -0
- package/dist/casts/user-status.js +69 -0
- package/dist/casts/user.d.ts +7 -0
- package/dist/casts/user.js +20 -1
- package/dist/factories/app-handler.d.ts +31 -0
- package/dist/factories/app-handler.js +50 -0
- package/dist/factories/app-recommendation.d.ts +21 -0
- package/dist/factories/app-recommendation.js +28 -0
- package/dist/factories/chat-message.d.ts +37 -0
- package/dist/factories/chat-message.js +56 -0
- package/dist/factories/comment.d.ts +8 -7
- package/dist/factories/comment.js +2 -2
- package/dist/factories/external-identities.d.ts +17 -0
- package/dist/factories/external-identities.js +28 -0
- package/dist/factories/file-message.d.ts +24 -0
- package/dist/factories/file-message.js +37 -0
- package/dist/factories/forum-thread.d.ts +34 -0
- package/dist/factories/forum-thread.js +50 -0
- package/dist/factories/git-applied-status.d.ts +39 -0
- package/dist/factories/git-applied-status.js +53 -0
- package/dist/factories/git-closed-status.d.ts +18 -0
- package/dist/factories/git-closed-status.js +24 -0
- package/dist/factories/git-draft-status.d.ts +18 -0
- package/dist/factories/git-draft-status.js +24 -0
- package/dist/factories/git-issue.d.ts +19 -0
- package/dist/factories/git-issue.js +25 -0
- package/dist/factories/git-open-status.d.ts +18 -0
- package/dist/factories/git-open-status.js +22 -0
- package/dist/factories/git-patch.d.ts +59 -0
- package/dist/factories/git-patch.js +102 -0
- package/dist/factories/git-pull-request-update.d.ts +23 -0
- package/dist/factories/git-pull-request-update.js +33 -0
- package/dist/factories/git-pull-request.d.ts +39 -0
- package/dist/factories/git-pull-request.js +64 -0
- package/dist/factories/index.d.ts +24 -0
- package/dist/factories/index.js +24 -0
- package/dist/factories/internal/git-pull-request.d.ts +19 -0
- package/dist/factories/internal/git-pull-request.js +26 -0
- package/dist/factories/internal/git-status.d.ts +11 -0
- package/dist/factories/internal/git-status.js +12 -0
- package/dist/factories/internal/git-thread.d.ts +19 -0
- package/dist/factories/internal/git-thread.js +29 -0
- package/dist/factories/internal/napplet-manifest.d.ts +52 -0
- package/dist/factories/internal/napplet-manifest.js +85 -0
- package/dist/factories/internal/nsite-manifest.d.ts +45 -0
- package/dist/factories/internal/nsite-manifest.js +68 -0
- package/dist/factories/legacy-message.d.ts +2 -0
- package/dist/factories/legacy-message.js +9 -2
- package/dist/factories/named-napplet.d.ts +20 -0
- package/dist/factories/named-napplet.js +30 -0
- package/dist/factories/named-nsite.d.ts +28 -0
- package/dist/factories/named-nsite.js +53 -0
- package/dist/factories/napplet-handlers.d.ts +34 -0
- package/dist/factories/napplet-handlers.js +77 -0
- package/dist/factories/napplet-snapshot.d.ts +18 -0
- package/dist/factories/napplet-snapshot.js +38 -0
- package/dist/factories/nsite-snapshot.d.ts +18 -0
- package/dist/factories/nsite-snapshot.js +29 -0
- package/dist/factories/reaction.d.ts +3 -2
- package/dist/factories/report.d.ts +48 -0
- package/dist/factories/report.js +66 -0
- package/dist/factories/root-napplet.d.ts +18 -0
- package/dist/factories/root-napplet.js +24 -0
- package/dist/factories/root-nsite.d.ts +23 -0
- package/dist/factories/root-nsite.js +44 -0
- package/dist/factories/torrent.d.ts +24 -10
- package/dist/factories/torrent.js +48 -44
- package/dist/factories/trusted-provider-list.d.ts +23 -0
- package/dist/factories/trusted-provider-list.js +39 -0
- package/dist/factories/user-status.d.ts +26 -0
- package/dist/factories/user-status.js +52 -0
- package/dist/factories/wrapped-message.js +10 -4
- package/dist/helpers/app-data.js +15 -7
- package/dist/helpers/app-handler.d.ts +43 -6
- package/dist/helpers/app-handler.js +53 -3
- package/dist/helpers/app-recommendation.d.ts +24 -0
- package/dist/helpers/app-recommendation.js +30 -0
- package/dist/helpers/bookmark.js +5 -2
- package/dist/helpers/comment.d.ts +11 -5
- package/dist/helpers/comment.js +7 -1
- package/dist/helpers/content.d.ts +3 -1
- package/dist/helpers/emoji-pack.js +11 -6
- package/dist/helpers/emoji.d.ts +2 -2
- package/dist/helpers/encrypted-content-cache.d.ts +2 -11
- package/dist/helpers/encrypted-content-cache.js +6 -14
- package/dist/helpers/encrypted-file.d.ts +41 -0
- package/dist/helpers/encrypted-file.js +64 -0
- package/dist/helpers/external-id.js +13 -19
- package/dist/helpers/external-identities.d.ts +29 -0
- package/dist/helpers/external-identities.js +52 -0
- package/dist/helpers/file-message.d.ts +18 -0
- package/dist/helpers/file-message.js +44 -0
- package/dist/helpers/file-metadata.d.ts +9 -4
- package/dist/helpers/file-metadata.js +21 -6
- package/dist/helpers/forum-thread.d.ts +10 -0
- package/dist/helpers/forum-thread.js +10 -0
- package/dist/helpers/gift-wrap.d.ts +40 -15
- package/dist/helpers/gift-wrap.js +110 -33
- package/dist/helpers/git-issue.d.ts +13 -0
- package/dist/helpers/git-issue.js +19 -0
- package/dist/helpers/git-patch.d.ts +41 -0
- package/dist/helpers/git-patch.js +73 -0
- package/dist/helpers/git-pull-request.d.ts +57 -0
- package/dist/helpers/git-pull-request.js +111 -0
- package/dist/helpers/git-repository.d.ts +4 -0
- package/dist/helpers/git-repository.js +16 -0
- package/dist/helpers/git-status.d.ts +44 -0
- package/dist/helpers/git-status.js +93 -0
- package/dist/helpers/git.d.ts +2 -0
- package/dist/helpers/git.js +4 -0
- package/dist/helpers/groups.d.ts +5 -2
- package/dist/helpers/groups.js +40 -18
- package/dist/helpers/hashtag.d.ts +4 -2
- package/dist/helpers/index.d.ts +13 -0
- package/dist/helpers/index.js +13 -0
- package/dist/helpers/lists.js +14 -2
- package/dist/helpers/lnurl.js +1 -1
- package/dist/helpers/messages.js +3 -2
- package/dist/helpers/mute.js +20 -9
- package/dist/helpers/napplet-handlers.d.ts +79 -0
- package/dist/helpers/napplet-handlers.js +187 -0
- package/dist/helpers/napplet.d.ts +107 -0
- package/dist/helpers/napplet.js +177 -0
- package/dist/helpers/nsite.d.ts +90 -0
- package/dist/helpers/nsite.js +217 -0
- package/dist/helpers/relay-discovery.d.ts +4 -0
- package/dist/helpers/relay-discovery.js +8 -0
- package/dist/helpers/reports.d.ts +35 -0
- package/dist/helpers/reports.js +36 -5
- package/dist/helpers/threading.d.ts +4 -2
- package/dist/helpers/torrent.d.ts +9 -6
- package/dist/helpers/torrent.js +23 -15
- package/dist/helpers/trusted-assertions.d.ts +7 -0
- package/dist/helpers/trusted-assertions.js +41 -2
- package/dist/helpers/user-status.d.ts +13 -1
- package/dist/helpers/user-status.js +15 -0
- package/dist/helpers/wrapped-messages.d.ts +2 -0
- package/dist/helpers/wrapped-messages.js +6 -1
- package/dist/models/app-handler.d.ts +21 -0
- package/dist/models/app-handler.js +47 -0
- package/dist/models/git.d.ts +34 -0
- package/dist/models/git.js +144 -0
- package/dist/models/index.d.ts +4 -0
- package/dist/models/index.js +4 -0
- package/dist/models/legacy-messages.js +6 -1
- package/dist/models/napplet-handlers.d.ts +16 -0
- package/dist/models/napplet-handlers.js +45 -0
- package/dist/models/nsite.d.ts +22 -0
- package/dist/models/nsite.js +67 -0
- package/dist/models/thread.d.ts +4 -1
- package/dist/models/thread.js +34 -5
- package/dist/models/user-status.d.ts +8 -4
- package/dist/models/user-status.js +16 -22
- package/dist/models/wrapped-messages.js +9 -7
- package/dist/observable/filter-timeline-by-mutes.d.ts +1 -1
- package/dist/observable/filter-timeline-by-mutes.js +6 -2
- package/dist/operations/app-handler.d.ts +24 -0
- package/dist/operations/app-handler.js +58 -0
- package/dist/operations/app-recommendation.d.ts +13 -0
- package/dist/operations/app-recommendation.js +40 -0
- package/dist/operations/calendar-event.js +3 -2
- package/dist/operations/chat-message.d.ts +9 -0
- package/dist/operations/chat-message.js +12 -0
- package/dist/operations/client.d.ts +1 -4
- package/dist/operations/client.js +1 -23
- package/dist/operations/comment.d.ts +9 -3
- package/dist/operations/comment.js +12 -9
- package/dist/operations/external-identities.d.ts +8 -0
- package/dist/operations/external-identities.js +23 -0
- package/dist/operations/file-message.d.ts +7 -0
- package/dist/operations/file-message.js +34 -0
- package/dist/operations/forum-thread.d.ts +3 -0
- package/dist/operations/forum-thread.js +6 -0
- package/dist/operations/gift-wrap.js +38 -14
- package/dist/operations/git-issue.d.ts +18 -0
- package/dist/operations/git-issue.js +31 -0
- package/dist/operations/git-patch.d.ts +30 -0
- package/dist/operations/git-patch.js +75 -0
- package/dist/operations/git-pull-request.d.ts +29 -0
- package/dist/operations/git-pull-request.js +74 -0
- package/dist/operations/git-repository.js +4 -4
- package/dist/operations/git-status.d.ts +28 -0
- package/dist/operations/git-status.js +116 -0
- package/dist/operations/git-thread.d.ts +13 -0
- package/dist/operations/git-thread.js +39 -0
- package/dist/operations/index.d.ts +17 -0
- package/dist/operations/index.js +17 -0
- package/dist/operations/internal/git-commits.d.ts +2 -0
- package/dist/operations/internal/git-commits.js +16 -0
- package/dist/operations/napplet-handlers.d.ts +47 -0
- package/dist/operations/napplet-handlers.js +161 -0
- package/dist/operations/napplet.d.ts +51 -0
- package/dist/operations/napplet.js +121 -0
- package/dist/operations/nsite.d.ts +51 -0
- package/dist/operations/nsite.js +112 -0
- package/dist/operations/reaction.d.ts +12 -2
- package/dist/operations/reaction.js +1 -1
- package/dist/operations/report.d.ts +33 -0
- package/dist/operations/report.js +60 -0
- package/dist/operations/stream.js +5 -4
- package/dist/operations/torrent.d.ts +1 -4
- package/dist/operations/torrent.js +24 -11
- package/dist/operations/trusted-providers.d.ts +14 -0
- package/dist/operations/trusted-providers.js +33 -0
- package/dist/operations/user-status.d.ts +11 -0
- package/dist/operations/user-status.js +29 -0
- package/dist/operations/wrapped-message.js +2 -2
- package/package.json +13 -17
package/README.md
CHANGED
|
@@ -2,8 +2,11 @@ export * from "./profile.js";
|
|
|
2
2
|
export * from "./mutes.js";
|
|
3
3
|
export * from "./bookmarks.js";
|
|
4
4
|
export * from "./favorite-emojis.js";
|
|
5
|
+
export * from "./external-identities.js";
|
|
5
6
|
export * from "./git-grasp-list.js";
|
|
6
7
|
export * from "./git-lists.js";
|
|
8
|
+
export * from "./git-repository.js";
|
|
7
9
|
export * from "./relay-lists.js";
|
|
8
10
|
export * from "./groups.js";
|
|
9
11
|
export * from "./trusted-assertions.js";
|
|
12
|
+
export * from "./report.js";
|
|
@@ -4,8 +4,11 @@ export * from "./profile.js";
|
|
|
4
4
|
export * from "./mutes.js";
|
|
5
5
|
export * from "./bookmarks.js";
|
|
6
6
|
export * from "./favorite-emojis.js";
|
|
7
|
+
export * from "./external-identities.js";
|
|
7
8
|
export * from "./git-grasp-list.js";
|
|
8
9
|
export * from "./git-lists.js";
|
|
10
|
+
export * from "./git-repository.js";
|
|
9
11
|
export * from "./relay-lists.js";
|
|
10
12
|
export * from "./groups.js";
|
|
11
13
|
export * from "./trusted-assertions.js";
|
|
14
|
+
export * from "./report.js";
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import "./user.js";
|
|
2
|
+
import { ChainableObservable } from "applesauce-core";
|
|
3
|
+
import { NostrEvent } from "applesauce-core/helpers/event";
|
|
4
|
+
import { AddressPointer, EventPointer, ProfilePointer } from "applesauce-core/helpers/pointers";
|
|
5
|
+
import { ProfileContent } from "applesauce-core/helpers/profile";
|
|
6
|
+
import { AppHandlerEvent, HandlerLinkPlatform, HandlerLinkType } from "../helpers/app-handler.js";
|
|
7
|
+
import { CastRefEventStore, EventCast } from "./cast.js";
|
|
8
|
+
import { NamedNsite, Nsite } from "./nsite.js";
|
|
9
|
+
/** Cast for NIP-89 handler information events (kind 31990) */
|
|
10
|
+
export declare class AppHandler extends EventCast<AppHandlerEvent> {
|
|
11
|
+
/**
|
|
12
|
+
* Creates a cast for a validated handler
|
|
13
|
+
* @throws if the event is not a valid handler information event
|
|
14
|
+
*/
|
|
15
|
+
constructor(event: NostrEvent, store: CastRefEventStore);
|
|
16
|
+
/** The `d` tag identifier of the handler */
|
|
17
|
+
get identifier(): string;
|
|
18
|
+
/** The address pointer of the handler */
|
|
19
|
+
get pointer(): AddressPointer;
|
|
20
|
+
/** The handler's display name from its metadata */
|
|
21
|
+
get name(): string;
|
|
22
|
+
/** The handler's picture from its metadata */
|
|
23
|
+
get picture(): string | undefined;
|
|
24
|
+
/** The handler's description from its metadata */
|
|
25
|
+
get description(): string | undefined;
|
|
26
|
+
/** The handler's own kind:0-style metadata, or undefined when it uses the author's profile */
|
|
27
|
+
get metadata(): ProfileContent | undefined;
|
|
28
|
+
/** The event kinds the handler supports */
|
|
29
|
+
get supportedKinds(): number[];
|
|
30
|
+
/** The named nsite the handler currently serves */
|
|
31
|
+
get latestPointer(): AddressPointer | undefined;
|
|
32
|
+
/** The named nsite the handler is rolling out */
|
|
33
|
+
get nextPointer(): AddressPointer | undefined;
|
|
34
|
+
/** The platforms the handler has URL templates for */
|
|
35
|
+
get platforms(): HandlerLinkPlatform[];
|
|
36
|
+
/** Returns all URL templates for a platform */
|
|
37
|
+
links(platform?: HandlerLinkPlatform): import("../helpers/app-handler.js").HandlerLink[];
|
|
38
|
+
/** Returns the URL template for a platform and NIP-19 entity type */
|
|
39
|
+
linkTemplate(platform?: HandlerLinkPlatform, type?: HandlerLinkType): string | undefined;
|
|
40
|
+
/** Returns a URL that opens a pointer in the handler */
|
|
41
|
+
link(pointer: AddressPointer | EventPointer | ProfilePointer, platform?: HandlerLinkPlatform): string | undefined;
|
|
42
|
+
/** Subscribes to the handler's metadata, falling back to the author's kind:0 profile when its content is empty */
|
|
43
|
+
get metadata$(): ChainableObservable<ProfileContent | undefined>;
|
|
44
|
+
/** Subscribes to the named nsite from the `latest` tag */
|
|
45
|
+
get latest$(): ChainableObservable<NamedNsite | undefined>;
|
|
46
|
+
/** Subscribes to the named nsite from the `next` tag */
|
|
47
|
+
get next$(): ChainableObservable<NamedNsite | undefined>;
|
|
48
|
+
/** Subscribes to loaded nsite manifests whose NIP-5A `app` tag references this handler */
|
|
49
|
+
get nsites$(): ChainableObservable<Nsite[]>;
|
|
50
|
+
}
|
|
51
|
+
declare module "applesauce-core/casts" {
|
|
52
|
+
interface User {
|
|
53
|
+
/** Subscribes to the app handlers the user has published */
|
|
54
|
+
get appHandlers$(): ChainableObservable<AppHandler[]>;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
import "./user.js";
|
|
2
|
+
import { User } from "applesauce-core/casts/user";
|
|
3
|
+
import { kinds } from "applesauce-core/helpers/event";
|
|
4
|
+
import { getAddressPointerForEvent, } from "applesauce-core/helpers/pointers";
|
|
5
|
+
import { getProfileContent, isValidProfile } from "applesauce-core/helpers/profile";
|
|
6
|
+
import { map, of } from "rxjs";
|
|
7
|
+
import { createHandlerLink, getHandlerDescription, getHandlerIdentifier, getHandlerLatestPointer, getHandlerLinks, getHandlerLinkTemplate, getHandlerName, getHandlerNextPointer, getHandlerPicture, getHandlerPlatforms, getHandlerSupportedKinds, isValidAppHandler, } from "../helpers/app-handler.js";
|
|
8
|
+
import { UserAppHandlersModel } from "../models/app-handler.js";
|
|
9
|
+
import { AppNsitesModel } from "../models/nsite.js";
|
|
10
|
+
import { castEventStream, castTimelineStream } from "../observable/cast-stream.js";
|
|
11
|
+
import { EventCast } from "./cast.js";
|
|
12
|
+
import { NamedNsite, Nsite } from "./nsite.js";
|
|
13
|
+
/** Cast for NIP-89 handler information events (kind 31990) */
|
|
14
|
+
export class AppHandler extends EventCast {
|
|
15
|
+
/**
|
|
16
|
+
* Creates a cast for a validated handler
|
|
17
|
+
* @throws if the event is not a valid handler information event
|
|
18
|
+
*/
|
|
19
|
+
constructor(event, store) {
|
|
20
|
+
if (!isValidAppHandler(event))
|
|
21
|
+
throw new Error("Invalid app handler");
|
|
22
|
+
super(event, store);
|
|
23
|
+
}
|
|
24
|
+
/** The `d` tag identifier of the handler */
|
|
25
|
+
get identifier() {
|
|
26
|
+
return getHandlerIdentifier(this.event);
|
|
27
|
+
}
|
|
28
|
+
/** The address pointer of the handler */
|
|
29
|
+
get pointer() {
|
|
30
|
+
return getAddressPointerForEvent(this.event);
|
|
31
|
+
}
|
|
32
|
+
/** The handler's display name from its metadata */
|
|
33
|
+
get name() {
|
|
34
|
+
return getHandlerName(this.event);
|
|
35
|
+
}
|
|
36
|
+
/** The handler's picture from its metadata */
|
|
37
|
+
get picture() {
|
|
38
|
+
return getHandlerPicture(this.event);
|
|
39
|
+
}
|
|
40
|
+
/** The handler's description from its metadata */
|
|
41
|
+
get description() {
|
|
42
|
+
return getHandlerDescription(this.event);
|
|
43
|
+
}
|
|
44
|
+
/** The handler's own kind:0-style metadata, or undefined when it uses the author's profile */
|
|
45
|
+
get metadata() {
|
|
46
|
+
return isValidProfile(this.event) ? getProfileContent(this.event) : undefined;
|
|
47
|
+
}
|
|
48
|
+
/** The event kinds the handler supports */
|
|
49
|
+
get supportedKinds() {
|
|
50
|
+
return getHandlerSupportedKinds(this.event);
|
|
51
|
+
}
|
|
52
|
+
/** The named nsite the handler currently serves */
|
|
53
|
+
get latestPointer() {
|
|
54
|
+
return getHandlerLatestPointer(this.event);
|
|
55
|
+
}
|
|
56
|
+
/** The named nsite the handler is rolling out */
|
|
57
|
+
get nextPointer() {
|
|
58
|
+
return getHandlerNextPointer(this.event);
|
|
59
|
+
}
|
|
60
|
+
/** The platforms the handler has URL templates for */
|
|
61
|
+
get platforms() {
|
|
62
|
+
return getHandlerPlatforms(this.event);
|
|
63
|
+
}
|
|
64
|
+
/** Returns all URL templates for a platform */
|
|
65
|
+
links(platform) {
|
|
66
|
+
return getHandlerLinks(this.event, platform);
|
|
67
|
+
}
|
|
68
|
+
/** Returns the URL template for a platform and NIP-19 entity type */
|
|
69
|
+
linkTemplate(platform, type) {
|
|
70
|
+
return getHandlerLinkTemplate(this.event, platform, type);
|
|
71
|
+
}
|
|
72
|
+
/** Returns a URL that opens a pointer in the handler */
|
|
73
|
+
link(pointer, platform) {
|
|
74
|
+
return createHandlerLink(this.event, pointer, platform);
|
|
75
|
+
}
|
|
76
|
+
/** Subscribes to the handler's metadata, falling back to the author's kind:0 profile when its content is empty */
|
|
77
|
+
get metadata$() {
|
|
78
|
+
return this.$$ref("metadata$", (store) => this.metadata
|
|
79
|
+
? of(this.metadata)
|
|
80
|
+
: store
|
|
81
|
+
.replaceable({ kind: kinds.Metadata, pubkey: this.event.pubkey })
|
|
82
|
+
.pipe(map((profile) => (isValidProfile(profile) ? getProfileContent(profile) : undefined))));
|
|
83
|
+
}
|
|
84
|
+
/** Subscribes to the named nsite from the `latest` tag */
|
|
85
|
+
get latest$() {
|
|
86
|
+
return this.$$ref("latest$", (store) => this.latestPointer
|
|
87
|
+
? store.replaceable(this.latestPointer).pipe(castEventStream(NamedNsite, store))
|
|
88
|
+
: of(undefined));
|
|
89
|
+
}
|
|
90
|
+
/** Subscribes to the named nsite from the `next` tag */
|
|
91
|
+
get next$() {
|
|
92
|
+
return this.$$ref("next$", (store) => this.nextPointer ? store.replaceable(this.nextPointer).pipe(castEventStream(NamedNsite, store)) : of(undefined));
|
|
93
|
+
}
|
|
94
|
+
/** Subscribes to loaded nsite manifests whose NIP-5A `app` tag references this handler */
|
|
95
|
+
get nsites$() {
|
|
96
|
+
return this.$$ref("nsites$", (store) => store.model(AppNsitesModel, this.event).pipe(castTimelineStream(Nsite, store)));
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
Object.defineProperty(User.prototype, "appHandlers$", {
|
|
100
|
+
get() {
|
|
101
|
+
return this.$$ref("appHandlers$", (store) => store.model(UserAppHandlersModel, this.pubkey).pipe(castTimelineStream(AppHandler, store)));
|
|
102
|
+
},
|
|
103
|
+
configurable: true,
|
|
104
|
+
enumerable: false,
|
|
105
|
+
});
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import "./user.js";
|
|
2
|
+
import { ChainableObservable } from "applesauce-core";
|
|
3
|
+
import { NostrEvent } from "applesauce-core/helpers/event";
|
|
4
|
+
import { AppRecommendationEvent } from "../helpers/app-recommendation.js";
|
|
5
|
+
import { AppHandler } from "./app-handler.js";
|
|
6
|
+
import { CastRefEventStore, EventCast } from "./cast.js";
|
|
7
|
+
/** Cast for NIP-89 handler recommendation events (kind 31989) */
|
|
8
|
+
export declare class AppRecommendation extends EventCast<AppRecommendationEvent> {
|
|
9
|
+
/**
|
|
10
|
+
* Creates a cast for a validated recommendation
|
|
11
|
+
* @throws if the event is not a valid handler recommendation
|
|
12
|
+
*/
|
|
13
|
+
constructor(event: NostrEvent, store: CastRefEventStore);
|
|
14
|
+
/** The event kind the recommendation applies to */
|
|
15
|
+
get supportedKind(): number;
|
|
16
|
+
/** The recommended handler pointers and their platforms */
|
|
17
|
+
get handlers(): import("../helpers/app-recommendation.js").RecommendedHandler[];
|
|
18
|
+
/** Subscribes to the recommended handlers, in the same order as {@link handlers} */
|
|
19
|
+
get handlers$(): ChainableObservable<(AppHandler | undefined)[]>;
|
|
20
|
+
}
|
|
21
|
+
declare module "applesauce-core/casts" {
|
|
22
|
+
interface User {
|
|
23
|
+
/** Subscribes to the user's app handler recommendations for every event kind */
|
|
24
|
+
get appRecommendations$(): ChainableObservable<AppRecommendation[]>;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import "./user.js";
|
|
2
|
+
import { User } from "applesauce-core/casts/user";
|
|
3
|
+
import { combineLatest, of } from "rxjs";
|
|
4
|
+
import { getRecommendationKind, getRecommendedHandlers, isValidAppRecommendation, } from "../helpers/app-recommendation.js";
|
|
5
|
+
import { UserAppRecommendationsModel } from "../models/app-handler.js";
|
|
6
|
+
import { castEventStream, castTimelineStream } from "../observable/cast-stream.js";
|
|
7
|
+
import { AppHandler } from "./app-handler.js";
|
|
8
|
+
import { EventCast } from "./cast.js";
|
|
9
|
+
/** Cast for NIP-89 handler recommendation events (kind 31989) */
|
|
10
|
+
export class AppRecommendation extends EventCast {
|
|
11
|
+
/**
|
|
12
|
+
* Creates a cast for a validated recommendation
|
|
13
|
+
* @throws if the event is not a valid handler recommendation
|
|
14
|
+
*/
|
|
15
|
+
constructor(event, store) {
|
|
16
|
+
if (!isValidAppRecommendation(event))
|
|
17
|
+
throw new Error("Invalid app recommendation");
|
|
18
|
+
super(event, store);
|
|
19
|
+
}
|
|
20
|
+
/** The event kind the recommendation applies to */
|
|
21
|
+
get supportedKind() {
|
|
22
|
+
return getRecommendationKind(this.event);
|
|
23
|
+
}
|
|
24
|
+
/** The recommended handler pointers and their platforms */
|
|
25
|
+
get handlers() {
|
|
26
|
+
return getRecommendedHandlers(this.event);
|
|
27
|
+
}
|
|
28
|
+
/** Subscribes to the recommended handlers, in the same order as {@link handlers} */
|
|
29
|
+
get handlers$() {
|
|
30
|
+
return this.$$ref("handlers$", (store) => this.handlers.length
|
|
31
|
+
? combineLatest(this.handlers.map((h) => store.replaceable(h.pointer).pipe(castEventStream(AppHandler, store))))
|
|
32
|
+
: of([]));
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
Object.defineProperty(User.prototype, "appRecommendations$", {
|
|
36
|
+
get() {
|
|
37
|
+
return this.$$ref("appRecommendations$", (store) => store.model(UserAppRecommendationsModel, this.pubkey).pipe(castTimelineStream(AppRecommendation, store)));
|
|
38
|
+
},
|
|
39
|
+
configurable: true,
|
|
40
|
+
enumerable: false,
|
|
41
|
+
});
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { NostrEvent } from "applesauce-core/helpers/event";
|
|
2
|
+
import { ExternalIdentitiesEvent } from "../helpers/external-identities.js";
|
|
3
|
+
import { CastRefEventStore, EventCast } from "./cast.js";
|
|
4
|
+
/** Cast for NIP-39 external identity lists */
|
|
5
|
+
export declare class ExternalIdentities extends EventCast<ExternalIdentitiesEvent> {
|
|
6
|
+
constructor(event: NostrEvent, store: CastRefEventStore);
|
|
7
|
+
/** The external identities claimed by the user */
|
|
8
|
+
get identities(): import("../helpers/external-identities.js").ExternalIdentity[];
|
|
9
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { getExternalIdentities, isValidExternalIdentities, } from "../helpers/external-identities.js";
|
|
2
|
+
import { EventCast } from "./cast.js";
|
|
3
|
+
/** Cast for NIP-39 external identity lists */
|
|
4
|
+
export class ExternalIdentities extends EventCast {
|
|
5
|
+
constructor(event, store) {
|
|
6
|
+
if (!isValidExternalIdentities(event))
|
|
7
|
+
throw new Error("Invalid external identities event");
|
|
8
|
+
super(event, store);
|
|
9
|
+
}
|
|
10
|
+
/** The external identities claimed by the user */
|
|
11
|
+
get identities() {
|
|
12
|
+
return getExternalIdentities(this.event);
|
|
13
|
+
}
|
|
14
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { NostrEvent } from "applesauce-core/helpers/event";
|
|
2
|
+
import { ForumThreadEvent } from "../helpers/forum-thread.js";
|
|
3
|
+
import { CastRefEventStore, EventCast } from "./cast.js";
|
|
4
|
+
import { Comment } from "./comment.js";
|
|
5
|
+
import { Reaction } from "./reaction.js";
|
|
6
|
+
/** Cast a kind 11 event to a NIP-7D forum thread */
|
|
7
|
+
export declare class ForumThread extends EventCast<ForumThreadEvent> {
|
|
8
|
+
constructor(event: NostrEvent, store: CastRefEventStore);
|
|
9
|
+
/** The thread title, if it has one */
|
|
10
|
+
get title(): string;
|
|
11
|
+
/** The thread body */
|
|
12
|
+
get content(): string;
|
|
13
|
+
/** The NIP-22 kind 1111 comments replying to this thread */
|
|
14
|
+
get replies$(): import("applesauce-core").ChainableObservable<Comment[]>;
|
|
15
|
+
/** The reactions to this thread */
|
|
16
|
+
get reactions$(): import("applesauce-core").ChainableObservable<Reaction[]>;
|
|
17
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { getForumThreadTitle, isValidForumThread } from "../helpers/forum-thread.js";
|
|
2
|
+
import { CommentsModel } from "../models/comments.js";
|
|
3
|
+
import { ReactionsModel } from "../models/reactions.js";
|
|
4
|
+
import { castTimelineStream } from "../observable/cast-stream.js";
|
|
5
|
+
import { EventCast } from "./cast.js";
|
|
6
|
+
import { Comment } from "./comment.js";
|
|
7
|
+
import { Reaction } from "./reaction.js";
|
|
8
|
+
/** Cast a kind 11 event to a NIP-7D forum thread */
|
|
9
|
+
export class ForumThread extends EventCast {
|
|
10
|
+
constructor(event, store) {
|
|
11
|
+
if (!isValidForumThread(event))
|
|
12
|
+
throw new Error("Invalid forum thread");
|
|
13
|
+
super(event, store);
|
|
14
|
+
}
|
|
15
|
+
/** The thread title, if it has one */
|
|
16
|
+
get title() {
|
|
17
|
+
return getForumThreadTitle(this.event);
|
|
18
|
+
}
|
|
19
|
+
/** The thread body */
|
|
20
|
+
get content() {
|
|
21
|
+
return this.event.content;
|
|
22
|
+
}
|
|
23
|
+
/** The NIP-22 kind 1111 comments replying to this thread */
|
|
24
|
+
get replies$() {
|
|
25
|
+
return this.$$ref("replies$", (store) => store.model(CommentsModel, this.event).pipe(castTimelineStream(Comment, store)));
|
|
26
|
+
}
|
|
27
|
+
/** The reactions to this thread */
|
|
28
|
+
get reactions$() {
|
|
29
|
+
return this.$$ref("reactions$", (store) => store.model(ReactionsModel, this.event).pipe(castTimelineStream(Reaction, store)));
|
|
30
|
+
}
|
|
31
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { NostrEvent } from "applesauce-core/helpers/event";
|
|
2
|
+
import { GitIssueEvent } from "../helpers/git-issue.js";
|
|
3
|
+
import { CastRefEventStore } from "./cast.js";
|
|
4
|
+
import { GitThread } from "./git-thread.js";
|
|
5
|
+
/** Cast for NIP-34 issue events */
|
|
6
|
+
export declare class GitIssue extends GitThread<GitIssueEvent> {
|
|
7
|
+
/**
|
|
8
|
+
* Creates an issue cast
|
|
9
|
+
* @throws if the event is not a valid issue
|
|
10
|
+
*/
|
|
11
|
+
constructor(event: NostrEvent, store: CastRefEventStore);
|
|
12
|
+
/** The optional issue subject */
|
|
13
|
+
get subject(): string | undefined;
|
|
14
|
+
/** The subject or first content line */
|
|
15
|
+
get title(): string;
|
|
16
|
+
/** The issue labels */
|
|
17
|
+
get labels(): string[];
|
|
18
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { getGitIssueLabels, getGitIssueSubject, isValidGitIssue } from "../helpers/git-issue.js";
|
|
2
|
+
import { GitThread } from "./git-thread.js";
|
|
3
|
+
/** Cast for NIP-34 issue events */
|
|
4
|
+
export class GitIssue extends GitThread {
|
|
5
|
+
/**
|
|
6
|
+
* Creates an issue cast
|
|
7
|
+
* @throws if the event is not a valid issue
|
|
8
|
+
*/
|
|
9
|
+
constructor(event, store) {
|
|
10
|
+
if (!isValidGitIssue(event))
|
|
11
|
+
throw new Error("Invalid git issue event");
|
|
12
|
+
super(event, store);
|
|
13
|
+
}
|
|
14
|
+
/** The optional issue subject */
|
|
15
|
+
get subject() {
|
|
16
|
+
return getGitIssueSubject(this.event);
|
|
17
|
+
}
|
|
18
|
+
/** The subject or first content line */
|
|
19
|
+
get title() {
|
|
20
|
+
return this.subject ?? super.title;
|
|
21
|
+
}
|
|
22
|
+
/** The issue labels */
|
|
23
|
+
get labels() {
|
|
24
|
+
return getGitIssueLabels(this.event);
|
|
25
|
+
}
|
|
26
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { NostrEvent } from "applesauce-core/helpers/event";
|
|
2
|
+
import { ChainableObservable } from "applesauce-core";
|
|
3
|
+
import { GitPatchEvent } from "../helpers/git-patch.js";
|
|
4
|
+
import { GitStatus } from "../helpers/git-status.js";
|
|
5
|
+
import { CastRefEventStore } from "./cast.js";
|
|
6
|
+
import { GitThread } from "./git-thread.js";
|
|
7
|
+
/** Cast for NIP-34 patch events */
|
|
8
|
+
export declare class GitPatch extends GitThread<GitPatchEvent> {
|
|
9
|
+
/**
|
|
10
|
+
* Creates a patch cast
|
|
11
|
+
* @throws if the event is not a valid patch
|
|
12
|
+
*/
|
|
13
|
+
constructor(event: NostrEvent, store: CastRefEventStore);
|
|
14
|
+
/** The subject parsed from the patch header */
|
|
15
|
+
get subject(): string | undefined;
|
|
16
|
+
/** The patch subject or first content line */
|
|
17
|
+
get title(): string;
|
|
18
|
+
/** The patch labels without series markers */
|
|
19
|
+
get labels(): string[];
|
|
20
|
+
/** True if this is the first patch in a series or revision */
|
|
21
|
+
get isRoot(): boolean;
|
|
22
|
+
/** True if this is the first patch of a revision */
|
|
23
|
+
get isRootRevision(): boolean;
|
|
24
|
+
/** The proposed commit id */
|
|
25
|
+
get commit(): string | undefined;
|
|
26
|
+
/** The parent commit id */
|
|
27
|
+
get parentCommit(): string | undefined;
|
|
28
|
+
/** The pointer to the previous patch or original root */
|
|
29
|
+
get previousPointer(): import("nostr-tools/nip19").EventPointer | undefined;
|
|
30
|
+
/** The committer metadata for reproducing the commit */
|
|
31
|
+
get committer(): import("../helpers/git-patch.js").GitPatchCommitter | undefined;
|
|
32
|
+
/** The commit signature, with an empty string for unsigned commits */
|
|
33
|
+
get commitSignature(): string | undefined;
|
|
34
|
+
/** Subscribes to the previous patch or original root */
|
|
35
|
+
get previous$(): ChainableObservable<GitPatch | undefined>;
|
|
36
|
+
/** Subscribes to the root of the current series or revision */
|
|
37
|
+
get seriesRoot$(): ChainableObservable<GitPatch | undefined>;
|
|
38
|
+
/** Subscribes to the original root patch */
|
|
39
|
+
get originalRoot$(): ChainableObservable<GitPatch | undefined>;
|
|
40
|
+
/** Subscribes to patches in this series in dependency order */
|
|
41
|
+
get series$(): ChainableObservable<GitPatch[]>;
|
|
42
|
+
/** Subscribes to revisions of the original series */
|
|
43
|
+
get revisions$(): ChainableObservable<GitPatch[]>;
|
|
44
|
+
/** Subscribes to status inherited from the original root */
|
|
45
|
+
get status$(): ChainableObservable<GitStatus>;
|
|
46
|
+
/** Subscribes to the latest authorized status of the original root */
|
|
47
|
+
get statusEvent$(): ChainableObservable<NostrEvent | undefined>;
|
|
48
|
+
protected activity$(): import("applesauce-core").Observable<GitPatchEvent[]>;
|
|
49
|
+
}
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import { castEventStream, castTimelineStream } from "applesauce-core/observable/cast-stream";
|
|
2
|
+
import { of, switchMap } from "rxjs";
|
|
3
|
+
import { getGitPatchCommit, getGitPatchLabels, getGitPatchParentCommit, getGitPatchSubject, isGitPatchRoot, isGitPatchRootRevision, isValidGitPatch, getGitPatchPreviousPointer, getGitPatchCommitter, getGitPatchCommitSignature, } from "../helpers/git-patch.js";
|
|
4
|
+
import { GitPatchOriginalRootModel, GitPatchSeriesRootModel, GitPatchSeriesModel, GitPatchRevisionsModel, GitPatchStatusModel, GitPatchStatusEventModel, } from "../models/git.js";
|
|
5
|
+
import { GitThread } from "./git-thread.js";
|
|
6
|
+
/** Cast for NIP-34 patch events */
|
|
7
|
+
export class GitPatch extends GitThread {
|
|
8
|
+
/**
|
|
9
|
+
* Creates a patch cast
|
|
10
|
+
* @throws if the event is not a valid patch
|
|
11
|
+
*/
|
|
12
|
+
constructor(event, store) {
|
|
13
|
+
if (!isValidGitPatch(event))
|
|
14
|
+
throw new Error("Invalid git patch event");
|
|
15
|
+
super(event, store);
|
|
16
|
+
}
|
|
17
|
+
/** The subject parsed from the patch header */
|
|
18
|
+
get subject() {
|
|
19
|
+
return getGitPatchSubject(this.event);
|
|
20
|
+
}
|
|
21
|
+
/** The patch subject or first content line */
|
|
22
|
+
get title() {
|
|
23
|
+
return this.subject ?? super.title;
|
|
24
|
+
}
|
|
25
|
+
/** The patch labels without series markers */
|
|
26
|
+
get labels() {
|
|
27
|
+
return getGitPatchLabels(this.event);
|
|
28
|
+
}
|
|
29
|
+
/** True if this is the first patch in a series or revision */
|
|
30
|
+
get isRoot() {
|
|
31
|
+
return isGitPatchRoot(this.event);
|
|
32
|
+
}
|
|
33
|
+
/** True if this is the first patch of a revision */
|
|
34
|
+
get isRootRevision() {
|
|
35
|
+
return isGitPatchRootRevision(this.event);
|
|
36
|
+
}
|
|
37
|
+
/** The proposed commit id */
|
|
38
|
+
get commit() {
|
|
39
|
+
return getGitPatchCommit(this.event);
|
|
40
|
+
}
|
|
41
|
+
/** The parent commit id */
|
|
42
|
+
get parentCommit() {
|
|
43
|
+
return getGitPatchParentCommit(this.event);
|
|
44
|
+
}
|
|
45
|
+
/** The pointer to the previous patch or original root */
|
|
46
|
+
get previousPointer() {
|
|
47
|
+
return getGitPatchPreviousPointer(this.event);
|
|
48
|
+
}
|
|
49
|
+
/** The committer metadata for reproducing the commit */
|
|
50
|
+
get committer() {
|
|
51
|
+
return getGitPatchCommitter(this.event);
|
|
52
|
+
}
|
|
53
|
+
/** The commit signature, with an empty string for unsigned commits */
|
|
54
|
+
get commitSignature() {
|
|
55
|
+
return getGitPatchCommitSignature(this.event);
|
|
56
|
+
}
|
|
57
|
+
/** Subscribes to the previous patch or original root */
|
|
58
|
+
get previous$() {
|
|
59
|
+
return this.$$ref("previous$", (store) => this.previousPointer ? store.event(this.previousPointer).pipe(castEventStream(GitPatch, store)) : of(undefined));
|
|
60
|
+
}
|
|
61
|
+
/** Subscribes to the root of the current series or revision */
|
|
62
|
+
get seriesRoot$() {
|
|
63
|
+
return this.$$ref("seriesRoot$", (store) => store.model(GitPatchSeriesRootModel, this.event).pipe(castEventStream(GitPatch, store)));
|
|
64
|
+
}
|
|
65
|
+
/** Subscribes to the original root patch */
|
|
66
|
+
get originalRoot$() {
|
|
67
|
+
return this.$$ref("originalRoot$", (store) => store.model(GitPatchOriginalRootModel, this.event).pipe(castEventStream(GitPatch, store)));
|
|
68
|
+
}
|
|
69
|
+
/** Subscribes to patches in this series in dependency order */
|
|
70
|
+
get series$() {
|
|
71
|
+
return this.$$ref("series$", (store) => store.model(GitPatchSeriesModel, this.event).pipe(castTimelineStream(GitPatch, store)));
|
|
72
|
+
}
|
|
73
|
+
/** Subscribes to revisions of the original series */
|
|
74
|
+
get revisions$() {
|
|
75
|
+
return this.$$ref("revisions$", (store) => store.model(GitPatchRevisionsModel, this.event).pipe(castTimelineStream(GitPatch, store)));
|
|
76
|
+
}
|
|
77
|
+
/** Subscribes to status inherited from the original root */
|
|
78
|
+
get status$() {
|
|
79
|
+
return this.$$ref("status$", (store) => this.maintainers$.pipe(switchMap((maintainers) => store.model(GitPatchStatusModel, this.event, maintainers))));
|
|
80
|
+
}
|
|
81
|
+
/** Subscribes to the latest authorized status of the original root */
|
|
82
|
+
get statusEvent$() {
|
|
83
|
+
return this.$$ref("statusEvent$", (store) => this.maintainers$.pipe(switchMap((maintainers) => store.model(GitPatchStatusEventModel, this.event, maintainers))));
|
|
84
|
+
}
|
|
85
|
+
activity$() {
|
|
86
|
+
return this.store.model(GitPatchRevisionsModel, this.event);
|
|
87
|
+
}
|
|
88
|
+
}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { ChainableObservable } from "applesauce-core";
|
|
2
|
+
import { NostrEvent } from "applesauce-core/helpers/event";
|
|
3
|
+
import { GitPullRequestEvent, GitPullRequestUpdateEvent, GitPullRequestState } from "../helpers/git-pull-request.js";
|
|
4
|
+
import { GitPatch } from "./git-patch.js";
|
|
5
|
+
import { CastRefEventStore, EventCast } from "./cast.js";
|
|
6
|
+
import { GitThread } from "./git-thread.js";
|
|
7
|
+
/** Cast for NIP-34 pull request update events */
|
|
8
|
+
export declare class GitPullRequestUpdate extends EventCast<GitPullRequestUpdateEvent> {
|
|
9
|
+
/**
|
|
10
|
+
* Creates a pull request update cast
|
|
11
|
+
* @throws if the event is not a valid update
|
|
12
|
+
*/
|
|
13
|
+
constructor(event: NostrEvent, store: CastRefEventStore);
|
|
14
|
+
/** The id of the pull request this update targets */
|
|
15
|
+
get pullRequestId(): string;
|
|
16
|
+
/** The updated branch tip commit */
|
|
17
|
+
get tipCommit(): string | undefined;
|
|
18
|
+
/** The clone URLs containing the updated tip */
|
|
19
|
+
get cloneUrls(): string[];
|
|
20
|
+
/** The common ancestor with the target branch */
|
|
21
|
+
get mergeBase(): string | undefined;
|
|
22
|
+
/** The author of the targeted pull request */
|
|
23
|
+
get pullRequestAuthor(): string;
|
|
24
|
+
/** The target pull request pointer with its relay and author hints */
|
|
25
|
+
get pullRequestPointer(): import("nostr-tools/nip19").EventPointer;
|
|
26
|
+
/** Subscribes to the targeted pull request */
|
|
27
|
+
get pullRequest$(): ChainableObservable<GitPullRequest | undefined>;
|
|
28
|
+
}
|
|
29
|
+
/** Cast for NIP-34 pull request events */
|
|
30
|
+
export declare class GitPullRequest extends GitThread<GitPullRequestEvent> {
|
|
31
|
+
/**
|
|
32
|
+
* Creates a pull request cast
|
|
33
|
+
* @throws if the event is not a valid pull request
|
|
34
|
+
*/
|
|
35
|
+
constructor(event: NostrEvent, store: CastRefEventStore);
|
|
36
|
+
/** The pull request subject */
|
|
37
|
+
get subject(): string | undefined;
|
|
38
|
+
/** The subject or first content line */
|
|
39
|
+
get title(): string;
|
|
40
|
+
/** The pull request labels */
|
|
41
|
+
get labels(): string[];
|
|
42
|
+
/** The original branch tip commit */
|
|
43
|
+
get tipCommit(): string | undefined;
|
|
44
|
+
/** The original clone URLs */
|
|
45
|
+
get cloneUrls(): string[];
|
|
46
|
+
/** The recommended branch name */
|
|
47
|
+
get branchName(): string | undefined;
|
|
48
|
+
/** The original common ancestor with the target branch */
|
|
49
|
+
get mergeBase(): string | undefined;
|
|
50
|
+
/** The id of the original patch revised by this pull request */
|
|
51
|
+
get patchId(): string | undefined;
|
|
52
|
+
/** The pointer to the original patch with its relay hint */
|
|
53
|
+
get patchPointer(): import("nostr-tools/nip19").EventPointer | undefined;
|
|
54
|
+
/** Subscribes to the original patch revised by this pull request */
|
|
55
|
+
get patch$(): ChainableObservable<GitPatch | undefined>;
|
|
56
|
+
/** Subscribes to the latest coherent tip, clone URLs and merge base */
|
|
57
|
+
get state$(): ChainableObservable<GitPullRequestState>;
|
|
58
|
+
/** Subscribes to the updates published by the pull request author */
|
|
59
|
+
get updates$(): ChainableObservable<GitPullRequestUpdate[]>;
|
|
60
|
+
/** Subscribes to the latest branch tip commit, including updates */
|
|
61
|
+
get latestTipCommit$(): ChainableObservable<string | undefined>;
|
|
62
|
+
/** Subscribes to the clone URLs containing the latest tip */
|
|
63
|
+
get latestCloneUrls$(): ChainableObservable<string[]>;
|
|
64
|
+
/** Subscribes to the latest merge base */
|
|
65
|
+
get latestMergeBase$(): ChainableObservable<string | undefined>;
|
|
66
|
+
protected activity$(): import("applesauce-core").Observable<GitPullRequestUpdateEvent[]>;
|
|
67
|
+
}
|