applesauce-common 0.0.0-next-20251203172109
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/LICENSE +21 -0
- package/README.md +59 -0
- package/dist/blueprints/app-data.d.ts +5 -0
- package/dist/blueprints/app-data.js +10 -0
- package/dist/blueprints/calendar.d.ts +5 -0
- package/dist/blueprints/calendar.js +7 -0
- package/dist/blueprints/channels.d.ts +6 -0
- package/dist/blueprints/channels.js +13 -0
- package/dist/blueprints/comment.d.ts +12 -0
- package/dist/blueprints/comment.js +15 -0
- package/dist/blueprints/delete.d.ts +9 -0
- package/dist/blueprints/delete.js +14 -0
- package/dist/blueprints/file-metadata.d.ts +8 -0
- package/dist/blueprints/file-metadata.js +11 -0
- package/dist/blueprints/follow-set.d.ts +11 -0
- package/dist/blueprints/follow-set.js +21 -0
- package/dist/blueprints/gift-wrap.d.ts +5 -0
- package/dist/blueprints/gift-wrap.js +6 -0
- package/dist/blueprints/group.d.ts +9 -0
- package/dist/blueprints/group.js +17 -0
- package/dist/blueprints/highlight.d.ts +20 -0
- package/dist/blueprints/highlight.js +12 -0
- package/dist/blueprints/index.d.ts +23 -0
- package/dist/blueprints/index.js +24 -0
- package/dist/blueprints/legacy-message.d.ts +7 -0
- package/dist/blueprints/legacy-message.js +29 -0
- package/dist/blueprints/live-stream.d.ts +6 -0
- package/dist/blueprints/live-stream.js +9 -0
- package/dist/blueprints/note.d.ts +16 -0
- package/dist/blueprints/note.js +30 -0
- package/dist/blueprints/picture-post.d.ts +12 -0
- package/dist/blueprints/picture-post.js +17 -0
- package/dist/blueprints/poll.d.ts +41 -0
- package/dist/blueprints/poll.js +33 -0
- package/dist/blueprints/profile.d.ts +3 -0
- package/dist/blueprints/profile.js +7 -0
- package/dist/blueprints/reaction.d.ts +10 -0
- package/dist/blueprints/reaction.js +14 -0
- package/dist/blueprints/share.d.ts +12 -0
- package/dist/blueprints/share.js +25 -0
- package/dist/blueprints/stream.d.ts +6 -0
- package/dist/blueprints/stream.js +7 -0
- package/dist/blueprints/torrent.d.ts +23 -0
- package/dist/blueprints/torrent.js +25 -0
- package/dist/blueprints/wrapped-message.d.ts +20 -0
- package/dist/blueprints/wrapped-message.js +64 -0
- package/dist/helpers/app-data.d.ts +39 -0
- package/dist/helpers/app-data.js +68 -0
- package/dist/helpers/app-handler.d.ts +22 -0
- package/dist/helpers/app-handler.js +67 -0
- package/dist/helpers/article.d.ts +14 -0
- package/dist/helpers/article.js +24 -0
- package/dist/helpers/blossom.d.ts +11 -0
- package/dist/helpers/blossom.js +40 -0
- package/dist/helpers/bolt11.d.ts +10 -0
- package/dist/helpers/bolt11.js +17 -0
- package/dist/helpers/bookmark.d.ts +30 -0
- package/dist/helpers/bookmark.js +96 -0
- package/dist/helpers/calendar-event.d.ts +39 -0
- package/dist/helpers/calendar-event.js +121 -0
- package/dist/helpers/calendar-rsvp.d.ts +15 -0
- package/dist/helpers/calendar-rsvp.js +38 -0
- package/dist/helpers/calendar.d.ts +6 -0
- package/dist/helpers/calendar.js +11 -0
- package/dist/helpers/channels.d.ts +13 -0
- package/dist/helpers/channels.js +27 -0
- package/dist/helpers/comment.d.ts +47 -0
- package/dist/helpers/comment.js +185 -0
- package/dist/helpers/content.d.ts +3 -0
- package/dist/helpers/content.js +8 -0
- package/dist/helpers/emoji.d.ts +21 -0
- package/dist/helpers/emoji.js +34 -0
- package/dist/helpers/encrypted-content-cache.d.ts +22 -0
- package/dist/helpers/encrypted-content-cache.js +138 -0
- package/dist/helpers/file-metadata.d.ts +55 -0
- package/dist/helpers/file-metadata.js +130 -0
- package/dist/helpers/gift-wrap.d.ts +66 -0
- package/dist/helpers/gift-wrap.js +204 -0
- package/dist/helpers/groups-helper.d.ts +6 -0
- package/dist/helpers/groups-helper.js +9 -0
- package/dist/helpers/groups.d.ts +26 -0
- package/dist/helpers/groups.js +49 -0
- package/dist/helpers/hashtag.d.ts +2 -0
- package/dist/helpers/hashtag.js +7 -0
- package/dist/helpers/highlight.d.ts +45 -0
- package/dist/helpers/highlight.js +76 -0
- package/dist/helpers/index.d.ts +37 -0
- package/dist/helpers/index.js +37 -0
- package/dist/helpers/legacy-messages.d.ts +31 -0
- package/dist/helpers/legacy-messages.js +49 -0
- package/dist/helpers/lists.d.ts +58 -0
- package/dist/helpers/lists.js +110 -0
- package/dist/helpers/lnurl.d.ts +8 -0
- package/dist/helpers/lnurl.js +44 -0
- package/dist/helpers/mailboxes.d.ts +7 -0
- package/dist/helpers/mailboxes.js +49 -0
- package/dist/helpers/messages.d.ts +31 -0
- package/dist/helpers/messages.js +57 -0
- package/dist/helpers/mute.d.ts +33 -0
- package/dist/helpers/mute.js +111 -0
- package/dist/helpers/picture-post.d.ts +5 -0
- package/dist/helpers/picture-post.js +6 -0
- package/dist/helpers/poll.d.ts +46 -0
- package/dist/helpers/poll.js +78 -0
- package/dist/helpers/reaction.d.ts +8 -0
- package/dist/helpers/reaction.js +56 -0
- package/dist/helpers/relay-discovery.d.ts +87 -0
- package/dist/helpers/relay-discovery.js +126 -0
- package/dist/helpers/reports.d.ts +28 -0
- package/dist/helpers/reports.js +38 -0
- package/dist/helpers/share.d.ts +19 -0
- package/dist/helpers/share.js +58 -0
- package/dist/helpers/stream-chat.d.ts +4 -0
- package/dist/helpers/stream-chat.js +9 -0
- package/dist/helpers/stream.d.ts +31 -0
- package/dist/helpers/stream.js +81 -0
- package/dist/helpers/threading.d.ts +55 -0
- package/dist/helpers/threading.js +94 -0
- package/dist/helpers/torrent.d.ts +55 -0
- package/dist/helpers/torrent.js +270 -0
- package/dist/helpers/user-status.d.ts +18 -0
- package/dist/helpers/user-status.js +22 -0
- package/dist/helpers/wrapped-messages.d.ts +14 -0
- package/dist/helpers/wrapped-messages.js +23 -0
- package/dist/helpers/zap.d.ts +46 -0
- package/dist/helpers/zap.js +125 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.js +6 -0
- package/dist/models/blossom.d.ts +11 -0
- package/dist/models/blossom.js +18 -0
- package/dist/models/bookmarks.d.ts +8 -0
- package/dist/models/bookmarks.js +24 -0
- package/dist/models/calendar.d.ts +6 -0
- package/dist/models/calendar.js +15 -0
- package/dist/models/channels.d.ts +11 -0
- package/dist/models/channels.js +61 -0
- package/dist/models/comments.d.ts +11 -0
- package/dist/models/comments.js +17 -0
- package/dist/models/gift-wrap.d.ts +7 -0
- package/dist/models/gift-wrap.js +20 -0
- package/dist/models/index.d.ts +15 -0
- package/dist/models/index.js +16 -0
- package/dist/models/legacy-messages.d.ts +14 -0
- package/dist/models/legacy-messages.js +64 -0
- package/dist/models/mutes.d.ts +16 -0
- package/dist/models/mutes.js +34 -0
- package/dist/models/pins.d.ts +4 -0
- package/dist/models/pins.js +10 -0
- package/dist/models/reactions.d.ts +11 -0
- package/dist/models/reactions.js +21 -0
- package/dist/models/thread.d.ts +33 -0
- package/dist/models/thread.js +93 -0
- package/dist/models/user-status.d.ts +11 -0
- package/dist/models/user-status.js +32 -0
- package/dist/models/wrapped-messages.d.ts +31 -0
- package/dist/models/wrapped-messages.js +76 -0
- package/dist/models/zaps.d.ts +9 -0
- package/dist/models/zaps.js +26 -0
- package/dist/operations/app-data.d.ts +6 -0
- package/dist/operations/app-data.js +21 -0
- package/dist/operations/blossom.d.ts +5 -0
- package/dist/operations/blossom.js +13 -0
- package/dist/operations/calendar-event.d.ts +34 -0
- package/dist/operations/calendar-event.js +72 -0
- package/dist/operations/calendar-rsvp.d.ts +10 -0
- package/dist/operations/calendar-rsvp.js +35 -0
- package/dist/operations/calendar.d.ts +9 -0
- package/dist/operations/calendar.js +15 -0
- package/dist/operations/channel.d.ts +4 -0
- package/dist/operations/channel.js +10 -0
- package/dist/operations/client.d.ts +4 -0
- package/dist/operations/client.js +23 -0
- package/dist/operations/comment.d.ts +4 -0
- package/dist/operations/comment.js +11 -0
- package/dist/operations/file-metadata.d.ts +4 -0
- package/dist/operations/file-metadata.js +21 -0
- package/dist/operations/geohash.d.ts +5 -0
- package/dist/operations/geohash.js +17 -0
- package/dist/operations/gift-wrap.d.ts +13 -0
- package/dist/operations/gift-wrap.js +93 -0
- package/dist/operations/group.d.ts +11 -0
- package/dist/operations/group.js +34 -0
- package/dist/operations/hashtags.d.ts +7 -0
- package/dist/operations/hashtags.js +17 -0
- package/dist/operations/highlight.d.ts +18 -0
- package/dist/operations/highlight.js +47 -0
- package/dist/operations/index.d.ts +28 -0
- package/dist/operations/index.js +28 -0
- package/dist/operations/legacy-message.d.ts +6 -0
- package/dist/operations/legacy-message.js +13 -0
- package/dist/operations/list.d.ts +7 -0
- package/dist/operations/list.js +14 -0
- package/dist/operations/live-stream.d.ts +4 -0
- package/dist/operations/live-stream.js +11 -0
- package/dist/operations/media-attachment.d.ts +4 -0
- package/dist/operations/media-attachment.js +12 -0
- package/dist/operations/note.d.ts +9 -0
- package/dist/operations/note.js +42 -0
- package/dist/operations/picture-post.d.ts +4 -0
- package/dist/operations/picture-post.js +14 -0
- package/dist/operations/poll-response.d.ts +9 -0
- package/dist/operations/poll-response.js +20 -0
- package/dist/operations/poll.d.ts +19 -0
- package/dist/operations/poll.js +42 -0
- package/dist/operations/reaction.d.ts +7 -0
- package/dist/operations/reaction.js +39 -0
- package/dist/operations/share.d.ts +8 -0
- package/dist/operations/share.js +34 -0
- package/dist/operations/stream-chat.d.ts +7 -0
- package/dist/operations/stream-chat.js +27 -0
- package/dist/operations/stream.d.ts +41 -0
- package/dist/operations/stream.js +83 -0
- package/dist/operations/tag/bookmarks.d.ts +6 -0
- package/dist/operations/tag/bookmarks.js +20 -0
- package/dist/operations/tag/index.d.ts +1 -0
- package/dist/operations/tag/index.js +1 -0
- package/dist/operations/torrent.d.ts +33 -0
- package/dist/operations/torrent.js +66 -0
- package/dist/operations/wrapped-message.d.ts +12 -0
- package/dist/operations/wrapped-message.js +28 -0
- package/dist/operations/zap-split.d.ts +10 -0
- package/dist/operations/zap-split.js +20 -0
- package/dist/register.d.ts +11 -0
- package/dist/register.js +13 -0
- package/package.json +91 -0
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { EventOperation } from "applesauce-core/event-factory";
|
|
2
|
+
import { TorrentExternalIdentifier, TorrentExternalIdentifierPrefix, TorrentFile } from "../helpers/torrent.js";
|
|
3
|
+
/** Sets the BitTorrent info hash (required `x` tag) */
|
|
4
|
+
export declare function setTorrentInfoHash(infoHash: string): EventOperation;
|
|
5
|
+
/** Sets the torrent title */
|
|
6
|
+
export declare function setTorrentTitle(title: string): EventOperation;
|
|
7
|
+
/** Adds a file entry to the torrent */
|
|
8
|
+
export declare function addTorrentFile(file: TorrentFile): EventOperation;
|
|
9
|
+
/** Removes a file entry from the torrent */
|
|
10
|
+
export declare function removeTorrentFile(fileName: string): EventOperation;
|
|
11
|
+
/** Adds a tracker URL to the torrent */
|
|
12
|
+
export declare function addTorrentTracker(tracker: string): EventOperation;
|
|
13
|
+
/** Removes a tracker URL from the torrent */
|
|
14
|
+
export declare function removeTorrentTracker(tracker: string): EventOperation;
|
|
15
|
+
/** Sets the newznab category ID (replaces any existing newznab category) */
|
|
16
|
+
export declare function setTorrentCategory(categoryId: number): EventOperation;
|
|
17
|
+
/** Removes the newznab category ID */
|
|
18
|
+
export declare function removeTorrentCategory(): EventOperation;
|
|
19
|
+
/** Adds a search tag (for searchability) */
|
|
20
|
+
export declare function addTorrentSearchTag(tag: string): EventOperation;
|
|
21
|
+
/** Removes a search tag */
|
|
22
|
+
export declare function removeTorrentSearchTag(tag: string): EventOperation;
|
|
23
|
+
/** Sets the category path (tcat) */
|
|
24
|
+
export declare function setTorrentCategoryPath(categoryPath: string): EventOperation;
|
|
25
|
+
/** Adds an external identifier */
|
|
26
|
+
export declare function addTorrentExternalIdentifier(identifier: TorrentExternalIdentifier): EventOperation;
|
|
27
|
+
/**
|
|
28
|
+
* Adds an external identifier using prefix, id, and optional mediaType
|
|
29
|
+
* Convenience function that creates the identifier object automatically
|
|
30
|
+
*/
|
|
31
|
+
export declare function addTorrentExternalIdentifierByParts(prefix: TorrentExternalIdentifierPrefix, id: string, mediaType?: string): EventOperation;
|
|
32
|
+
/** Removes an external identifier */
|
|
33
|
+
export declare function removeTorrentExternalIdentifier(identifier: string): EventOperation;
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { addNameValueTag, removeNameValueTag, setSingletonTag } from "applesauce-core/operations/tag/common";
|
|
2
|
+
import { modifyPublicTags } from "applesauce-core/operations/tags";
|
|
3
|
+
import { createTorrentExternalIdentifier, } from "../helpers/torrent.js";
|
|
4
|
+
/** Sets the BitTorrent info hash (required `x` tag) */
|
|
5
|
+
export function setTorrentInfoHash(infoHash) {
|
|
6
|
+
return modifyPublicTags(setSingletonTag(["x", infoHash]));
|
|
7
|
+
}
|
|
8
|
+
/** Sets the torrent title */
|
|
9
|
+
export function setTorrentTitle(title) {
|
|
10
|
+
return modifyPublicTags(setSingletonTag(["title", title]));
|
|
11
|
+
}
|
|
12
|
+
/** Adds a file entry to the torrent */
|
|
13
|
+
export function addTorrentFile(file) {
|
|
14
|
+
const tag = file.size
|
|
15
|
+
? ["file", file.name, file.size.toString()]
|
|
16
|
+
: ["file", file.name];
|
|
17
|
+
return modifyPublicTags(addNameValueTag(tag, false));
|
|
18
|
+
}
|
|
19
|
+
/** Removes a file entry from the torrent */
|
|
20
|
+
export function removeTorrentFile(fileName) {
|
|
21
|
+
return modifyPublicTags(removeNameValueTag(["file", fileName]));
|
|
22
|
+
}
|
|
23
|
+
/** Adds a tracker URL to the torrent */
|
|
24
|
+
export function addTorrentTracker(tracker) {
|
|
25
|
+
return modifyPublicTags(addNameValueTag(["tracker", tracker], false));
|
|
26
|
+
}
|
|
27
|
+
/** Removes a tracker URL from the torrent */
|
|
28
|
+
export function removeTorrentTracker(tracker) {
|
|
29
|
+
return modifyPublicTags(removeNameValueTag(["tracker", tracker]));
|
|
30
|
+
}
|
|
31
|
+
/** Sets the newznab category ID (replaces any existing newznab category) */
|
|
32
|
+
export function setTorrentCategory(categoryId) {
|
|
33
|
+
return modifyPublicTags(setSingletonTag(["i", `newznab:${categoryId}`]));
|
|
34
|
+
}
|
|
35
|
+
/** Removes the newznab category ID */
|
|
36
|
+
export function removeTorrentCategory() {
|
|
37
|
+
return modifyPublicTags((tags) => tags.filter((t) => !(t[0] === "i" && t[1]?.startsWith("newznab:"))));
|
|
38
|
+
}
|
|
39
|
+
/** Adds a search tag (for searchability) */
|
|
40
|
+
export function addTorrentSearchTag(tag) {
|
|
41
|
+
return modifyPublicTags(addNameValueTag(["t", tag], false));
|
|
42
|
+
}
|
|
43
|
+
/** Removes a search tag */
|
|
44
|
+
export function removeTorrentSearchTag(tag) {
|
|
45
|
+
return modifyPublicTags(removeNameValueTag(["t", tag]));
|
|
46
|
+
}
|
|
47
|
+
/** Sets the category path (tcat) */
|
|
48
|
+
export function setTorrentCategoryPath(categoryPath) {
|
|
49
|
+
return modifyPublicTags(setSingletonTag(["i", `tcat:${categoryPath}`]));
|
|
50
|
+
}
|
|
51
|
+
/** Adds an external identifier */
|
|
52
|
+
export function addTorrentExternalIdentifier(identifier) {
|
|
53
|
+
return modifyPublicTags(addNameValueTag(["i", identifier.identifier], false));
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Adds an external identifier using prefix, id, and optional mediaType
|
|
57
|
+
* Convenience function that creates the identifier object automatically
|
|
58
|
+
*/
|
|
59
|
+
export function addTorrentExternalIdentifierByParts(prefix, id, mediaType) {
|
|
60
|
+
const identifier = createTorrentExternalIdentifier(prefix, id, mediaType);
|
|
61
|
+
return addTorrentExternalIdentifier(identifier);
|
|
62
|
+
}
|
|
63
|
+
/** Removes an external identifier */
|
|
64
|
+
export function removeTorrentExternalIdentifier(identifier) {
|
|
65
|
+
return modifyPublicTags(removeNameValueTag(["i", identifier]));
|
|
66
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { EventOperation } from "applesauce-core/event-factory";
|
|
2
|
+
import { Rumor } from "../helpers/gift-wrap.js";
|
|
3
|
+
/**
|
|
4
|
+
* Sets the nessiary "p" tags for a wrapped message
|
|
5
|
+
* @param participants - The conversation identifier (pubkey1:pubkey2:pubkey3), a users pubkey, or a list of participant pubkeys
|
|
6
|
+
* @param self - The public key of the sender
|
|
7
|
+
*/
|
|
8
|
+
export declare function setConversation(participants: string | string[], self: string): EventOperation;
|
|
9
|
+
/** Sets the subject of a wrapped message */
|
|
10
|
+
export declare function setSubject(subject: string): EventOperation;
|
|
11
|
+
/** Makes the wrapped message a reply to the parent message */
|
|
12
|
+
export declare function setParent(parent: Rumor | string): EventOperation;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { kinds } from "applesauce-core/helpers/event";
|
|
2
|
+
import { eventPipe } from "applesauce-core/helpers/pipeline";
|
|
3
|
+
import { includeNameValueTag } from "applesauce-core/operations/tags";
|
|
4
|
+
import { getConversationParticipants } from "../helpers/messages.js";
|
|
5
|
+
/**
|
|
6
|
+
* Sets the nessiary "p" tags for a wrapped message
|
|
7
|
+
* @param participants - The conversation identifier (pubkey1:pubkey2:pubkey3), a users pubkey, or a list of participant pubkeys
|
|
8
|
+
* @param self - The public key of the sender
|
|
9
|
+
*/
|
|
10
|
+
export function setConversation(participants, self) {
|
|
11
|
+
const keys = new Set(typeof participants === "string" ? getConversationParticipants(participants) : participants);
|
|
12
|
+
// NOTE: do not include the sender in the message. their pubkey will be attached to the message in "pubkey"
|
|
13
|
+
keys.delete(self);
|
|
14
|
+
// TODO: support relay hints
|
|
15
|
+
return eventPipe(...Array.from(keys).map((key) => includeNameValueTag(["p", key])));
|
|
16
|
+
}
|
|
17
|
+
/** Sets the subject of a wrapped message */
|
|
18
|
+
export function setSubject(subject) {
|
|
19
|
+
return includeNameValueTag(["subject", subject]);
|
|
20
|
+
}
|
|
21
|
+
/** Makes the wrapped message a reply to the parent message */
|
|
22
|
+
export function setParent(parent) {
|
|
23
|
+
if (typeof parent !== "string" && parent.kind !== kinds.PrivateDirectMessage)
|
|
24
|
+
throw new Error("Parent must be a private direct message event");
|
|
25
|
+
const id = typeof parent === "string" ? parent : parent.id;
|
|
26
|
+
// TODO: support relay hints
|
|
27
|
+
return includeNameValueTag(["e", id]);
|
|
28
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { EventOperation } from "applesauce-core/event-factory";
|
|
2
|
+
import { ZapSplit } from "../helpers/zap.js";
|
|
3
|
+
/** Override the zap splits on an event */
|
|
4
|
+
export declare function setZapSplitTags(splits: Omit<ZapSplit, "percent" | "relay">[]): EventOperation;
|
|
5
|
+
/** Options for {@link setZapSplit} */
|
|
6
|
+
export type ZapOptions = {
|
|
7
|
+
splits?: Omit<ZapSplit, "percent" | "relay">[];
|
|
8
|
+
};
|
|
9
|
+
/** Creates the necessary operations for zap options */
|
|
10
|
+
export declare function setZapSplit(options?: ZapOptions): EventOperation;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { skip } from "applesauce-core/helpers/pipeline";
|
|
2
|
+
import { fillAndTrimTag } from "applesauce-core/helpers/tags";
|
|
3
|
+
/** Override the zap splits on an event */
|
|
4
|
+
export function setZapSplitTags(splits) {
|
|
5
|
+
return async (draft, ctx) => {
|
|
6
|
+
let tags = Array.from(draft.tags);
|
|
7
|
+
// remove any existing zap split tags
|
|
8
|
+
tags = tags.filter((t) => t[0] !== "zap");
|
|
9
|
+
// add split tags
|
|
10
|
+
for (const split of splits) {
|
|
11
|
+
const hint = await ctx.getPubkeyRelayHint?.(split.pubkey);
|
|
12
|
+
tags.push(fillAndTrimTag(["zap", split.pubkey, hint, String(split.weight)]));
|
|
13
|
+
}
|
|
14
|
+
return { ...draft, tags };
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
/** Creates the necessary operations for zap options */
|
|
18
|
+
export function setZapSplit(options) {
|
|
19
|
+
return options?.splits ? setZapSplitTags(options.splits) : skip();
|
|
20
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import "./models/blossom.js";
|
|
2
|
+
import "./models/mutes.js";
|
|
3
|
+
import "./models/reactions.js";
|
|
4
|
+
import "./models/comments.js";
|
|
5
|
+
import "./models/thread.js";
|
|
6
|
+
import "./blueprints/comment.js";
|
|
7
|
+
import "./blueprints/delete.js";
|
|
8
|
+
import "./blueprints/note.js";
|
|
9
|
+
import "./blueprints/reaction.js";
|
|
10
|
+
import "./blueprints/share.js";
|
|
11
|
+
import "./blueprints/poll.js";
|
package/dist/register.js
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
// Import models that should register with the event store
|
|
2
|
+
import "./models/blossom.js";
|
|
3
|
+
import "./models/mutes.js";
|
|
4
|
+
import "./models/reactions.js";
|
|
5
|
+
import "./models/comments.js";
|
|
6
|
+
import "./models/thread.js";
|
|
7
|
+
// Import blueprints that should register with the event factory
|
|
8
|
+
import "./blueprints/comment.js";
|
|
9
|
+
import "./blueprints/delete.js";
|
|
10
|
+
import "./blueprints/note.js";
|
|
11
|
+
import "./blueprints/reaction.js";
|
|
12
|
+
import "./blueprints/share.js";
|
|
13
|
+
import "./blueprints/poll.js";
|
package/package.json
ADDED
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "applesauce-common",
|
|
3
|
+
"version": "0.0.0-next-20251203172109",
|
|
4
|
+
"description": "Common NIP-specific helpers and models for applesauce",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "dist/index.js",
|
|
7
|
+
"types": "dist/index.d.ts",
|
|
8
|
+
"keywords": [
|
|
9
|
+
"nostr",
|
|
10
|
+
"applesauce"
|
|
11
|
+
],
|
|
12
|
+
"author": "hzrd149",
|
|
13
|
+
"license": "MIT",
|
|
14
|
+
"files": [
|
|
15
|
+
"dist"
|
|
16
|
+
],
|
|
17
|
+
"exports": {
|
|
18
|
+
".": {
|
|
19
|
+
"import": "./dist/index.js",
|
|
20
|
+
"require": "./dist/index.js",
|
|
21
|
+
"types": "./dist/index.d.ts"
|
|
22
|
+
},
|
|
23
|
+
"./helpers": {
|
|
24
|
+
"import": "./dist/helpers/index.js",
|
|
25
|
+
"require": "./dist/helpers/index.js",
|
|
26
|
+
"types": "./dist/helpers/index.d.ts"
|
|
27
|
+
},
|
|
28
|
+
"./helpers/*": {
|
|
29
|
+
"import": "./dist/helpers/*.js",
|
|
30
|
+
"require": "./dist/helpers/*.js",
|
|
31
|
+
"types": "./dist/helpers/*.d.ts"
|
|
32
|
+
},
|
|
33
|
+
"./models": {
|
|
34
|
+
"import": "./dist/models/index.js",
|
|
35
|
+
"require": "./dist/models/index.js",
|
|
36
|
+
"types": "./dist/models/index.d.ts"
|
|
37
|
+
},
|
|
38
|
+
"./models/*": {
|
|
39
|
+
"import": "./dist/models/*.js",
|
|
40
|
+
"require": "./dist/models/*.js",
|
|
41
|
+
"types": "./dist/models/*.d.ts"
|
|
42
|
+
},
|
|
43
|
+
"./operations": {
|
|
44
|
+
"import": "./dist/operations/index.js",
|
|
45
|
+
"require": "./dist/operations/index.js",
|
|
46
|
+
"types": "./dist/operations/index.d.ts"
|
|
47
|
+
},
|
|
48
|
+
"./operations/*": {
|
|
49
|
+
"import": "./dist/operations/*.js",
|
|
50
|
+
"require": "./dist/operations/*.js",
|
|
51
|
+
"types": "./dist/operations/*.d.ts"
|
|
52
|
+
},
|
|
53
|
+
"./blueprints": {
|
|
54
|
+
"import": "./dist/blueprints/index.js",
|
|
55
|
+
"require": "./dist/blueprints/index.js",
|
|
56
|
+
"types": "./dist/blueprints/index.d.ts"
|
|
57
|
+
},
|
|
58
|
+
"./blueprints/*": {
|
|
59
|
+
"import": "./dist/blueprints/*.js",
|
|
60
|
+
"require": "./dist/blueprints/*.js",
|
|
61
|
+
"types": "./dist/blueprints/*.d.ts"
|
|
62
|
+
}
|
|
63
|
+
},
|
|
64
|
+
"dependencies": {
|
|
65
|
+
"@scure/base": "^1.2.4",
|
|
66
|
+
"applesauce-core": "0.0.0-next-20251203172109",
|
|
67
|
+
"hash-sum": "^2.0.0",
|
|
68
|
+
"light-bolt11-decoder": "^3.2.0",
|
|
69
|
+
"rxjs": "^7.8.1"
|
|
70
|
+
},
|
|
71
|
+
"devDependencies": {
|
|
72
|
+
"@hirez_io/observer-spy": "^2.2.0",
|
|
73
|
+
"@types/debug": "^4.1.12",
|
|
74
|
+
"@types/hash-sum": "^1.0.2",
|
|
75
|
+
"nostr-tools": "^2.18",
|
|
76
|
+
"rimraf": "^6.0.1",
|
|
77
|
+
"typescript": "^5.8.3",
|
|
78
|
+
"vitest": "^4.0.15"
|
|
79
|
+
},
|
|
80
|
+
"funding": {
|
|
81
|
+
"type": "lightning",
|
|
82
|
+
"url": "lightning:nostrudel@geyser.fund"
|
|
83
|
+
},
|
|
84
|
+
"scripts": {
|
|
85
|
+
"prebuild": "rimraf dist",
|
|
86
|
+
"build": "tsc",
|
|
87
|
+
"watch:build": "tsc --watch > /dev/null",
|
|
88
|
+
"test": "vitest run --passWithNoTests",
|
|
89
|
+
"watch:test": "vitest"
|
|
90
|
+
}
|
|
91
|
+
}
|