applesauce-common 7.0.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/dist/casts/index.d.ts +1 -0
- package/dist/casts/index.js +1 -0
- package/dist/casts/napplet-handlers.d.ts +39 -0
- package/dist/casts/napplet-handlers.js +91 -0
- package/dist/factories/file-message.d.ts +24 -0
- package/dist/factories/file-message.js +37 -0
- package/dist/factories/index.d.ts +2 -0
- package/dist/factories/index.js +2 -0
- package/dist/factories/napplet-handlers.d.ts +34 -0
- package/dist/factories/napplet-handlers.js +77 -0
- package/dist/factories/wrapped-message.js +10 -4
- package/dist/helpers/encrypted-content-cache.d.ts +2 -11
- package/dist/helpers/encrypted-content-cache.js +6 -31
- package/dist/helpers/encrypted-file.d.ts +41 -0
- package/dist/helpers/encrypted-file.js +64 -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 +16 -0
- package/dist/helpers/index.d.ts +3 -0
- package/dist/helpers/index.js +3 -0
- package/dist/helpers/messages.js +3 -2
- package/dist/helpers/mute.js +2 -2
- package/dist/helpers/napplet-handlers.d.ts +79 -0
- package/dist/helpers/napplet-handlers.js +187 -0
- package/dist/helpers/napplet.d.ts +18 -0
- package/dist/helpers/napplet.js +33 -0
- package/dist/helpers/wrapped-messages.d.ts +2 -0
- package/dist/helpers/wrapped-messages.js +6 -1
- package/dist/models/index.d.ts +1 -0
- package/dist/models/index.js +1 -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/wrapped-messages.js +9 -7
- package/dist/observable/filter-timeline-by-mutes.js +1 -1
- package/dist/operations/file-message.d.ts +7 -0
- package/dist/operations/file-message.js +34 -0
- package/dist/operations/index.d.ts +2 -0
- package/dist/operations/index.js +2 -0
- package/dist/operations/napplet-handlers.d.ts +47 -0
- package/dist/operations/napplet-handlers.js +161 -0
- package/dist/operations/wrapped-message.js +2 -2
- package/package.json +12 -16
|
@@ -7,5 +7,5 @@ export function filterTimelineByMutes(
|
|
|
7
7
|
// seam was closed in applesauce-core; MuteModel is NostrEvent-only, so E is pinned explicitly
|
|
8
8
|
// to restore the arity this bare 1-arg usage relied on.
|
|
9
9
|
eventStore, user) {
|
|
10
|
-
return (source) => combineLatest([source, eventStore.model(MuteModel, user)]).pipe(map(([source, mutes]) => (mutes ? source.filter((event) => matchMutes(mutes, event)) : source)));
|
|
10
|
+
return (source) => combineLatest([source, eventStore.model(MuteModel, user)]).pipe(map(([source, mutes]) => (mutes ? source.filter((event) => !matchMutes(mutes, event)) : source)));
|
|
11
11
|
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { EventOperation } from "applesauce-core/factories";
|
|
2
|
+
import { FileMetadataFields } from "../helpers/file-metadata.js";
|
|
3
|
+
/**
|
|
4
|
+
* Sets the URL and file tags of a NIP-17 kind 15 file message
|
|
5
|
+
* @throws if the file has no URL
|
|
6
|
+
*/
|
|
7
|
+
export declare function setFileMessage(file: FileMetadataFields): EventOperation;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { eventPipe } from "applesauce-core/helpers/pipeline";
|
|
2
|
+
import { setContent } from "applesauce-core/operations/content";
|
|
3
|
+
import { addNameValueTag, removeSingletonTag, setSingletonTag } from "applesauce-core/operations/tag/common";
|
|
4
|
+
import { modifyPublicTags } from "applesauce-core/operations/tags";
|
|
5
|
+
/** The kind 15 tags written for each file field, in NIP-17 order */
|
|
6
|
+
const FILE_MESSAGE_TAGS = [
|
|
7
|
+
["file-type", "type"],
|
|
8
|
+
["encryption-algorithm", "encryptionAlgorithm"],
|
|
9
|
+
["decryption-key", "decryptionKey"],
|
|
10
|
+
["decryption-nonce", "decryptionNonce"],
|
|
11
|
+
["x", "sha256"],
|
|
12
|
+
["ox", "originalSha256"],
|
|
13
|
+
["size", "size"],
|
|
14
|
+
["dim", "dimensions"],
|
|
15
|
+
["blurhash", "blurhash"],
|
|
16
|
+
["thumb", "thumbnail"],
|
|
17
|
+
["alt", "alt"],
|
|
18
|
+
];
|
|
19
|
+
/**
|
|
20
|
+
* Sets the URL and file tags of a NIP-17 kind 15 file message
|
|
21
|
+
* @throws if the file has no URL
|
|
22
|
+
*/
|
|
23
|
+
export function setFileMessage(file) {
|
|
24
|
+
if (!file.url)
|
|
25
|
+
throw new Error("File message requires a URL");
|
|
26
|
+
const tagOperations = FILE_MESSAGE_TAGS.map(([name, field]) => {
|
|
27
|
+
const value = file[field];
|
|
28
|
+
if (value === undefined || value === "")
|
|
29
|
+
return removeSingletonTag(name);
|
|
30
|
+
return setSingletonTag([name, String(value)], true);
|
|
31
|
+
});
|
|
32
|
+
const fallbackOperations = (file.fallback ?? []).map((url) => addNameValueTag(["fallback", url]));
|
|
33
|
+
return eventPipe(setContent(file.url), modifyPublicTags(...tagOperations, ...fallbackOperations));
|
|
34
|
+
}
|
|
@@ -13,6 +13,7 @@ export * as ForumThread from "./forum-thread.js";
|
|
|
13
13
|
export * as Client from "./client.js";
|
|
14
14
|
export * as Comment from "./comment.js";
|
|
15
15
|
export * as ExternalIdentities from "./external-identities.js";
|
|
16
|
+
export * as FileMessage from "./file-message.js";
|
|
16
17
|
export * as FileMetadata from "./file-metadata.js";
|
|
17
18
|
export * as Geohash from "./geohash.js";
|
|
18
19
|
export * as GiftWrap from "./gift-wrap.js";
|
|
@@ -31,6 +32,7 @@ export * as List from "./list.js";
|
|
|
31
32
|
export * as LiveStream from "./live-stream.js";
|
|
32
33
|
export * as MediaAttachment from "./media-attachment.js";
|
|
33
34
|
export * as Napplet from "./napplet.js";
|
|
35
|
+
export * as NappletHandlers from "./napplet-handlers.js";
|
|
34
36
|
export * as Note from "./note.js";
|
|
35
37
|
export * as NostrWebToken from "./nostr-web-token.js";
|
|
36
38
|
export * as PicturePost from "./picture-post.js";
|
package/dist/operations/index.js
CHANGED
|
@@ -13,6 +13,7 @@ export * as ForumThread from "./forum-thread.js";
|
|
|
13
13
|
export * as Client from "./client.js";
|
|
14
14
|
export * as Comment from "./comment.js";
|
|
15
15
|
export * as ExternalIdentities from "./external-identities.js";
|
|
16
|
+
export * as FileMessage from "./file-message.js";
|
|
16
17
|
export * as FileMetadata from "./file-metadata.js";
|
|
17
18
|
export * as Geohash from "./geohash.js";
|
|
18
19
|
export * as GiftWrap from "./gift-wrap.js";
|
|
@@ -31,6 +32,7 @@ export * as List from "./list.js";
|
|
|
31
32
|
export * as LiveStream from "./live-stream.js";
|
|
32
33
|
export * as MediaAttachment from "./media-attachment.js";
|
|
33
34
|
export * as Napplet from "./napplet.js";
|
|
35
|
+
export * as NappletHandlers from "./napplet-handlers.js";
|
|
34
36
|
export * as Note from "./note.js";
|
|
35
37
|
export * as NostrWebToken from "./nostr-web-token.js";
|
|
36
38
|
export * as PicturePost from "./picture-post.js";
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { TagOperation } from "applesauce-core/factories";
|
|
2
|
+
import { NostrEvent } from "applesauce-core/helpers/event";
|
|
3
|
+
import { AddressPointer, EventPointer } from "applesauce-core/helpers/pointers";
|
|
4
|
+
/** A napplet to reference: a coordinate, snapshot id, `naddr`, `nevent`, pointer, or manifest event */
|
|
5
|
+
export type NappletHandlerInput = string | AddressPointer | EventPointer | NostrEvent;
|
|
6
|
+
/**
|
|
7
|
+
* Creates the archetype-wide `a` or `e` tag for a napplet
|
|
8
|
+
* @throws if the input is not a root or named napplet, or a kind 5129 snapshot
|
|
9
|
+
*/
|
|
10
|
+
export declare function createNappletHandlerTag(input: NappletHandlerInput): string[];
|
|
11
|
+
/**
|
|
12
|
+
* Returns the coordinate or snapshot id used as an `i` tag reference
|
|
13
|
+
* @throws if the input is not a root or named napplet, or a kind 5129 snapshot
|
|
14
|
+
*/
|
|
15
|
+
export declare function getNappletHandlerReference(input: NappletHandlerInput): string;
|
|
16
|
+
/**
|
|
17
|
+
* Adds an archetype-wide handler as the last fallback, or updates its relay hint in place
|
|
18
|
+
* @throws if the input is not a root or named napplet, or a kind 5129 snapshot
|
|
19
|
+
*/
|
|
20
|
+
export declare function addNappletHandlerTag(input: NappletHandlerInput): TagOperation;
|
|
21
|
+
/**
|
|
22
|
+
* Moves or inserts an archetype-wide handler to the front so it becomes preferred
|
|
23
|
+
* @throws if the input is not a root or named napplet, or a kind 5129 snapshot
|
|
24
|
+
*/
|
|
25
|
+
export declare function preferNappletHandlerTag(input: NappletHandlerInput): TagOperation;
|
|
26
|
+
/**
|
|
27
|
+
* Removes an archetype-wide handler
|
|
28
|
+
* @throws if the input is not a root or named napplet, or a kind 5129 snapshot
|
|
29
|
+
*/
|
|
30
|
+
export declare function removeNappletHandlerTag(input: NappletHandlerInput): TagOperation;
|
|
31
|
+
/**
|
|
32
|
+
* Adds an intent-specific handler as the last fallback for a convention identity
|
|
33
|
+
* @throws if the identity is invalid, or the input is not a napplet or kind 5129 snapshot
|
|
34
|
+
*/
|
|
35
|
+
export declare function addNappletIntentHandlerTag(identity: string, input: NappletHandlerInput): TagOperation;
|
|
36
|
+
/**
|
|
37
|
+
* Moves or inserts an intent-specific handler to the front so it becomes preferred for a convention identity
|
|
38
|
+
* @throws if the identity is invalid, or the input is not a napplet or kind 5129 snapshot
|
|
39
|
+
*/
|
|
40
|
+
export declare function preferNappletIntentHandlerTag(identity: string, input: NappletHandlerInput): TagOperation;
|
|
41
|
+
/**
|
|
42
|
+
* Removes one intent-specific handler, or every handler for the convention identity when no input is given
|
|
43
|
+
* @throws if the input is not a napplet or kind 5129 snapshot
|
|
44
|
+
*/
|
|
45
|
+
export declare function removeNappletIntentHandlerTag(identity: string, input?: NappletHandlerInput): TagOperation;
|
|
46
|
+
/** Removes every `a`, `e`, and `i` handler entry while keeping the `d` tag and unknown tags */
|
|
47
|
+
export declare function clearNappletHandlerTags(): TagOperation;
|
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
import { isEvent } from "applesauce-core/helpers/event";
|
|
2
|
+
import { decodeAddressPointer, decodeEventPointer, getReplaceableAddressFromPointer, isAddressPointer, parseReplaceableAddress, } from "applesauce-core/helpers/pointers";
|
|
3
|
+
import { isSafeRelayURL } from "applesauce-core/helpers/relays";
|
|
4
|
+
import { isHexKey } from "applesauce-core/helpers/string";
|
|
5
|
+
import { normalizeURL } from "applesauce-core/helpers/url";
|
|
6
|
+
import { isNappletHandlerAddress } from "../helpers/napplet-handlers.js";
|
|
7
|
+
import { NAPPLET_KIND, NAPPLET_ROOT_KIND, NAPPLET_SNAPSHOT_KIND, parseNappletConvention } from "../helpers/napplet.js";
|
|
8
|
+
/** Returns the first safe relay hint, normalized */
|
|
9
|
+
function getRelayHint(relays) {
|
|
10
|
+
const hint = relays?.find((url) => isSafeRelayURL(url));
|
|
11
|
+
return hint ? normalizeURL(hint) : undefined;
|
|
12
|
+
}
|
|
13
|
+
/** Creates an `a` tag for a root or named napplet address */
|
|
14
|
+
function createAddressTag(pointer) {
|
|
15
|
+
if (!isNappletHandlerAddress(pointer))
|
|
16
|
+
throw new Error("Expected a root or named napplet address");
|
|
17
|
+
const coordinate = getReplaceableAddressFromPointer(pointer);
|
|
18
|
+
const relay = getRelayHint(pointer.relays);
|
|
19
|
+
return relay ? ["a", coordinate, relay] : ["a", coordinate];
|
|
20
|
+
}
|
|
21
|
+
/** Creates an `e` tag for a pinned snapshot */
|
|
22
|
+
function createSnapshotTag(pointer) {
|
|
23
|
+
// Replaceable manifest ids become unresolvable once the napplet updates, so only snapshots can be pinned
|
|
24
|
+
if (pointer.kind !== undefined && pointer.kind !== NAPPLET_SNAPSHOT_KIND) {
|
|
25
|
+
throw new Error("Napplet pins must reference a kind 5129 snapshot");
|
|
26
|
+
}
|
|
27
|
+
if (!isHexKey(pointer.id))
|
|
28
|
+
throw new Error("Invalid napplet snapshot id");
|
|
29
|
+
const id = pointer.id.toLowerCase();
|
|
30
|
+
const relay = getRelayHint(pointer.relays);
|
|
31
|
+
// The relay hint is positional, so keep an empty slot when only the author is known
|
|
32
|
+
if (pointer.author)
|
|
33
|
+
return ["e", id, relay ?? "", pointer.author];
|
|
34
|
+
return relay ? ["e", id, relay] : ["e", id];
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Creates the archetype-wide `a` or `e` tag for a napplet
|
|
38
|
+
* @throws if the input is not a root or named napplet, or a kind 5129 snapshot
|
|
39
|
+
*/
|
|
40
|
+
export function createNappletHandlerTag(input) {
|
|
41
|
+
if (typeof input === "string") {
|
|
42
|
+
if (isHexKey(input))
|
|
43
|
+
return createSnapshotTag({ id: input });
|
|
44
|
+
const pointer = input.startsWith("naddr1") ? decodeAddressPointer(input) : parseReplaceableAddress(input);
|
|
45
|
+
if (pointer)
|
|
46
|
+
return createAddressTag(pointer);
|
|
47
|
+
const snapshot = decodeEventPointer(input);
|
|
48
|
+
if (snapshot)
|
|
49
|
+
return createSnapshotTag(snapshot);
|
|
50
|
+
throw new Error(`Invalid napplet reference: ${input}`);
|
|
51
|
+
}
|
|
52
|
+
if (isEvent(input)) {
|
|
53
|
+
if (input.kind === NAPPLET_SNAPSHOT_KIND) {
|
|
54
|
+
return createSnapshotTag({ id: input.id, kind: input.kind, author: input.pubkey });
|
|
55
|
+
}
|
|
56
|
+
if (input.kind !== NAPPLET_KIND && input.kind !== NAPPLET_ROOT_KIND) {
|
|
57
|
+
throw new Error("Expected a napplet manifest event");
|
|
58
|
+
}
|
|
59
|
+
const identifier = input.tags.find((t) => t[0] === "d")?.[1] ?? "";
|
|
60
|
+
return createAddressTag({ kind: input.kind, pubkey: input.pubkey, identifier });
|
|
61
|
+
}
|
|
62
|
+
if (isAddressPointer(input))
|
|
63
|
+
return createAddressTag(input);
|
|
64
|
+
return createSnapshotTag(input);
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* Returns the coordinate or snapshot id used as an `i` tag reference
|
|
68
|
+
* @throws if the input is not a root or named napplet, or a kind 5129 snapshot
|
|
69
|
+
*/
|
|
70
|
+
export function getNappletHandlerReference(input) {
|
|
71
|
+
return createNappletHandlerTag(input)[1];
|
|
72
|
+
}
|
|
73
|
+
/** Checks if a tag is an archetype-wide handler entry for a reference */
|
|
74
|
+
function isHandlerTag(tag, reference) {
|
|
75
|
+
return (tag[0] === "a" || tag[0] === "e") && tag[1] === reference;
|
|
76
|
+
}
|
|
77
|
+
/** Checks if a tag is an intent-specific handler entry, optionally for a single reference */
|
|
78
|
+
function isIntentTag(tag, identity, reference) {
|
|
79
|
+
return tag[0] === "i" && tag[1] === identity && (reference === undefined || tag[2] === reference);
|
|
80
|
+
}
|
|
81
|
+
/** Inserts a tag before the first matching tag, or appends it when none match */
|
|
82
|
+
function insertBefore(tags, tag, matches) {
|
|
83
|
+
const index = tags.findIndex(matches);
|
|
84
|
+
if (index === -1)
|
|
85
|
+
return [...tags, tag];
|
|
86
|
+
return [...tags.slice(0, index), tag, ...tags.slice(index)];
|
|
87
|
+
}
|
|
88
|
+
/** Throws if a convention identity is malformed or has a query or fragment */
|
|
89
|
+
function assertConvention(identity) {
|
|
90
|
+
if (!parseNappletConvention(identity))
|
|
91
|
+
throw new Error(`Invalid napplet convention identity: ${identity}`);
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* Adds an archetype-wide handler as the last fallback, or updates its relay hint in place
|
|
95
|
+
* @throws if the input is not a root or named napplet, or a kind 5129 snapshot
|
|
96
|
+
*/
|
|
97
|
+
export function addNappletHandlerTag(input) {
|
|
98
|
+
const tag = createNappletHandlerTag(input);
|
|
99
|
+
return (tags) => {
|
|
100
|
+
const index = tags.findIndex((t) => isHandlerTag(t, tag[1]));
|
|
101
|
+
if (index === -1)
|
|
102
|
+
return [...tags, tag];
|
|
103
|
+
return tags.map((t, i) => (i === index ? tag : t));
|
|
104
|
+
};
|
|
105
|
+
}
|
|
106
|
+
/**
|
|
107
|
+
* Moves or inserts an archetype-wide handler to the front so it becomes preferred
|
|
108
|
+
* @throws if the input is not a root or named napplet, or a kind 5129 snapshot
|
|
109
|
+
*/
|
|
110
|
+
export function preferNappletHandlerTag(input) {
|
|
111
|
+
const tag = createNappletHandlerTag(input);
|
|
112
|
+
return (tags) => {
|
|
113
|
+
const remaining = tags.filter((t) => !isHandlerTag(t, tag[1]));
|
|
114
|
+
return insertBefore(remaining, tag, (t) => t[0] === "a" || t[0] === "e");
|
|
115
|
+
};
|
|
116
|
+
}
|
|
117
|
+
/**
|
|
118
|
+
* Removes an archetype-wide handler
|
|
119
|
+
* @throws if the input is not a root or named napplet, or a kind 5129 snapshot
|
|
120
|
+
*/
|
|
121
|
+
export function removeNappletHandlerTag(input) {
|
|
122
|
+
const reference = getNappletHandlerReference(input);
|
|
123
|
+
return (tags) => tags.filter((t) => !isHandlerTag(t, reference));
|
|
124
|
+
}
|
|
125
|
+
/**
|
|
126
|
+
* Adds an intent-specific handler as the last fallback for a convention identity
|
|
127
|
+
* @throws if the identity is invalid, or the input is not a napplet or kind 5129 snapshot
|
|
128
|
+
*/
|
|
129
|
+
export function addNappletIntentHandlerTag(identity, input) {
|
|
130
|
+
assertConvention(identity);
|
|
131
|
+
const reference = getNappletHandlerReference(input);
|
|
132
|
+
return (tags) => {
|
|
133
|
+
if (tags.some((t) => isIntentTag(t, identity, reference)))
|
|
134
|
+
return tags;
|
|
135
|
+
return [...tags, ["i", identity, reference]];
|
|
136
|
+
};
|
|
137
|
+
}
|
|
138
|
+
/**
|
|
139
|
+
* Moves or inserts an intent-specific handler to the front so it becomes preferred for a convention identity
|
|
140
|
+
* @throws if the identity is invalid, or the input is not a napplet or kind 5129 snapshot
|
|
141
|
+
*/
|
|
142
|
+
export function preferNappletIntentHandlerTag(identity, input) {
|
|
143
|
+
assertConvention(identity);
|
|
144
|
+
const reference = getNappletHandlerReference(input);
|
|
145
|
+
return (tags) => {
|
|
146
|
+
const remaining = tags.filter((t) => !isIntentTag(t, identity, reference));
|
|
147
|
+
return insertBefore(remaining, ["i", identity, reference], (t) => isIntentTag(t, identity));
|
|
148
|
+
};
|
|
149
|
+
}
|
|
150
|
+
/**
|
|
151
|
+
* Removes one intent-specific handler, or every handler for the convention identity when no input is given
|
|
152
|
+
* @throws if the input is not a napplet or kind 5129 snapshot
|
|
153
|
+
*/
|
|
154
|
+
export function removeNappletIntentHandlerTag(identity, input) {
|
|
155
|
+
const reference = input === undefined ? undefined : getNappletHandlerReference(input);
|
|
156
|
+
return (tags) => tags.filter((t) => !isIntentTag(t, identity, reference));
|
|
157
|
+
}
|
|
158
|
+
/** Removes every `a`, `e`, and `i` handler entry while keeping the `d` tag and unknown tags */
|
|
159
|
+
export function clearNappletHandlerTags() {
|
|
160
|
+
return (tags) => tags.filter((t) => t[0] !== "a" && t[0] !== "e" && t[0] !== "i");
|
|
161
|
+
}
|
|
@@ -20,8 +20,8 @@ export function setSubject(subject) {
|
|
|
20
20
|
}
|
|
21
21
|
/** Makes the wrapped message a reply to the parent message */
|
|
22
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
|
|
23
|
+
if (typeof parent !== "string" && parent.kind !== kinds.PrivateDirectMessage && parent.kind !== kinds.FileMessage)
|
|
24
|
+
throw new Error("Parent must be a private direct message or file message");
|
|
25
25
|
const id = typeof parent === "string" ? parent : parent.id;
|
|
26
26
|
// TODO: support relay hints
|
|
27
27
|
return includeNameValueTag(["e", id]);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "applesauce-common",
|
|
3
|
-
"version": "7.
|
|
3
|
+
"version": "7.1.0",
|
|
4
4
|
"description": "Common NIP-specific helpers and models for applesauce",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -82,26 +82,22 @@
|
|
|
82
82
|
}
|
|
83
83
|
},
|
|
84
84
|
"dependencies": {
|
|
85
|
-
"@noble/hashes": "^2.
|
|
86
|
-
"@scure/base": "^2.
|
|
87
|
-
"applesauce-core": "^7.
|
|
85
|
+
"@noble/hashes": "^2.4.0",
|
|
86
|
+
"@scure/base": "^2.4.0",
|
|
87
|
+
"applesauce-core": "^7.1.0",
|
|
88
88
|
"hash-sum": "^2.0.0",
|
|
89
89
|
"light-bolt11-decoder": "^3.2.0",
|
|
90
|
-
"nanoid": "^
|
|
91
|
-
"rxjs": "^7.8.
|
|
90
|
+
"nanoid": "^6.0.2",
|
|
91
|
+
"rxjs": "^7.8.2"
|
|
92
92
|
},
|
|
93
93
|
"devDependencies": {
|
|
94
94
|
"@hirez_io/observer-spy": "^2.2.0",
|
|
95
|
-
"@nostrability/schemata": "^0.3.2",
|
|
96
95
|
"@types/hash-sum": "^1.0.2",
|
|
97
|
-
"@types/node": "^
|
|
98
|
-
"
|
|
99
|
-
"
|
|
100
|
-
"nostr-tools": "^2.25.2",
|
|
101
|
-
"rimraf": "^6.1.3",
|
|
96
|
+
"@types/node": "^26.6.6",
|
|
97
|
+
"nostr-tools": "^2.26.0",
|
|
98
|
+
"rimraf": "^6.1.4",
|
|
102
99
|
"typescript": "^7.0.2",
|
|
103
|
-
"vitest": "^
|
|
104
|
-
"yaml": "^2.9.1"
|
|
100
|
+
"vitest": "^5.1.0"
|
|
105
101
|
},
|
|
106
102
|
"funding": {
|
|
107
103
|
"type": "lightning",
|
|
@@ -111,7 +107,7 @@
|
|
|
111
107
|
"prebuild": "rimraf dist",
|
|
112
108
|
"build": "tsc",
|
|
113
109
|
"watch:build": "tsc --watch > /dev/null",
|
|
114
|
-
"test": "vitest run --passWithNoTests",
|
|
115
|
-
"watch:test": "vitest"
|
|
110
|
+
"test": "vitest run --config ../../vitest.config.mts --dir . --passWithNoTests",
|
|
111
|
+
"watch:test": "vitest --config ../../vitest.config.mts --dir ."
|
|
116
112
|
}
|
|
117
113
|
}
|