@nostrify/nostrify 0.46.7 → 0.46.9
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/.turbo/turbo-build.log +121 -2
- package/.turbo/turbo-setup.log +13 -0
- package/.turbo/turbo-test.log +91 -0
- package/BunkerURI.test.ts +19 -14
- package/CHANGELOG.md +16 -0
- package/NBrowserSigner.test.ts +49 -34
- package/NCache.test.ts +14 -7
- package/NCache.ts +2 -2
- package/NConnectSigner.test.ts +48 -31
- package/NConnectSigner.ts +3 -3
- package/NIP05.test.ts +36 -44
- package/NIP05.ts +6 -6
- package/NIP50.test.ts +35 -34
- package/NIP98.test.ts +89 -76
- package/NIP98.ts +2 -2
- package/NKinds.test.ts +37 -36
- package/NPool.test.ts +35 -24
- package/NPool.ts +42 -23
- package/NRelay1.test.ts +100 -68
- package/NRelay1.ts +13 -6
- package/NSchema.test.ts +98 -56
- package/NSchema.ts +74 -37
- package/NSecSigner.test.ts +19 -10
- package/NSecSigner.ts +4 -3
- package/NSet.test.ts +123 -50
- package/NSet.ts +13 -6
- package/RelayError.test.ts +11 -10
- package/RelayError.ts +1 -1
- package/dist/NCache.d.ts +2 -2
- package/dist/NCache.d.ts.map +1 -1
- package/dist/NConnectSigner.d.ts +1 -1
- package/dist/NConnectSigner.d.ts.map +1 -1
- package/dist/NIP05.d.ts +1 -1
- package/dist/NIP05.d.ts.map +1 -1
- package/dist/NIP98.d.ts +1 -1
- package/dist/NIP98.d.ts.map +1 -1
- package/dist/NPool.d.ts +2 -2
- package/dist/NPool.d.ts.map +1 -1
- package/dist/NRelay1.d.ts +5 -4
- package/dist/NRelay1.d.ts.map +1 -1
- package/dist/NSchema.d.ts +1 -1
- package/dist/NSchema.d.ts.map +1 -1
- package/dist/NSecSigner.d.ts +1 -2
- package/dist/NSecSigner.d.ts.map +1 -1
- package/dist/NSet.d.ts +1 -1
- package/dist/NSet.d.ts.map +1 -1
- package/dist/RelayError.d.ts +1 -1
- package/dist/RelayError.d.ts.map +1 -1
- package/dist/ln/LNURL.d.ts +4 -4
- package/dist/ln/LNURL.d.ts.map +1 -1
- package/dist/ln/mod.d.ts +3 -3
- package/dist/mod.d.ts +14 -14
- package/dist/test/ErrorRelay.d.ts +1 -1
- package/dist/test/ErrorRelay.d.ts.map +1 -1
- package/dist/test/MockRelay.d.ts +3 -3
- package/dist/test/MockRelay.d.ts.map +1 -1
- package/dist/test/TestRelayServer.d.ts +6 -3
- package/dist/test/TestRelayServer.d.ts.map +1 -1
- package/dist/test/mod.d.ts +3 -3
- package/dist/test/mod.d.ts.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/uploaders/BlossomUploader.d.ts +1 -1
- package/dist/uploaders/BlossomUploader.d.ts.map +1 -1
- package/dist/uploaders/NostrBuildUploader.d.ts +1 -2
- package/dist/uploaders/NostrBuildUploader.d.ts.map +1 -1
- package/dist/uploaders/mod.d.ts +2 -2
- package/dist/utils/CircularSet.d.ts +1 -1
- package/dist/utils/CircularSet.d.ts.map +1 -1
- package/dist/utils/N64.d.ts +1 -1
- package/dist/utils/N64.d.ts.map +1 -1
- package/dist/utils/mod.d.ts +2 -2
- package/ln/LNURL.test.ts +70 -52
- package/ln/LNURL.ts +15 -15
- package/ln/mod.ts +3 -3
- package/mod.ts +14 -14
- package/package.json +5 -3
- package/test/ErrorRelay.test.ts +11 -10
- package/test/ErrorRelay.ts +17 -5
- package/test/MockRelay.test.ts +15 -8
- package/test/MockRelay.ts +3 -3
- package/test/TestRelayServer.ts +46 -17
- package/test/mod.ts +4 -4
- package/tsconfig.json +5 -3
- package/uploaders/BlossomUploader.test.ts +39 -22
- package/uploaders/BlossomUploader.ts +2 -2
- package/uploaders/NostrBuildUploader.test.ts +36 -18
- package/uploaders/NostrBuildUploader.ts +4 -4
- package/uploaders/mod.ts +2 -2
- package/utils/CircularSet.test.ts +5 -4
- package/utils/CircularSet.ts +3 -1
- package/utils/Machina.test.ts +30 -19
- package/utils/N64.test.ts +12 -11
- package/utils/N64.ts +2 -2
- package/utils/mod.ts +2 -2
- package/dist/BunkerURI.js +0 -48
- package/dist/BunkerURI.js.map +0 -1
- package/dist/NBrowserSigner.js +0 -92
- package/dist/NBrowserSigner.js.map +0 -1
- package/dist/NCache.js +0 -60
- package/dist/NCache.js.map +0 -1
- package/dist/NConnectSigner.js +0 -125
- package/dist/NConnectSigner.js.map +0 -1
- package/dist/NIP05.js +0 -35
- package/dist/NIP05.js.map +0 -1
- package/dist/NIP50.js +0 -22
- package/dist/NIP50.js.map +0 -1
- package/dist/NIP98.js +0 -67
- package/dist/NIP98.js.map +0 -1
- package/dist/NKinds.js +0 -23
- package/dist/NKinds.js.map +0 -1
- package/dist/NPool.js +0 -181
- package/dist/NPool.js.map +0 -1
- package/dist/NRelay1.js +0 -332
- package/dist/NRelay1.js.map +0 -1
- package/dist/NSchema.js +0 -210
- package/dist/NSchema.js.map +0 -1
- package/dist/NSecSigner.js +0 -49
- package/dist/NSecSigner.js.map +0 -1
- package/dist/NSet.js +0 -171
- package/dist/NSet.js.map +0 -1
- package/dist/RelayError.js +0 -19
- package/dist/RelayError.js.map +0 -1
- package/dist/ln/LNURL.js +0 -101
- package/dist/ln/LNURL.js.map +0 -1
- package/dist/ln/mod.js +0 -2
- package/dist/ln/mod.js.map +0 -1
- package/dist/ln/types/LNURLCallback.js +0 -2
- package/dist/ln/types/LNURLCallback.js.map +0 -1
- package/dist/ln/types/LNURLDetails.js +0 -2
- package/dist/ln/types/LNURLDetails.js.map +0 -1
- package/dist/mod.js +0 -15
- package/dist/mod.js.map +0 -1
- package/dist/test/ErrorRelay.js +0 -22
- package/dist/test/ErrorRelay.js.map +0 -1
- package/dist/test/MockRelay.js +0 -62
- package/dist/test/MockRelay.js.map +0 -1
- package/dist/test/TestRelayServer.js +0 -130
- package/dist/test/TestRelayServer.js.map +0 -1
- package/dist/test/mod.js +0 -21
- package/dist/test/mod.js.map +0 -1
- package/dist/uploaders/BlossomUploader.js +0 -67
- package/dist/uploaders/BlossomUploader.js.map +0 -1
- package/dist/uploaders/NostrBuildUploader.js +0 -63
- package/dist/uploaders/NostrBuildUploader.js.map +0 -1
- package/dist/uploaders/mod.js +0 -3
- package/dist/uploaders/mod.js.map +0 -1
- package/dist/utils/CircularSet.js +0 -31
- package/dist/utils/CircularSet.js.map +0 -1
- package/dist/utils/Machina.js +0 -62
- package/dist/utils/Machina.js.map +0 -1
- package/dist/utils/N64.js +0 -19
- package/dist/utils/N64.js.map +0 -1
- package/dist/utils/mod.js +0 -3
- package/dist/utils/mod.js.map +0 -1
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,5 +1,124 @@
|
|
|
1
1
|
|
|
2
2
|
|
|
3
|
-
> @nostrify/nostrify@0.46.
|
|
4
|
-
> tsc -p tsconfig.json
|
|
3
|
+
> @nostrify/nostrify@0.46.8 build /home/sid/repos/nostrify/packages/nostrify
|
|
4
|
+
> tsc -p tsconfig.json && node ../../esbuild.config.js --package ./
|
|
5
5
|
|
|
6
|
+
[96mNIP05.ts[0m:[93m18[0m:[93m5[0m - [91merror[0m[90m TS2322: [0mType 'ZodObject<{ pubkey: ZodString; relays: ZodOptional<ZodArray<ZodType<`ws://${string}` | `wss://${string}`, ZodTypeDef, `ws://${string}` | `wss://${string}`>, "many">>; }, "strip", ZodTypeAny, { ...; }, { ...; }>' is not assignable to type 'ZodType<NProfilePointer, ZodTypeDef, NProfilePointer>'.
|
|
7
|
+
Types of property '_type' are incompatible.
|
|
8
|
+
Type '{ pubkey?: string; relays?: (`ws://${string}` | `wss://${string}`)[]; }' is not assignable to type 'NProfilePointer'.
|
|
9
|
+
Property 'pubkey' is optional in type '{ pubkey?: string; relays?: (`ws://${string}` | `wss://${string}`)[]; }' but required in type 'NProfilePointer'.
|
|
10
|
+
|
|
11
|
+
[7m18[0m return z.object({
|
|
12
|
+
[7m [0m [91m ~~~~~~[0m
|
|
13
|
+
|
|
14
|
+
[96mNSchema.ts[0m:[93m45[0m:[93m5[0m - [91merror[0m[90m TS2322: [0mType 'ZodObject<{ id: ZodString; kind: ZodNumber; pubkey: ZodString; tags: ZodArray<ZodArray<ZodString, "many">, "many">; content: ZodString; created_at: ZodNumber; sig: ZodString; }, "strip", ZodTypeAny, { ...; }, { ...; }>' is not assignable to type 'ZodType<NostrEvent, ZodTypeDef, NostrEvent>'.
|
|
15
|
+
Types of property '_type' are incompatible.
|
|
16
|
+
Type '{ pubkey?: string; tags?: string[][]; id?: string; sig?: string; created_at?: number; kind?: number; content?: string; }' is not assignable to type 'NostrEvent'.
|
|
17
|
+
Property 'id' is optional in type '{ pubkey?: string; tags?: string[][]; id?: string; sig?: string; created_at?: number; kind?: number; content?: string; }' but required in type 'NostrEvent'.
|
|
18
|
+
|
|
19
|
+
[7m45[0m return z.object({
|
|
20
|
+
[7m [0m [91m ~~~~~~[0m
|
|
21
|
+
|
|
22
|
+
[96mNSchema.ts[0m:[93m108[0m:[93m5[0m - [91merror[0m[90m TS2322: [0mType 'ZodTuple<[ZodLiteral<"EVENT">, ZodType<NostrEvent, ZodTypeDef, NostrEvent>], null>' is not assignable to type 'ZodType<NostrClientEVENT, ZodTypeDef, NostrClientEVENT>'.
|
|
23
|
+
Types of property '_type' are incompatible.
|
|
24
|
+
Type '["EVENT", NostrEvent, ...unknown[]]' is not assignable to type 'NostrClientEVENT'.
|
|
25
|
+
Target allows only 2 element(s) but source may have more.
|
|
26
|
+
|
|
27
|
+
[7m108[0m return z.tuple([z.literal('EVENT'), NSchema.event()]);
|
|
28
|
+
[7m [0m [91m ~~~~~~[0m
|
|
29
|
+
|
|
30
|
+
[96mNSchema.ts[0m:[93m123[0m:[93m5[0m - [91merror[0m[90m TS2322: [0mType 'ZodTuple<[ZodLiteral<"CLOSE">, ZodString], null>' is not assignable to type 'ZodType<NostrClientCLOSE, ZodTypeDef, NostrClientCLOSE>'.
|
|
31
|
+
Types of property '_type' are incompatible.
|
|
32
|
+
Type '["CLOSE", string, ...unknown[]]' is not assignable to type 'NostrClientCLOSE'.
|
|
33
|
+
Target allows only 2 element(s) but source may have more.
|
|
34
|
+
|
|
35
|
+
[7m123[0m return z.tuple([z.literal('CLOSE'), z.string()]);
|
|
36
|
+
[7m [0m [91m ~~~~~~[0m
|
|
37
|
+
|
|
38
|
+
[96mNSchema.ts[0m:[93m128[0m:[93m5[0m - [91merror[0m[90m TS2322: [0mType 'ZodTuple<[ZodLiteral<"AUTH">, ZodType<NostrEvent, ZodTypeDef, NostrEvent>], null>' is not assignable to type 'ZodType<NostrClientAUTH, ZodTypeDef, NostrClientAUTH>'.
|
|
39
|
+
Types of property '_type' are incompatible.
|
|
40
|
+
Type '["AUTH", NostrEvent, ...unknown[]]' is not assignable to type 'NostrClientAUTH'.
|
|
41
|
+
Target allows only 2 element(s) but source may have more.
|
|
42
|
+
|
|
43
|
+
[7m128[0m return z.tuple([z.literal('AUTH'), NSchema.event()]);
|
|
44
|
+
[7m [0m [91m ~~~~~~[0m
|
|
45
|
+
|
|
46
|
+
[96mNSchema.ts[0m:[93m144[0m:[93m5[0m - [91merror[0m[90m TS2322: [0mType 'ZodTuple<[ZodLiteral<"EVENT">, ZodString, ZodType<NostrEvent, ZodTypeDef, NostrEvent>], null>' is not assignable to type 'ZodType<NostrRelayEVENT, ZodTypeDef, NostrRelayEVENT>'.
|
|
47
|
+
Types of property '_type' are incompatible.
|
|
48
|
+
Type '["EVENT", string, NostrEvent, ...unknown[]]' is not assignable to type 'NostrRelayEVENT'.
|
|
49
|
+
Target allows only 3 element(s) but source may have more.
|
|
50
|
+
|
|
51
|
+
[7m144[0m return z.tuple([z.literal('EVENT'), z.string(), NSchema.event()]);
|
|
52
|
+
[7m [0m [91m ~~~~~~[0m
|
|
53
|
+
|
|
54
|
+
[96mNSchema.ts[0m:[93m149[0m:[93m5[0m - [91merror[0m[90m TS2322: [0mType 'ZodTuple<[ZodLiteral<"OK">, ZodString, ZodBoolean, ZodString], null>' is not assignable to type 'ZodType<NostrRelayOK, ZodTypeDef, NostrRelayOK>'.
|
|
55
|
+
Types of property '_type' are incompatible.
|
|
56
|
+
Type '["OK", string, boolean, string, ...unknown[]]' is not assignable to type 'NostrRelayOK'.
|
|
57
|
+
Target allows only 4 element(s) but source may have more.
|
|
58
|
+
|
|
59
|
+
[7m149[0m return z.tuple([z.literal('OK'), NSchema.id(), z.boolean(), z.string()]);
|
|
60
|
+
[7m [0m [91m ~~~~~~[0m
|
|
61
|
+
|
|
62
|
+
[96mNSchema.ts[0m:[93m154[0m:[93m5[0m - [91merror[0m[90m TS2322: [0mType 'ZodTuple<[ZodLiteral<"EOSE">, ZodString], null>' is not assignable to type 'ZodType<NostrRelayEOSE, ZodTypeDef, NostrRelayEOSE>'.
|
|
63
|
+
Types of property '_type' are incompatible.
|
|
64
|
+
Type '["EOSE", string, ...unknown[]]' is not assignable to type 'NostrRelayEOSE'.
|
|
65
|
+
Target allows only 2 element(s) but source may have more.
|
|
66
|
+
|
|
67
|
+
[7m154[0m return z.tuple([z.literal('EOSE'), z.string()]);
|
|
68
|
+
[7m [0m [91m ~~~~~~[0m
|
|
69
|
+
|
|
70
|
+
[96mNSchema.ts[0m:[93m159[0m:[93m5[0m - [91merror[0m[90m TS2322: [0mType 'ZodTuple<[ZodLiteral<"NOTICE">, ZodString], null>' is not assignable to type 'ZodType<NostrRelayNOTICE, ZodTypeDef, NostrRelayNOTICE>'.
|
|
71
|
+
Types of property '_type' are incompatible.
|
|
72
|
+
Type '["NOTICE", string, ...unknown[]]' is not assignable to type 'NostrRelayNOTICE'.
|
|
73
|
+
Target allows only 2 element(s) but source may have more.
|
|
74
|
+
|
|
75
|
+
[7m159[0m return z.tuple([z.literal('NOTICE'), z.string()]);
|
|
76
|
+
[7m [0m [91m ~~~~~~[0m
|
|
77
|
+
|
|
78
|
+
[96mNSchema.ts[0m:[93m164[0m:[93m5[0m - [91merror[0m[90m TS2322: [0mType 'ZodTuple<[ZodLiteral<"CLOSED">, ZodString, ZodString], null>' is not assignable to type 'ZodType<NostrRelayCLOSED, ZodTypeDef, NostrRelayCLOSED>'.
|
|
79
|
+
Types of property '_type' are incompatible.
|
|
80
|
+
Type '["CLOSED", string, string, ...unknown[]]' is not assignable to type 'NostrRelayCLOSED'.
|
|
81
|
+
Target allows only 3 element(s) but source may have more.
|
|
82
|
+
|
|
83
|
+
[7m164[0m return z.tuple([z.literal('CLOSED'), z.string(), z.string()]);
|
|
84
|
+
[7m [0m [91m ~~~~~~[0m
|
|
85
|
+
|
|
86
|
+
[96mNSchema.ts[0m:[93m169[0m:[93m5[0m - [91merror[0m[90m TS2322: [0mType 'ZodTuple<[ZodLiteral<"AUTH">, ZodString], null>' is not assignable to type 'ZodType<NostrRelayAUTH, ZodTypeDef, NostrRelayAUTH>'.
|
|
87
|
+
Types of property '_type' are incompatible.
|
|
88
|
+
Type '["AUTH", string, ...unknown[]]' is not assignable to type 'NostrRelayAUTH'.
|
|
89
|
+
Target allows only 2 element(s) but source may have more.
|
|
90
|
+
|
|
91
|
+
[7m169[0m return z.tuple([z.literal('AUTH'), z.string()]);
|
|
92
|
+
[7m [0m [91m ~~~~~~[0m
|
|
93
|
+
|
|
94
|
+
[96mNSchema.ts[0m:[93m174[0m:[93m5[0m - [91merror[0m[90m TS2322: [0mType 'ZodTuple<[ZodLiteral<"COUNT">, ZodString, ZodObject<{ count: ZodNumber; approximate: ZodOptional<ZodBoolean>; }, "strip", ZodTypeAny, { ...; }, { ...; }>], null>' is not assignable to type 'ZodType<NostrRelayCOUNT, ZodTypeDef, NostrRelayCOUNT>'.
|
|
95
|
+
Types of property '_type' are incompatible.
|
|
96
|
+
Type '["COUNT", string, { count?: number; approximate?: boolean; }, ...unknown[]]' is not assignable to type 'NostrRelayCOUNT'.
|
|
97
|
+
Target allows only 3 element(s) but source may have more.
|
|
98
|
+
|
|
99
|
+
[7m174[0m return z.tuple([
|
|
100
|
+
[7m [0m [91m ~~~~~~[0m
|
|
101
|
+
|
|
102
|
+
[96mNSchema.ts[0m:[93m215[0m:[93m5[0m - [91merror[0m[90m TS2322: [0mType 'ZodObject<{ id: ZodString; method: ZodString; params: ZodArray<ZodString, "many">; }, "strip", ZodTypeAny, { id?: string; params?: string[]; method?: string; }, { ...; }>' is not assignable to type 'ZodType<NostrConnectRequest, ZodTypeDef, NostrConnectRequest>'.
|
|
103
|
+
Types of property '_type' are incompatible.
|
|
104
|
+
Type '{ id?: string; params?: string[]; method?: string; }' is not assignable to type 'NostrConnectRequest'.
|
|
105
|
+
Property 'id' is optional in type '{ id?: string; params?: string[]; method?: string; }' but required in type 'NostrConnectRequest'.
|
|
106
|
+
|
|
107
|
+
[7m215[0m return z.object({
|
|
108
|
+
[7m [0m [91m ~~~~~~[0m
|
|
109
|
+
|
|
110
|
+
[96mNSchema.ts[0m:[93m224[0m:[93m5[0m - [91merror[0m[90m TS2322: [0mType 'ZodObject<{ id: ZodString; result: ZodString; error: ZodOptional<ZodString>; }, "strip", ZodTypeAny, { id?: string; result?: string; error?: string; }, { ...; }>' is not assignable to type 'ZodType<NostrConnectResponse, ZodTypeDef, NostrConnectResponse>'.
|
|
111
|
+
Types of property '_type' are incompatible.
|
|
112
|
+
Type '{ id?: string; result?: string; error?: string; }' is not assignable to type 'NostrConnectResponse'.
|
|
113
|
+
Property 'id' is optional in type '{ id?: string; result?: string; error?: string; }' but required in type 'NostrConnectResponse'.
|
|
114
|
+
|
|
115
|
+
[7m224[0m return z.object({
|
|
116
|
+
[7m [0m [91m ~~~~~~[0m
|
|
117
|
+
|
|
118
|
+
|
|
119
|
+
Found 14 errors in 2 files.
|
|
120
|
+
|
|
121
|
+
Errors Files
|
|
122
|
+
1 NIP05.ts[90m:18[0m
|
|
123
|
+
13 NSchema.ts[90m:45[0m
|
|
124
|
+
[41m[30m ELIFECYCLE [39m[49m [31mCommand failed with exit code 2.[39m
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
|
|
2
|
+
|
|
3
|
+
> @nostrify/nostrify@0.46.7 setup /home/sid/repos/nostrify/packages/nostrify
|
|
4
|
+
> pnpm i
|
|
5
|
+
|
|
6
|
+
(node:1234099) [DEP0169] DeprecationWarning: `url.parse()` behavior is not standardized and prone to errors that have security implications. Use the WHATWG URL API instead. CVEs are not issued for `url.parse()` vulnerabilities.
|
|
7
|
+
(Use `node --trace-deprecation ...` to show where the warning was created)
|
|
8
|
+
Scope: all 9 workspace projects
|
|
9
|
+
../.. | Progress: resolved [96m1[39m, reused [96m0[39m, downloaded [96m0[39m, added [96m0[39m
|
|
10
|
+
[1A../.. | [32m+1[39m [32m+[39m[0K
|
|
11
|
+
../.. | Progress: resolved [96m1[39m, reused [96m0[39m, downloaded [96m0[39m, added [96m0[39m
|
|
12
|
+
[1A../.. | Progress: resolved [96m1[39m, reused [96m1[39m, downloaded [96m0[39m, added [96m0[39m
|
|
13
|
+
[1A../.. | Progress: resolved [96m1[39m, reused [96m1[39m, downloaded [96m0[39m, added [96m0[39m, done
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
|
|
2
|
+
|
|
3
|
+
> @nostrify/nostrify@0.46.8 test /home/sid/repos/nostrify/packages/nostrify
|
|
4
|
+
> node --test "**/*.test.ts"
|
|
5
|
+
|
|
6
|
+
✔ BunkerURI (2.901722ms)
|
|
7
|
+
✔ BunkerURI.fromJSON (0.681727ms)
|
|
8
|
+
✔ NBrowserSigner - without extension (2.955361ms)
|
|
9
|
+
✔ NBrowserSigner - with extension polyfill (142.479686ms)
|
|
10
|
+
✔ NBrowserSigner.nip44 - with extension polyfill (63.176698ms)
|
|
11
|
+
✔ NBrowserSigner.nip04 - with extension polyfill (94.046199ms)
|
|
12
|
+
✔ NBrowserSigner.getRelays - with extension polyfill (1.225726ms)
|
|
13
|
+
✔ NBrowserSigner - missing nip44 support (0.470316ms)
|
|
14
|
+
✔ NBrowserSigner - missing nip04 support (0.596869ms)
|
|
15
|
+
✔ NBrowserSigner - feature detection (0.692134ms)
|
|
16
|
+
✔ NCache (4.463457ms)
|
|
17
|
+
✔ NConnectSigner.signEvent with nip04 encryption (264.497854ms)
|
|
18
|
+
✔ NConnectSigner.signEvent with nip44 encryption (151.108865ms)
|
|
19
|
+
✔ NIP05.lookup (82.449297ms)
|
|
20
|
+
✔ NIP05.lookup with invalid values but valid profile pointer (5.343535ms)
|
|
21
|
+
✔ NIP05.lookup with invalid document (5.910931ms)
|
|
22
|
+
✔ NIP50.parseInput (6.388441ms)
|
|
23
|
+
✔ NIP50.parseInput with negated token (0.443007ms)
|
|
24
|
+
✔ NIP98.template (3.769298ms)
|
|
25
|
+
✔ NIP98.template with payload (18.668676ms)
|
|
26
|
+
✔ NIP98.verify (102.562862ms)
|
|
27
|
+
✔ NIP98.verify fails with missing header (4.419038ms)
|
|
28
|
+
✔ NIP98.verify fails with missing token (2.752191ms)
|
|
29
|
+
✔ NIP98.verify fails with invalid token (4.587427ms)
|
|
30
|
+
✔ NIP98.verify fails with invalid event (16.989187ms)
|
|
31
|
+
✔ NIP98.verify fails with wrong event kind (40.621459ms)
|
|
32
|
+
✔ NIP98.verify fails with wrong request URL (41.071101ms)
|
|
33
|
+
✔ NIP98.verify fails with wrong request method (62.625645ms)
|
|
34
|
+
✔ NIP98.verify fails with expired event (20.760162ms)
|
|
35
|
+
✔ NIP98.verify fails with invalid payload (51.97091ms)
|
|
36
|
+
✔ NKinds (3.308412ms)
|
|
37
|
+
✔ NPool.query (368.093259ms)
|
|
38
|
+
✔ NPool.req (266.969001ms)
|
|
39
|
+
✔ NPool.event (232.161184ms)
|
|
40
|
+
✔ NRelay1.query (280.362725ms)
|
|
41
|
+
✔ NRelay1.query mismatched filter (245.542477ms)
|
|
42
|
+
✔ NRelay1.req (247.658198ms)
|
|
43
|
+
✔ NRelay1.event (216.357493ms)
|
|
44
|
+
﹣ NRelay1 backoff (0.334682ms) # SKIP
|
|
45
|
+
▶ NRelay1 idleTimeout
|
|
46
|
+
✔ websocket opens (40.531572ms)
|
|
47
|
+
✔ websocket closes after idleTimeout (150.405626ms)
|
|
48
|
+
✔ websocket wakes up during activity (14.544161ms)
|
|
49
|
+
✔ NRelay1 idleTimeout (209.795356ms)
|
|
50
|
+
✔ NRelay1.count rejects when the server sends CLOSED (6.440892ms)
|
|
51
|
+
✔ NRelay1 closes when it receives a binary message (5.03225ms)
|
|
52
|
+
✔ n.id (3.950608ms)
|
|
53
|
+
✔ n.bech32 (1.817636ms)
|
|
54
|
+
✔ n.filter (10.95275ms)
|
|
55
|
+
✔ n.event (2.561941ms)
|
|
56
|
+
✔ n.metadata (11.862022ms)
|
|
57
|
+
✔ NSecSigner (178.164717ms)
|
|
58
|
+
✔ NSecSigner.nip44 (31.935079ms)
|
|
59
|
+
✔ NSet (19.978352ms)
|
|
60
|
+
✔ NSet.add (replaceable) (0.615308ms)
|
|
61
|
+
✔ NSet.add (parameterized) (0.985888ms)
|
|
62
|
+
✔ NSet.add (deletion) (0.380918ms)
|
|
63
|
+
✔ Construct a RelayError from the reason message (1.717692ms)
|
|
64
|
+
✔ Throw a new RelayError if the OK message is false (0.750801ms)
|
|
65
|
+
✔ LNURL.fromString (7.817616ms)
|
|
66
|
+
✔ LNURL.fromLightningAddress (0.932529ms)
|
|
67
|
+
✔ LNURL.toString (1.933713ms)
|
|
68
|
+
✔ LNURL.getDetails (111.66131ms)
|
|
69
|
+
✔ LNURL.getInvoice (13.562812ms)
|
|
70
|
+
✔ ErrorRelay (112.209428ms)
|
|
71
|
+
✔ MockRelay (3.019126ms)
|
|
72
|
+
﹣ BlossomUploader.upload (1.127947ms) # SKIP
|
|
73
|
+
﹣ NostrBuildUploader.upload (2.842008ms) # SKIP
|
|
74
|
+
✔ CircularSet (2.247513ms)
|
|
75
|
+
✔ push, iterate, & close (103.751782ms)
|
|
76
|
+
✔ close & reopen (0.982257ms)
|
|
77
|
+
✔ aborts with signal (51.656203ms)
|
|
78
|
+
✔ already aborted signal in constructor (1.251916ms)
|
|
79
|
+
✔ push after abort (0.906129ms)
|
|
80
|
+
✔ multiple messages in queue (0.531637ms)
|
|
81
|
+
✔ N64 (8.171994ms)
|
|
82
|
+
✔ N64.encodeEvent (0.513338ms)
|
|
83
|
+
✔ N64.decodeEvent (1.449988ms)
|
|
84
|
+
ℹ tests 77
|
|
85
|
+
ℹ suites 0
|
|
86
|
+
ℹ pass 74
|
|
87
|
+
ℹ fail 0
|
|
88
|
+
ℹ cancelled 0
|
|
89
|
+
ℹ skipped 3
|
|
90
|
+
ℹ todo 0
|
|
91
|
+
ℹ duration_ms 2192.909865
|
package/BunkerURI.test.ts
CHANGED
|
@@ -1,28 +1,33 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { test } from "node:test";
|
|
2
|
+
import { deepStrictEqual } from "node:assert";
|
|
2
3
|
|
|
3
|
-
import { BunkerURI } from
|
|
4
|
+
import { BunkerURI } from "./BunkerURI.ts";
|
|
4
5
|
|
|
5
|
-
|
|
6
|
+
await test("BunkerURI", () => {
|
|
6
7
|
const uri = new BunkerURI(
|
|
7
|
-
|
|
8
|
+
"bunker://79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798?relay=wss%3A%2F%2Fditto.pub%2Frelay&secret=piAuZsxgKlil",
|
|
8
9
|
);
|
|
9
10
|
|
|
10
|
-
|
|
11
|
-
pubkey:
|
|
12
|
-
relays:
|
|
13
|
-
secret:
|
|
11
|
+
deepStrictEqual({
|
|
12
|
+
pubkey: uri.pubkey,
|
|
13
|
+
relays: uri.relays,
|
|
14
|
+
secret: uri.secret,
|
|
15
|
+
}, {
|
|
16
|
+
pubkey: "79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798",
|
|
17
|
+
relays: ["wss://ditto.pub/relay"],
|
|
18
|
+
secret: "piAuZsxgKlil",
|
|
14
19
|
});
|
|
15
20
|
});
|
|
16
21
|
|
|
17
|
-
|
|
22
|
+
await test("BunkerURI.fromJSON", () => {
|
|
18
23
|
const result = BunkerURI.fromJSON({
|
|
19
|
-
pubkey:
|
|
20
|
-
relays: [
|
|
21
|
-
secret:
|
|
24
|
+
pubkey: "79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798",
|
|
25
|
+
relays: ["wss://ditto.pub/relay"],
|
|
26
|
+
secret: "piAuZsxgKlil",
|
|
22
27
|
});
|
|
23
28
|
|
|
24
29
|
const expected =
|
|
25
|
-
|
|
30
|
+
"bunker://79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798?relay=wss%3A%2F%2Fditto.pub%2Frelay&secret=piAuZsxgKlil";
|
|
26
31
|
|
|
27
|
-
|
|
32
|
+
deepStrictEqual(result.toString(), expected);
|
|
28
33
|
});
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,21 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.46.9
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- tests should pass now
|
|
8
|
+
- Updated dependencies
|
|
9
|
+
- @nostrify/types@0.36.5
|
|
10
|
+
|
|
11
|
+
## 0.46.8
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- Get tests passing in CI, use esbuild to build final JS files
|
|
16
|
+
- Updated dependencies
|
|
17
|
+
- @nostrify/types@0.36.4
|
|
18
|
+
|
|
3
19
|
## 0.46.7
|
|
4
20
|
|
|
5
21
|
### Patch Changes
|
package/NBrowserSigner.test.ts
CHANGED
|
@@ -1,31 +1,38 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import { test } from "node:test";
|
|
2
|
+
import { NSecSigner } from "@nostrify/nostrify";
|
|
3
|
+
import { deepStrictEqual, rejects } from "node:assert";
|
|
4
|
+
import { finalizeEvent, generateSecretKey, getPublicKey } from "nostr-tools";
|
|
4
5
|
|
|
5
|
-
import { NBrowserSigner } from
|
|
6
|
+
import { NBrowserSigner } from "./NBrowserSigner.ts";
|
|
6
7
|
|
|
7
|
-
import type { NostrEvent, NostrSigner } from
|
|
8
|
+
import type { NostrEvent, NostrSigner } from "@nostrify/types";
|
|
8
9
|
|
|
9
|
-
|
|
10
|
+
await test("NBrowserSigner - without extension", async () => {
|
|
10
11
|
// Ensure no extension is available
|
|
11
12
|
(globalThis as { nostr?: NostrSigner }).nostr = undefined;
|
|
12
13
|
|
|
13
14
|
const signer = new NBrowserSigner();
|
|
14
15
|
|
|
15
|
-
await
|
|
16
|
+
await rejects(
|
|
16
17
|
() => signer.getPublicKey(),
|
|
17
18
|
Error,
|
|
18
|
-
|
|
19
|
+
"Browser extension not available",
|
|
19
20
|
);
|
|
20
21
|
|
|
21
|
-
await
|
|
22
|
-
() =>
|
|
22
|
+
await rejects(
|
|
23
|
+
() =>
|
|
24
|
+
signer.signEvent({
|
|
25
|
+
kind: 1,
|
|
26
|
+
content: "Hello, world!",
|
|
27
|
+
tags: [],
|
|
28
|
+
created_at: 0,
|
|
29
|
+
}),
|
|
23
30
|
Error,
|
|
24
|
-
|
|
31
|
+
"Browser extension not available",
|
|
25
32
|
);
|
|
26
33
|
});
|
|
27
34
|
|
|
28
|
-
|
|
35
|
+
await test("NBrowserSigner - with extension polyfill", async () => {
|
|
29
36
|
const secretKey = generateSecretKey();
|
|
30
37
|
const mockExtension = new NSecSigner(secretKey);
|
|
31
38
|
|
|
@@ -35,17 +42,25 @@ Deno.test('NBrowserSigner - with extension polyfill', async () => {
|
|
|
35
42
|
const signer = new NBrowserSigner();
|
|
36
43
|
|
|
37
44
|
// Test getPublicKey
|
|
38
|
-
|
|
45
|
+
deepStrictEqual(await signer.getPublicKey(), getPublicKey(secretKey));
|
|
39
46
|
|
|
40
47
|
// Test signEvent
|
|
41
|
-
const template = {
|
|
42
|
-
|
|
48
|
+
const template = {
|
|
49
|
+
kind: 1,
|
|
50
|
+
content: "Hello, world!",
|
|
51
|
+
tags: [],
|
|
52
|
+
created_at: 0,
|
|
53
|
+
};
|
|
54
|
+
deepStrictEqual(
|
|
55
|
+
await signer.signEvent(template),
|
|
56
|
+
finalizeEvent(template, secretKey),
|
|
57
|
+
);
|
|
43
58
|
|
|
44
59
|
// Clean up
|
|
45
60
|
(globalThis as { nostr?: NostrSigner }).nostr = undefined;
|
|
46
61
|
});
|
|
47
62
|
|
|
48
|
-
|
|
63
|
+
await test("NBrowserSigner.nip44 - with extension polyfill", async () => {
|
|
49
64
|
const secretKey = generateSecretKey();
|
|
50
65
|
const mockExtension = new NSecSigner(secretKey);
|
|
51
66
|
|
|
@@ -55,16 +70,16 @@ Deno.test('NBrowserSigner.nip44 - with extension polyfill', async () => {
|
|
|
55
70
|
const signer = new NBrowserSigner();
|
|
56
71
|
|
|
57
72
|
const pubkey = await signer.getPublicKey();
|
|
58
|
-
const plaintext =
|
|
73
|
+
const plaintext = "Hello, world!";
|
|
59
74
|
|
|
60
75
|
const ciphertext = await signer.nip44!.encrypt(pubkey, plaintext);
|
|
61
|
-
|
|
76
|
+
deepStrictEqual(await signer.nip44!.decrypt(pubkey, ciphertext), plaintext);
|
|
62
77
|
|
|
63
78
|
// Clean up
|
|
64
79
|
(globalThis as { nostr?: NostrSigner }).nostr = undefined;
|
|
65
80
|
});
|
|
66
81
|
|
|
67
|
-
|
|
82
|
+
await test("NBrowserSigner.nip04 - with extension polyfill", async () => {
|
|
68
83
|
const secretKey = generateSecretKey();
|
|
69
84
|
const mockExtension = new NSecSigner(secretKey);
|
|
70
85
|
|
|
@@ -74,16 +89,16 @@ Deno.test('NBrowserSigner.nip04 - with extension polyfill', async () => {
|
|
|
74
89
|
const signer = new NBrowserSigner();
|
|
75
90
|
|
|
76
91
|
const pubkey = await signer.getPublicKey();
|
|
77
|
-
const plaintext =
|
|
92
|
+
const plaintext = "Hello, world!";
|
|
78
93
|
|
|
79
94
|
const ciphertext = await signer.nip04!.encrypt(pubkey, plaintext);
|
|
80
|
-
|
|
95
|
+
deepStrictEqual(await signer.nip04!.decrypt(pubkey, ciphertext), plaintext);
|
|
81
96
|
|
|
82
97
|
// Clean up
|
|
83
98
|
(globalThis as { nostr?: NostrSigner }).nostr = undefined;
|
|
84
99
|
});
|
|
85
100
|
|
|
86
|
-
|
|
101
|
+
await test("NBrowserSigner.getRelays - with extension polyfill", async () => {
|
|
87
102
|
const secretKey = generateSecretKey();
|
|
88
103
|
const mockExtension = new NSecSigner(secretKey);
|
|
89
104
|
|
|
@@ -94,17 +109,17 @@ Deno.test('NBrowserSigner.getRelays - with extension polyfill', async () => {
|
|
|
94
109
|
|
|
95
110
|
// Since NSecSigner doesn't implement getRelays, this should return empty object
|
|
96
111
|
const relays = await signer.getRelays();
|
|
97
|
-
|
|
112
|
+
deepStrictEqual(relays, {});
|
|
98
113
|
|
|
99
114
|
// Clean up
|
|
100
115
|
(globalThis as { nostr?: NostrSigner }).nostr = undefined;
|
|
101
116
|
});
|
|
102
117
|
|
|
103
|
-
|
|
118
|
+
await test("NBrowserSigner - missing nip44 support", () => {
|
|
104
119
|
// Create a mock extension without nip44 support
|
|
105
120
|
const mockExtension = {
|
|
106
121
|
// deno-lint-ignore require-await
|
|
107
|
-
getPublicKey: async () =>
|
|
122
|
+
getPublicKey: async () => "pubkey",
|
|
108
123
|
// deno-lint-ignore require-await
|
|
109
124
|
signEvent: async (event: NostrEvent) => event,
|
|
110
125
|
// No nip44 property
|
|
@@ -115,17 +130,17 @@ Deno.test('NBrowserSigner - missing nip44 support', () => {
|
|
|
115
130
|
const signer = new NBrowserSigner();
|
|
116
131
|
|
|
117
132
|
// Should return undefined when nip44 is not supported
|
|
118
|
-
|
|
133
|
+
deepStrictEqual(signer.nip44, undefined);
|
|
119
134
|
|
|
120
135
|
// Clean up
|
|
121
136
|
(globalThis as { nostr?: NostrSigner }).nostr = undefined;
|
|
122
137
|
});
|
|
123
138
|
|
|
124
|
-
|
|
139
|
+
await test("NBrowserSigner - missing nip04 support", () => {
|
|
125
140
|
// Create a mock extension without nip04 support
|
|
126
141
|
const mockExtension = {
|
|
127
142
|
// deno-lint-ignore require-await
|
|
128
|
-
getPublicKey: async () =>
|
|
143
|
+
getPublicKey: async () => "pubkey",
|
|
129
144
|
// deno-lint-ignore require-await
|
|
130
145
|
signEvent: async (event: NostrEvent) => event,
|
|
131
146
|
// No nip04 property
|
|
@@ -136,13 +151,13 @@ Deno.test('NBrowserSigner - missing nip04 support', () => {
|
|
|
136
151
|
const signer = new NBrowserSigner();
|
|
137
152
|
|
|
138
153
|
// Should return undefined when nip04 is not supported
|
|
139
|
-
|
|
154
|
+
deepStrictEqual(signer.nip04, undefined);
|
|
140
155
|
|
|
141
156
|
// Clean up
|
|
142
157
|
(globalThis as { nostr?: NostrSigner }).nostr = undefined;
|
|
143
158
|
});
|
|
144
159
|
|
|
145
|
-
|
|
160
|
+
await test("NBrowserSigner - feature detection", () => {
|
|
146
161
|
const secretKey = generateSecretKey();
|
|
147
162
|
const mockExtension = new NSecSigner(secretKey);
|
|
148
163
|
|
|
@@ -154,15 +169,15 @@ Deno.test('NBrowserSigner - feature detection', () => {
|
|
|
154
169
|
// Should be able to detect nip44 support
|
|
155
170
|
if (signer.nip44) {
|
|
156
171
|
// This should work since NSecSigner supports nip44
|
|
157
|
-
|
|
158
|
-
|
|
172
|
+
deepStrictEqual(typeof signer.nip44.encrypt, "function");
|
|
173
|
+
deepStrictEqual(typeof signer.nip44.decrypt, "function");
|
|
159
174
|
}
|
|
160
175
|
|
|
161
176
|
// Should be able to detect nip04 support
|
|
162
177
|
if (signer.nip04) {
|
|
163
178
|
// This should work since NSecSigner supports nip04
|
|
164
|
-
|
|
165
|
-
|
|
179
|
+
deepStrictEqual(typeof signer.nip04.encrypt, "function");
|
|
180
|
+
deepStrictEqual(typeof signer.nip04.decrypt, "function");
|
|
166
181
|
}
|
|
167
182
|
|
|
168
183
|
// Clean up
|
package/NCache.test.ts
CHANGED
|
@@ -1,22 +1,29 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { test } from "node:test";
|
|
2
|
+
import { deepStrictEqual } from "node:assert";
|
|
2
3
|
|
|
3
|
-
import { NCache } from
|
|
4
|
+
import { NCache } from "./NCache.ts";
|
|
4
5
|
|
|
5
|
-
import event1 from
|
|
6
|
+
import event1 from "../../fixtures/event-1.json" with { type: "json" };
|
|
6
7
|
|
|
7
|
-
|
|
8
|
+
await test("NCache", async () => {
|
|
8
9
|
const cache = new NCache({
|
|
9
10
|
max: 3000,
|
|
10
11
|
maxEntrySize: 5000,
|
|
11
12
|
sizeCalculation: (event) => JSON.stringify(event).length,
|
|
12
13
|
});
|
|
13
14
|
|
|
14
|
-
|
|
15
|
+
deepStrictEqual(await cache.count([{ ids: [event1.id] }]), {
|
|
16
|
+
count: 0,
|
|
17
|
+
approximate: false,
|
|
18
|
+
});
|
|
15
19
|
|
|
16
20
|
await cache.event(event1);
|
|
17
21
|
|
|
18
|
-
|
|
22
|
+
deepStrictEqual(await cache.count([{ ids: [event1.id] }]), {
|
|
23
|
+
count: 1,
|
|
24
|
+
approximate: false,
|
|
25
|
+
});
|
|
19
26
|
|
|
20
27
|
const result = await cache.query([{ ids: [event1.id] }]);
|
|
21
|
-
|
|
28
|
+
deepStrictEqual(result[0], event1);
|
|
22
29
|
});
|
package/NCache.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
// deno-lint-ignore-file require-await
|
|
2
2
|
|
|
3
|
-
import { NostrEvent, NostrFilter, NostrRelayCOUNT, NStore } from '@nostrify/types';
|
|
3
|
+
import type { NostrEvent, NostrFilter, NostrRelayCOUNT, NStore } from '@nostrify/types';
|
|
4
4
|
import { LRUCache } from 'lru-cache';
|
|
5
5
|
import { matchFilters } from 'nostr-tools';
|
|
6
6
|
|
|
7
|
-
import { NSet } from './NSet.
|
|
7
|
+
import { NSet } from './NSet.ts';
|
|
8
8
|
|
|
9
9
|
/**
|
|
10
10
|
* Nostr LRU cache based on [`npm:lru-cache`](https://www.npmjs.com/package/lru-cache).
|