@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.
Files changed (154) hide show
  1. package/.turbo/turbo-build.log +121 -2
  2. package/.turbo/turbo-setup.log +13 -0
  3. package/.turbo/turbo-test.log +91 -0
  4. package/BunkerURI.test.ts +19 -14
  5. package/CHANGELOG.md +16 -0
  6. package/NBrowserSigner.test.ts +49 -34
  7. package/NCache.test.ts +14 -7
  8. package/NCache.ts +2 -2
  9. package/NConnectSigner.test.ts +48 -31
  10. package/NConnectSigner.ts +3 -3
  11. package/NIP05.test.ts +36 -44
  12. package/NIP05.ts +6 -6
  13. package/NIP50.test.ts +35 -34
  14. package/NIP98.test.ts +89 -76
  15. package/NIP98.ts +2 -2
  16. package/NKinds.test.ts +37 -36
  17. package/NPool.test.ts +35 -24
  18. package/NPool.ts +42 -23
  19. package/NRelay1.test.ts +100 -68
  20. package/NRelay1.ts +13 -6
  21. package/NSchema.test.ts +98 -56
  22. package/NSchema.ts +74 -37
  23. package/NSecSigner.test.ts +19 -10
  24. package/NSecSigner.ts +4 -3
  25. package/NSet.test.ts +123 -50
  26. package/NSet.ts +13 -6
  27. package/RelayError.test.ts +11 -10
  28. package/RelayError.ts +1 -1
  29. package/dist/NCache.d.ts +2 -2
  30. package/dist/NCache.d.ts.map +1 -1
  31. package/dist/NConnectSigner.d.ts +1 -1
  32. package/dist/NConnectSigner.d.ts.map +1 -1
  33. package/dist/NIP05.d.ts +1 -1
  34. package/dist/NIP05.d.ts.map +1 -1
  35. package/dist/NIP98.d.ts +1 -1
  36. package/dist/NIP98.d.ts.map +1 -1
  37. package/dist/NPool.d.ts +2 -2
  38. package/dist/NPool.d.ts.map +1 -1
  39. package/dist/NRelay1.d.ts +5 -4
  40. package/dist/NRelay1.d.ts.map +1 -1
  41. package/dist/NSchema.d.ts +1 -1
  42. package/dist/NSchema.d.ts.map +1 -1
  43. package/dist/NSecSigner.d.ts +1 -2
  44. package/dist/NSecSigner.d.ts.map +1 -1
  45. package/dist/NSet.d.ts +1 -1
  46. package/dist/NSet.d.ts.map +1 -1
  47. package/dist/RelayError.d.ts +1 -1
  48. package/dist/RelayError.d.ts.map +1 -1
  49. package/dist/ln/LNURL.d.ts +4 -4
  50. package/dist/ln/LNURL.d.ts.map +1 -1
  51. package/dist/ln/mod.d.ts +3 -3
  52. package/dist/mod.d.ts +14 -14
  53. package/dist/test/ErrorRelay.d.ts +1 -1
  54. package/dist/test/ErrorRelay.d.ts.map +1 -1
  55. package/dist/test/MockRelay.d.ts +3 -3
  56. package/dist/test/MockRelay.d.ts.map +1 -1
  57. package/dist/test/TestRelayServer.d.ts +6 -3
  58. package/dist/test/TestRelayServer.d.ts.map +1 -1
  59. package/dist/test/mod.d.ts +3 -3
  60. package/dist/test/mod.d.ts.map +1 -1
  61. package/dist/tsconfig.tsbuildinfo +1 -1
  62. package/dist/uploaders/BlossomUploader.d.ts +1 -1
  63. package/dist/uploaders/BlossomUploader.d.ts.map +1 -1
  64. package/dist/uploaders/NostrBuildUploader.d.ts +1 -2
  65. package/dist/uploaders/NostrBuildUploader.d.ts.map +1 -1
  66. package/dist/uploaders/mod.d.ts +2 -2
  67. package/dist/utils/CircularSet.d.ts +1 -1
  68. package/dist/utils/CircularSet.d.ts.map +1 -1
  69. package/dist/utils/N64.d.ts +1 -1
  70. package/dist/utils/N64.d.ts.map +1 -1
  71. package/dist/utils/mod.d.ts +2 -2
  72. package/ln/LNURL.test.ts +70 -52
  73. package/ln/LNURL.ts +15 -15
  74. package/ln/mod.ts +3 -3
  75. package/mod.ts +14 -14
  76. package/package.json +5 -3
  77. package/test/ErrorRelay.test.ts +11 -10
  78. package/test/ErrorRelay.ts +17 -5
  79. package/test/MockRelay.test.ts +15 -8
  80. package/test/MockRelay.ts +3 -3
  81. package/test/TestRelayServer.ts +46 -17
  82. package/test/mod.ts +4 -4
  83. package/tsconfig.json +5 -3
  84. package/uploaders/BlossomUploader.test.ts +39 -22
  85. package/uploaders/BlossomUploader.ts +2 -2
  86. package/uploaders/NostrBuildUploader.test.ts +36 -18
  87. package/uploaders/NostrBuildUploader.ts +4 -4
  88. package/uploaders/mod.ts +2 -2
  89. package/utils/CircularSet.test.ts +5 -4
  90. package/utils/CircularSet.ts +3 -1
  91. package/utils/Machina.test.ts +30 -19
  92. package/utils/N64.test.ts +12 -11
  93. package/utils/N64.ts +2 -2
  94. package/utils/mod.ts +2 -2
  95. package/dist/BunkerURI.js +0 -48
  96. package/dist/BunkerURI.js.map +0 -1
  97. package/dist/NBrowserSigner.js +0 -92
  98. package/dist/NBrowserSigner.js.map +0 -1
  99. package/dist/NCache.js +0 -60
  100. package/dist/NCache.js.map +0 -1
  101. package/dist/NConnectSigner.js +0 -125
  102. package/dist/NConnectSigner.js.map +0 -1
  103. package/dist/NIP05.js +0 -35
  104. package/dist/NIP05.js.map +0 -1
  105. package/dist/NIP50.js +0 -22
  106. package/dist/NIP50.js.map +0 -1
  107. package/dist/NIP98.js +0 -67
  108. package/dist/NIP98.js.map +0 -1
  109. package/dist/NKinds.js +0 -23
  110. package/dist/NKinds.js.map +0 -1
  111. package/dist/NPool.js +0 -181
  112. package/dist/NPool.js.map +0 -1
  113. package/dist/NRelay1.js +0 -332
  114. package/dist/NRelay1.js.map +0 -1
  115. package/dist/NSchema.js +0 -210
  116. package/dist/NSchema.js.map +0 -1
  117. package/dist/NSecSigner.js +0 -49
  118. package/dist/NSecSigner.js.map +0 -1
  119. package/dist/NSet.js +0 -171
  120. package/dist/NSet.js.map +0 -1
  121. package/dist/RelayError.js +0 -19
  122. package/dist/RelayError.js.map +0 -1
  123. package/dist/ln/LNURL.js +0 -101
  124. package/dist/ln/LNURL.js.map +0 -1
  125. package/dist/ln/mod.js +0 -2
  126. package/dist/ln/mod.js.map +0 -1
  127. package/dist/ln/types/LNURLCallback.js +0 -2
  128. package/dist/ln/types/LNURLCallback.js.map +0 -1
  129. package/dist/ln/types/LNURLDetails.js +0 -2
  130. package/dist/ln/types/LNURLDetails.js.map +0 -1
  131. package/dist/mod.js +0 -15
  132. package/dist/mod.js.map +0 -1
  133. package/dist/test/ErrorRelay.js +0 -22
  134. package/dist/test/ErrorRelay.js.map +0 -1
  135. package/dist/test/MockRelay.js +0 -62
  136. package/dist/test/MockRelay.js.map +0 -1
  137. package/dist/test/TestRelayServer.js +0 -130
  138. package/dist/test/TestRelayServer.js.map +0 -1
  139. package/dist/test/mod.js +0 -21
  140. package/dist/test/mod.js.map +0 -1
  141. package/dist/uploaders/BlossomUploader.js +0 -67
  142. package/dist/uploaders/BlossomUploader.js.map +0 -1
  143. package/dist/uploaders/NostrBuildUploader.js +0 -63
  144. package/dist/uploaders/NostrBuildUploader.js.map +0 -1
  145. package/dist/uploaders/mod.js +0 -3
  146. package/dist/uploaders/mod.js.map +0 -1
  147. package/dist/utils/CircularSet.js +0 -31
  148. package/dist/utils/CircularSet.js.map +0 -1
  149. package/dist/utils/Machina.js +0 -62
  150. package/dist/utils/Machina.js.map +0 -1
  151. package/dist/utils/N64.js +0 -19
  152. package/dist/utils/N64.js.map +0 -1
  153. package/dist/utils/mod.js +0 -3
  154. package/dist/utils/mod.js.map +0 -1
@@ -1,5 +1,124 @@
1
1
 
2
2
 
3
- > @nostrify/nostrify@0.46.7 build /home/sid/repos/NSpec/packages/nostrify
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
+ NIP05.ts:18:5 - error TS2322: Type '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
+ 18 return z.object({
12
+    ~~~~~~
13
+
14
+ NSchema.ts:45:5 - error TS2322: Type '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
+ 45 return z.object({
20
+    ~~~~~~
21
+
22
+ NSchema.ts:108:5 - error TS2322: Type '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
+ 108 return z.tuple([z.literal('EVENT'), NSchema.event()]);
28
+    ~~~~~~
29
+
30
+ NSchema.ts:123:5 - error TS2322: Type '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
+ 123 return z.tuple([z.literal('CLOSE'), z.string()]);
36
+    ~~~~~~
37
+
38
+ NSchema.ts:128:5 - error TS2322: Type '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
+ 128 return z.tuple([z.literal('AUTH'), NSchema.event()]);
44
+    ~~~~~~
45
+
46
+ NSchema.ts:144:5 - error TS2322: Type '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
+ 144 return z.tuple([z.literal('EVENT'), z.string(), NSchema.event()]);
52
+    ~~~~~~
53
+
54
+ NSchema.ts:149:5 - error TS2322: Type '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
+ 149 return z.tuple([z.literal('OK'), NSchema.id(), z.boolean(), z.string()]);
60
+    ~~~~~~
61
+
62
+ NSchema.ts:154:5 - error TS2322: Type '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
+ 154 return z.tuple([z.literal('EOSE'), z.string()]);
68
+    ~~~~~~
69
+
70
+ NSchema.ts:159:5 - error TS2322: Type '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
+ 159 return z.tuple([z.literal('NOTICE'), z.string()]);
76
+    ~~~~~~
77
+
78
+ NSchema.ts:164:5 - error TS2322: Type '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
+ 164 return z.tuple([z.literal('CLOSED'), z.string(), z.string()]);
84
+    ~~~~~~
85
+
86
+ NSchema.ts:169:5 - error TS2322: Type '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
+ 169 return z.tuple([z.literal('AUTH'), z.string()]);
92
+    ~~~~~~
93
+
94
+ NSchema.ts:174:5 - error TS2322: Type '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
+ 174 return z.tuple([
100
+    ~~~~~~
101
+
102
+ NSchema.ts:215:5 - error TS2322: Type '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
+ 215 return z.object({
108
+    ~~~~~~
109
+
110
+ NSchema.ts:224:5 - error TS2322: Type '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
+ 224 return z.object({
116
+    ~~~~~~
117
+
118
+
119
+ Found 14 errors in 2 files.
120
+
121
+ Errors Files
122
+ 1 NIP05.ts:18
123
+ 13 NSchema.ts:45
124
+  ELIFECYCLE  Command failed with exit code 2.
@@ -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 1, reused 0, downloaded 0, added 0
10
+ ../.. | +1 +
11
+ ../.. | Progress: resolved 1, reused 0, downloaded 0, added 0
12
+ ../.. | Progress: resolved 1, reused 1, downloaded 0, added 0
13
+ ../.. | Progress: resolved 1, reused 1, downloaded 0, added 0, 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 { assertEquals, assertObjectMatch } from '@std/assert';
1
+ import { test } from "node:test";
2
+ import { deepStrictEqual } from "node:assert";
2
3
 
3
- import { BunkerURI } from './BunkerURI.ts';
4
+ import { BunkerURI } from "./BunkerURI.ts";
4
5
 
5
- Deno.test('BunkerURI', () => {
6
+ await test("BunkerURI", () => {
6
7
  const uri = new BunkerURI(
7
- 'bunker://79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798?relay=wss%3A%2F%2Fditto.pub%2Frelay&secret=piAuZsxgKlil',
8
+ "bunker://79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798?relay=wss%3A%2F%2Fditto.pub%2Frelay&secret=piAuZsxgKlil",
8
9
  );
9
10
 
10
- assertObjectMatch(uri, {
11
- pubkey: '79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798',
12
- relays: ['wss://ditto.pub/relay'],
13
- secret: 'piAuZsxgKlil',
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
- Deno.test('BunkerURI.fromJSON', () => {
22
+ await test("BunkerURI.fromJSON", () => {
18
23
  const result = BunkerURI.fromJSON({
19
- pubkey: '79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798',
20
- relays: ['wss://ditto.pub/relay'],
21
- secret: 'piAuZsxgKlil',
24
+ pubkey: "79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798",
25
+ relays: ["wss://ditto.pub/relay"],
26
+ secret: "piAuZsxgKlil",
22
27
  });
23
28
 
24
29
  const expected =
25
- 'bunker://79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798?relay=wss%3A%2F%2Fditto.pub%2Frelay&secret=piAuZsxgKlil';
30
+ "bunker://79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798?relay=wss%3A%2F%2Fditto.pub%2Frelay&secret=piAuZsxgKlil";
26
31
 
27
- assertEquals(result.toString(), expected);
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
@@ -1,31 +1,38 @@
1
- import { NSecSigner } from '@nostrify/nostrify';
2
- import { assertEquals, assertRejects } from '@std/assert';
3
- import { finalizeEvent, generateSecretKey, getPublicKey } from 'nostr-tools';
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 './NBrowserSigner.ts';
6
+ import { NBrowserSigner } from "./NBrowserSigner.ts";
6
7
 
7
- import type { NostrEvent, NostrSigner } from '@nostrify/types';
8
+ import type { NostrEvent, NostrSigner } from "@nostrify/types";
8
9
 
9
- Deno.test('NBrowserSigner - without extension', async () => {
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 assertRejects(
16
+ await rejects(
16
17
  () => signer.getPublicKey(),
17
18
  Error,
18
- 'Browser extension not available',
19
+ "Browser extension not available",
19
20
  );
20
21
 
21
- await assertRejects(
22
- () => signer.signEvent({ kind: 1, content: 'Hello, world!', tags: [], created_at: 0 }),
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
- 'Browser extension not available',
31
+ "Browser extension not available",
25
32
  );
26
33
  });
27
34
 
28
- Deno.test('NBrowserSigner - with extension polyfill', async () => {
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
- assertEquals(await signer.getPublicKey(), getPublicKey(secretKey));
45
+ deepStrictEqual(await signer.getPublicKey(), getPublicKey(secretKey));
39
46
 
40
47
  // Test signEvent
41
- const template = { kind: 1, content: 'Hello, world!', tags: [], created_at: 0 };
42
- assertEquals(await signer.signEvent(template), finalizeEvent(template, secretKey));
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
- Deno.test('NBrowserSigner.nip44 - with extension polyfill', async () => {
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 = 'Hello, world!';
73
+ const plaintext = "Hello, world!";
59
74
 
60
75
  const ciphertext = await signer.nip44!.encrypt(pubkey, plaintext);
61
- assertEquals(await signer.nip44!.decrypt(pubkey, ciphertext), plaintext);
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
- Deno.test('NBrowserSigner.nip04 - with extension polyfill', async () => {
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 = 'Hello, world!';
92
+ const plaintext = "Hello, world!";
78
93
 
79
94
  const ciphertext = await signer.nip04!.encrypt(pubkey, plaintext);
80
- assertEquals(await signer.nip04!.decrypt(pubkey, ciphertext), plaintext);
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
- Deno.test('NBrowserSigner.getRelays - with extension polyfill', async () => {
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
- assertEquals(relays, {});
112
+ deepStrictEqual(relays, {});
98
113
 
99
114
  // Clean up
100
115
  (globalThis as { nostr?: NostrSigner }).nostr = undefined;
101
116
  });
102
117
 
103
- Deno.test('NBrowserSigner - missing nip44 support', () => {
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 () => 'pubkey',
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
- assertEquals(signer.nip44, undefined);
133
+ deepStrictEqual(signer.nip44, undefined);
119
134
 
120
135
  // Clean up
121
136
  (globalThis as { nostr?: NostrSigner }).nostr = undefined;
122
137
  });
123
138
 
124
- Deno.test('NBrowserSigner - missing nip04 support', () => {
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 () => 'pubkey',
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
- assertEquals(signer.nip04, undefined);
154
+ deepStrictEqual(signer.nip04, undefined);
140
155
 
141
156
  // Clean up
142
157
  (globalThis as { nostr?: NostrSigner }).nostr = undefined;
143
158
  });
144
159
 
145
- Deno.test('NBrowserSigner - feature detection', () => {
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
- assertEquals(typeof signer.nip44.encrypt, 'function');
158
- assertEquals(typeof signer.nip44.decrypt, 'function');
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
- assertEquals(typeof signer.nip04.encrypt, 'function');
165
- assertEquals(typeof signer.nip04.decrypt, 'function');
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 { assertEquals } from '@std/assert';
1
+ import { test } from "node:test";
2
+ import { deepStrictEqual } from "node:assert";
2
3
 
3
- import { NCache } from './NCache.ts';
4
+ import { NCache } from "./NCache.ts";
4
5
 
5
- import event1 from '../../fixtures/event-1.json' with { type: 'json' };
6
+ import event1 from "../../fixtures/event-1.json" with { type: "json" };
6
7
 
7
- Deno.test('NCache', async () => {
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
- assertEquals(await cache.count([{ ids: [event1.id] }]), { count: 0, approximate: false });
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
- assertEquals(await cache.count([{ ids: [event1.id] }]), { count: 1, approximate: false });
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
- assertEquals(result[0], event1);
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.js';
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).