@nostrify/nostrify 0.46.4
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 +5 -0
- package/BunkerURI.test.ts +28 -0
- package/BunkerURI.ts +58 -0
- package/CHANGELOG.md +562 -0
- package/LICENSE +21 -0
- package/NBrowserSigner.test.ts +170 -0
- package/NBrowserSigner.ts +100 -0
- package/NCache.bench.ts +81 -0
- package/NCache.test.ts +22 -0
- package/NCache.ts +73 -0
- package/NConnectSigner.test.ts +102 -0
- package/NConnectSigner.ts +189 -0
- package/NIP05.test.ts +67 -0
- package/NIP05.ts +52 -0
- package/NIP50.test.ts +58 -0
- package/NIP50.ts +24 -0
- package/NIP98.test.ts +181 -0
- package/NIP98.ts +97 -0
- package/NKinds.test.ts +42 -0
- package/NKinds.ts +26 -0
- package/NPool.test.ts +117 -0
- package/NPool.ts +224 -0
- package/NRelay1.test.ts +174 -0
- package/NRelay1.ts +440 -0
- package/NSchema.test.ts +94 -0
- package/NSchema.ts +255 -0
- package/NSecSigner.bench.ts +55 -0
- package/NSecSigner.test.ts +26 -0
- package/NSecSigner.ts +60 -0
- package/NSet.bench.ts +10 -0
- package/NSet.test.ts +92 -0
- package/NSet.ts +203 -0
- package/README.md +314 -0
- package/RelayError.test.ts +23 -0
- package/RelayError.ts +22 -0
- package/dist/BunkerURI.d.ts +23 -0
- package/dist/BunkerURI.d.ts.map +1 -0
- package/dist/BunkerURI.js +52 -0
- package/dist/BunkerURI.js.map +1 -0
- package/dist/NBrowserSigner.d.ts +27 -0
- package/dist/NBrowserSigner.d.ts.map +1 -0
- package/dist/NBrowserSigner.js +96 -0
- package/dist/NBrowserSigner.js.map +1 -0
- package/dist/NCache.d.ts +34 -0
- package/dist/NCache.d.ts.map +1 -0
- package/dist/NCache.js +63 -0
- package/dist/NCache.js.map +1 -0
- package/dist/NConnectSigner.d.ts +50 -0
- package/dist/NConnectSigner.d.ts.map +1 -0
- package/dist/NConnectSigner.js +130 -0
- package/dist/NConnectSigner.js.map +1 -0
- package/dist/NIP05.d.ts +15 -0
- package/dist/NIP05.d.ts.map +1 -0
- package/dist/NIP05.js +40 -0
- package/dist/NIP05.js.map +1 -0
- package/dist/NIP50.d.ts +10 -0
- package/dist/NIP50.d.ts.map +1 -0
- package/dist/NIP50.js +26 -0
- package/dist/NIP50.js.map +1 -0
- package/dist/NIP98.d.ts +15 -0
- package/dist/NIP98.d.ts.map +1 -0
- package/dist/NIP98.js +71 -0
- package/dist/NIP98.js.map +1 -0
- package/dist/NKinds.d.ts +13 -0
- package/dist/NKinds.d.ts.map +1 -0
- package/dist/NKinds.js +27 -0
- package/dist/NKinds.js.map +1 -0
- package/dist/NPool.d.ts +91 -0
- package/dist/NPool.d.ts.map +1 -0
- package/dist/NPool.js +185 -0
- package/dist/NPool.js.map +1 -0
- package/dist/NRelay1.d.ts +80 -0
- package/dist/NRelay1.d.ts.map +1 -0
- package/dist/NRelay1.js +336 -0
- package/dist/NRelay1.js.map +1 -0
- package/dist/NSchema.d.ts +73 -0
- package/dist/NSchema.d.ts.map +1 -0
- package/dist/NSchema.js +215 -0
- package/dist/NSchema.js.map +1 -0
- package/dist/NSecSigner.d.ts +29 -0
- package/dist/NSecSigner.d.ts.map +1 -0
- package/dist/NSecSigner.js +52 -0
- package/dist/NSecSigner.js.map +1 -0
- package/dist/NSet.d.ts +76 -0
- package/dist/NSet.d.ts.map +1 -0
- package/dist/NSet.js +174 -0
- package/dist/NSet.js.map +1 -0
- package/dist/RelayError.d.ts +10 -0
- package/dist/RelayError.d.ts.map +1 -0
- package/dist/RelayError.js +23 -0
- package/dist/RelayError.js.map +1 -0
- package/dist/ln/LNURL.d.ts +55 -0
- package/dist/ln/LNURL.d.ts.map +1 -0
- package/dist/ln/LNURL.js +105 -0
- package/dist/ln/LNURL.js.map +1 -0
- package/dist/ln/mod.d.ts +4 -0
- package/dist/ln/mod.d.ts.map +1 -0
- package/dist/ln/mod.js +6 -0
- package/dist/ln/mod.js.map +1 -0
- package/dist/ln/types/LNURLCallback.d.ts +8 -0
- package/dist/ln/types/LNURLCallback.d.ts.map +1 -0
- package/dist/ln/types/LNURLCallback.js +3 -0
- package/dist/ln/types/LNURLCallback.js.map +1 -0
- package/dist/ln/types/LNURLDetails.d.ts +20 -0
- package/dist/ln/types/LNURLDetails.d.ts.map +1 -0
- package/dist/ln/types/LNURLDetails.js +3 -0
- package/dist/ln/types/LNURLDetails.js.map +1 -0
- package/dist/mod.d.ts +16 -0
- package/dist/mod.d.ts.map +1 -0
- package/dist/mod.js +32 -0
- package/dist/mod.js.map +1 -0
- package/dist/test/ErrorRelay.d.ts +21 -0
- package/dist/test/ErrorRelay.d.ts.map +1 -0
- package/dist/test/ErrorRelay.js +26 -0
- package/dist/test/ErrorRelay.js.map +1 -0
- package/dist/test/MockRelay.d.ts +20 -0
- package/dist/test/MockRelay.d.ts.map +1 -0
- package/dist/test/MockRelay.js +66 -0
- package/dist/test/MockRelay.js.map +1 -0
- package/dist/test/TestRelayServer.d.ts +25 -0
- package/dist/test/TestRelayServer.d.ts.map +1 -0
- package/dist/test/TestRelayServer.js +134 -0
- package/dist/test/TestRelayServer.js.map +1 -0
- package/dist/test/mod.d.ts +8 -0
- package/dist/test/mod.d.ts.map +1 -0
- package/dist/test/mod.js +28 -0
- package/dist/test/mod.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -0
- package/dist/uploaders/BlossomUploader.d.ts +26 -0
- package/dist/uploaders/BlossomUploader.d.ts.map +1 -0
- package/dist/uploaders/BlossomUploader.js +71 -0
- package/dist/uploaders/BlossomUploader.js.map +1 -0
- package/dist/uploaders/NostrBuildUploader.d.ts +24 -0
- package/dist/uploaders/NostrBuildUploader.d.ts.map +1 -0
- package/dist/uploaders/NostrBuildUploader.js +67 -0
- package/dist/uploaders/NostrBuildUploader.js.map +1 -0
- package/dist/uploaders/mod.d.ts +3 -0
- package/dist/uploaders/mod.d.ts.map +1 -0
- package/dist/uploaders/mod.js +8 -0
- package/dist/uploaders/mod.js.map +1 -0
- package/dist/utils/CircularSet.d.ts +13 -0
- package/dist/utils/CircularSet.d.ts.map +1 -0
- package/dist/utils/CircularSet.js +35 -0
- package/dist/utils/CircularSet.js.map +1 -0
- package/dist/utils/Machina.d.ts +36 -0
- package/dist/utils/Machina.d.ts.map +1 -0
- package/dist/utils/Machina.js +66 -0
- package/dist/utils/Machina.js.map +1 -0
- package/dist/utils/N64.d.ts +9 -0
- package/dist/utils/N64.d.ts.map +1 -0
- package/dist/utils/N64.js +23 -0
- package/dist/utils/N64.js.map +1 -0
- package/dist/utils/mod.d.ts +3 -0
- package/dist/utils/mod.d.ts.map +1 -0
- package/dist/utils/mod.js +8 -0
- package/dist/utils/mod.js.map +1 -0
- package/ln/LNURL.test.ts +87 -0
- package/ln/LNURL.ts +146 -0
- package/ln/mod.ts +4 -0
- package/ln/types/LNURLCallback.ts +7 -0
- package/ln/types/LNURLDetails.ts +19 -0
- package/mod.ts +16 -0
- package/package.json +23 -0
- package/test/ErrorRelay.test.ts +19 -0
- package/test/ErrorRelay.ts +40 -0
- package/test/MockRelay.test.ts +20 -0
- package/test/MockRelay.ts +92 -0
- package/test/TestRelayServer.ts +156 -0
- package/test/mod.ts +28 -0
- package/tsconfig.json +14 -0
- package/uploaders/BlossomUploader.test.ts +26 -0
- package/uploaders/BlossomUploader.ts +98 -0
- package/uploaders/NostrBuildUploader.test.ts +22 -0
- package/uploaders/NostrBuildUploader.ts +89 -0
- package/uploaders/mod.ts +2 -0
- package/utils/CircularSet.test.ts +15 -0
- package/utils/CircularSet.ts +34 -0
- package/utils/Machina.test.ts +91 -0
- package/utils/Machina.ts +66 -0
- package/utils/N64.test.ts +27 -0
- package/utils/N64.ts +23 -0
- package/utils/mod.ts +2 -0
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { assertEquals, assertObjectMatch } from '@std/assert';
|
|
2
|
+
|
|
3
|
+
import { BunkerURI } from './BunkerURI.ts';
|
|
4
|
+
|
|
5
|
+
Deno.test('BunkerURI', () => {
|
|
6
|
+
const uri = new BunkerURI(
|
|
7
|
+
'bunker://79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798?relay=wss%3A%2F%2Fditto.pub%2Frelay&secret=piAuZsxgKlil',
|
|
8
|
+
);
|
|
9
|
+
|
|
10
|
+
assertObjectMatch(uri, {
|
|
11
|
+
pubkey: '79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798',
|
|
12
|
+
relays: ['wss://ditto.pub/relay'],
|
|
13
|
+
secret: 'piAuZsxgKlil',
|
|
14
|
+
});
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
Deno.test('BunkerURI.fromJSON', () => {
|
|
18
|
+
const result = BunkerURI.fromJSON({
|
|
19
|
+
pubkey: '79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798',
|
|
20
|
+
relays: ['wss://ditto.pub/relay'],
|
|
21
|
+
secret: 'piAuZsxgKlil',
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
const expected =
|
|
25
|
+
'bunker://79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798?relay=wss%3A%2F%2Fditto.pub%2Frelay&secret=piAuZsxgKlil';
|
|
26
|
+
|
|
27
|
+
assertEquals(result.toString(), expected);
|
|
28
|
+
});
|
package/BunkerURI.ts
ADDED
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
/** Construct a [NIP-46](https://github.com/nostr-protocol/nips/blob/master/46.md) bunker URI. */
|
|
2
|
+
export class BunkerURI {
|
|
3
|
+
/** Remote signer pubkey. */
|
|
4
|
+
pubkey: string;
|
|
5
|
+
/** Relay URLs on which the client is listening for responses from the remote-signer. */
|
|
6
|
+
relays: string[];
|
|
7
|
+
/** A short random string that the remote-signer should return as the `result` field of its response. */
|
|
8
|
+
secret?: string;
|
|
9
|
+
|
|
10
|
+
constructor(uri: string) {
|
|
11
|
+
const url = new URL(uri);
|
|
12
|
+
const params = new URLSearchParams(url.search);
|
|
13
|
+
|
|
14
|
+
// https://github.com/denoland/deno/issues/26440
|
|
15
|
+
const pubkey = url.hostname || url.pathname.slice(2);
|
|
16
|
+
const relays = params.getAll('relay');
|
|
17
|
+
const secret = params.get('secret') ?? undefined;
|
|
18
|
+
|
|
19
|
+
if (!pubkey) {
|
|
20
|
+
throw new Error('Invalid bunker URI');
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
this.pubkey = pubkey;
|
|
24
|
+
this.relays = relays;
|
|
25
|
+
this.secret = secret;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/** Convert into a `bunker://` URI string. */
|
|
29
|
+
get href(): string {
|
|
30
|
+
return this.toString();
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
/** Convert into a `bunker://` URI string. */
|
|
34
|
+
toString(): string {
|
|
35
|
+
return BunkerURI.toString(this);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
/** Convert a bunker data object into a `BunkerURI` instance. */
|
|
39
|
+
static fromJSON(data: { pubkey: string; relays: string[]; secret?: string }): BunkerURI {
|
|
40
|
+
const uri = BunkerURI.toString(data);
|
|
41
|
+
return new BunkerURI(uri);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/** Convert a bunker data object into a bunker URI string. */
|
|
45
|
+
private static toString(data: { pubkey: string; relays: string[]; secret?: string }): string {
|
|
46
|
+
const search = new URLSearchParams();
|
|
47
|
+
|
|
48
|
+
for (const relay of data.relays) {
|
|
49
|
+
search.append('relay', relay);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
if (data.secret) {
|
|
53
|
+
search.set('secret', data.secret);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
return `bunker://${data.pubkey}?${search.toString()}`;
|
|
57
|
+
}
|
|
58
|
+
}
|
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,562 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to this project will be documented in this file.
|
|
4
|
+
|
|
5
|
+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
|
|
6
|
+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
|
+
|
|
8
|
+
## 0.46.4 - 2025-07-15
|
|
9
|
+
|
|
10
|
+
### Fixed
|
|
11
|
+
|
|
12
|
+
- NConnectSigner: fixed REQ subscription not being opened before sending EVENT.
|
|
13
|
+
|
|
14
|
+
## 0.46.1 - 2025-05-14
|
|
15
|
+
|
|
16
|
+
### Fixed
|
|
17
|
+
|
|
18
|
+
- Fix fetch calls in browser by binding globalThis (NIP05, LNURL, BlossomUploader).
|
|
19
|
+
- BlossomUploader: use a browser-supported file hashing method.
|
|
20
|
+
|
|
21
|
+
## 0.46.0 - 2025-05-10
|
|
22
|
+
|
|
23
|
+
### Removed
|
|
24
|
+
|
|
25
|
+
- NRelay1: remove filter batching.
|
|
26
|
+
|
|
27
|
+
## 0.45.2 - 2025-05-10
|
|
28
|
+
|
|
29
|
+
### Fixed
|
|
30
|
+
|
|
31
|
+
- NRelay1: request batching only returned the first result.
|
|
32
|
+
|
|
33
|
+
## 0.45.1 - 2025-05-04
|
|
34
|
+
|
|
35
|
+
### Fixed
|
|
36
|
+
|
|
37
|
+
- NRelay1: fixed request batching.
|
|
38
|
+
|
|
39
|
+
## 0.45.0 - 2025-04-24
|
|
40
|
+
|
|
41
|
+
### Changed
|
|
42
|
+
|
|
43
|
+
- BREAKING: Redesign the `LNURL` module to be a stateful class, more similar to `URL`.
|
|
44
|
+
|
|
45
|
+
## 0.44.0 - 2025-04-23
|
|
46
|
+
|
|
47
|
+
### Changed
|
|
48
|
+
|
|
49
|
+
- NPool: wait for every type of filter, not just replaceable event filters.
|
|
50
|
+
|
|
51
|
+
## 0.43.0 - 2025-04-10
|
|
52
|
+
|
|
53
|
+
### Changed
|
|
54
|
+
|
|
55
|
+
- Moved `NSeedSigner`, `NPhraseSigner`, and `NCustodial` into a separate `@nostrify/seed` package.
|
|
56
|
+
|
|
57
|
+
## 0.42.1 - 2025-04-10
|
|
58
|
+
|
|
59
|
+
### Changed
|
|
60
|
+
|
|
61
|
+
- Upgrade `@scure/*` packages, switch them to jsr.
|
|
62
|
+
|
|
63
|
+
## 0.42.0 - 2025-04-10
|
|
64
|
+
|
|
65
|
+
### Added
|
|
66
|
+
|
|
67
|
+
- Added `@nostrify/react` package.
|
|
68
|
+
- NPool: add `.group` method to create sub-pools.
|
|
69
|
+
|
|
70
|
+
### Removed
|
|
71
|
+
|
|
72
|
+
- Removed NSimplePool.
|
|
73
|
+
|
|
74
|
+
## 0.41.2 - 2025-04-10
|
|
75
|
+
|
|
76
|
+
### Added
|
|
77
|
+
|
|
78
|
+
- Added `BunkerURI` class to parse NIP-46 connection strings.
|
|
79
|
+
|
|
80
|
+
## 0.41.1 - 2025-04-07
|
|
81
|
+
|
|
82
|
+
### Changed
|
|
83
|
+
|
|
84
|
+
- NKinds: deprecate `parameterizedReplaceable` in favor of `addressable`.
|
|
85
|
+
|
|
86
|
+
## 0.41.0 - 2025-04-07
|
|
87
|
+
|
|
88
|
+
### Added
|
|
89
|
+
|
|
90
|
+
- NRelay1: batch ids-only filters and filters for replaceable events by author/kind within the same event loop.
|
|
91
|
+
|
|
92
|
+
## 0.40.0 - 2025-03-26
|
|
93
|
+
|
|
94
|
+
### Added
|
|
95
|
+
|
|
96
|
+
- NPool: add `relays` opt to all methods to support per-query explicit relays.
|
|
97
|
+
|
|
98
|
+
### Changed
|
|
99
|
+
|
|
100
|
+
- NPool: deduplicate events in `.req` method.
|
|
101
|
+
- NPool: router opts may be synchronous.
|
|
102
|
+
|
|
103
|
+
### Fixed
|
|
104
|
+
|
|
105
|
+
- NPool: queries with `search` filters are no longer sorted by `created_at`.
|
|
106
|
+
|
|
107
|
+
## 0.39.1 - 2025-02-23
|
|
108
|
+
|
|
109
|
+
### Fixed
|
|
110
|
+
|
|
111
|
+
- NRelay1: improved error handling.
|
|
112
|
+
|
|
113
|
+
## 0.39.0 - 2025-02-22
|
|
114
|
+
|
|
115
|
+
### Added
|
|
116
|
+
|
|
117
|
+
- Added `RelayError` class.
|
|
118
|
+
|
|
119
|
+
### Fixed
|
|
120
|
+
|
|
121
|
+
- NRelay1: calling `.close()` cancels any active subscriptions.
|
|
122
|
+
|
|
123
|
+
### Changed
|
|
124
|
+
|
|
125
|
+
- NRelay1: upgraded websocket-ts to v2.2.1.
|
|
126
|
+
- NRelay1: close automatically upon receiving a binary message.
|
|
127
|
+
- NRelay1: pass url to all logs.
|
|
128
|
+
|
|
129
|
+
## 0.38.1 - 2025-02-05
|
|
130
|
+
|
|
131
|
+
### Changed
|
|
132
|
+
|
|
133
|
+
- NIP-50: parse negated tokens.
|
|
134
|
+
|
|
135
|
+
## 0.38.0 - 2025-01-30
|
|
136
|
+
|
|
137
|
+
### Added
|
|
138
|
+
|
|
139
|
+
- NRelay1: added relay logging.
|
|
140
|
+
|
|
141
|
+
## 0.37.0 - 2024-12-30
|
|
142
|
+
|
|
143
|
+
### Added
|
|
144
|
+
|
|
145
|
+
- NSchema: add `relayUrl` schema.
|
|
146
|
+
|
|
147
|
+
### Fixed
|
|
148
|
+
|
|
149
|
+
- NIP05: tolerate invalid documents, stricter validation of result.
|
|
150
|
+
|
|
151
|
+
### Changed
|
|
152
|
+
|
|
153
|
+
- NConnectSigner: use `nip44` encryption by default.
|
|
154
|
+
|
|
155
|
+
## 0.36.2 - 2024-11-24
|
|
156
|
+
|
|
157
|
+
### Fixed
|
|
158
|
+
|
|
159
|
+
- NSecSigner: cache pubkey to speed up subsequent `getPublicKey()` calls.
|
|
160
|
+
|
|
161
|
+
## 0.36.1 - 2024-10-10
|
|
162
|
+
|
|
163
|
+
### Fixed
|
|
164
|
+
|
|
165
|
+
- NRelay1: handle CLOSED response from COUNT.
|
|
166
|
+
|
|
167
|
+
## 0.36.0 - 2024-09-23
|
|
168
|
+
|
|
169
|
+
## Added
|
|
170
|
+
|
|
171
|
+
- NPool: add generic T extends NRelay.
|
|
172
|
+
- NPool: added `.relays` property.
|
|
173
|
+
- NRelay1: added `.subscriptions` property.
|
|
174
|
+
|
|
175
|
+
## 0.35.0 - 2024-09-23
|
|
176
|
+
|
|
177
|
+
### Added
|
|
178
|
+
|
|
179
|
+
- NPool: added a `.close()` method and support `await using` syntax.
|
|
180
|
+
|
|
181
|
+
### Fixed
|
|
182
|
+
|
|
183
|
+
- NPool: fixed routing of `.req()`.
|
|
184
|
+
|
|
185
|
+
## 0.32.0 - 2024-09-20
|
|
186
|
+
|
|
187
|
+
### Added
|
|
188
|
+
|
|
189
|
+
- NRelay1: added `idleTimeout` option to automatically close inactive connections.
|
|
190
|
+
- NRelay1: support `await using` syntax.
|
|
191
|
+
|
|
192
|
+
## 0.31.0 - 2024-09-09
|
|
193
|
+
|
|
194
|
+
### Added
|
|
195
|
+
|
|
196
|
+
- Added ReplyBotPolicy to block replies from bots in the same second.
|
|
197
|
+
- Added AuthorPolicy to reject events from authors without a kind 0, or with a particular kind 0.
|
|
198
|
+
|
|
199
|
+
### Changed
|
|
200
|
+
|
|
201
|
+
- BREAKING: Moved moderation policies to the `@nostrify/policies` package. Replace `@nostrify/nostrify/policies` with `@nostrify/policies` in your project.
|
|
202
|
+
|
|
203
|
+
### Fixed
|
|
204
|
+
|
|
205
|
+
- BlossomUploader: fixed Authorization header.
|
|
206
|
+
|
|
207
|
+
## 0.30.1 - 2024-08-27
|
|
208
|
+
|
|
209
|
+
### Fixed
|
|
210
|
+
|
|
211
|
+
- NPool: don't throw when the relay list is empty.
|
|
212
|
+
|
|
213
|
+
## 0.30.0 - 2024-08-05
|
|
214
|
+
|
|
215
|
+
### Added
|
|
216
|
+
|
|
217
|
+
- Converted Nostrify into a Deno workspace.
|
|
218
|
+
- BREAKING: NDatabase is now a standalone package, `@nostrify/db`.
|
|
219
|
+
- BREAKING: NDenoKv is now a standalone package, `@nostrify/denokv`.
|
|
220
|
+
|
|
221
|
+
## [0.29.0] - 2024-08-02
|
|
222
|
+
|
|
223
|
+
### Added
|
|
224
|
+
|
|
225
|
+
- NDatabase: implement streaming support with `.req`.
|
|
226
|
+
|
|
227
|
+
## [0.28.0] - 2024-07-29
|
|
228
|
+
|
|
229
|
+
### Fixed
|
|
230
|
+
|
|
231
|
+
- NDatabase: improved performance of all queries.
|
|
232
|
+
|
|
233
|
+
## [0.27.0] - 2024-07-29
|
|
234
|
+
|
|
235
|
+
### Fixed
|
|
236
|
+
|
|
237
|
+
- NDatabase: vastly improve performance of tag queries.
|
|
238
|
+
|
|
239
|
+
### Changed
|
|
240
|
+
|
|
241
|
+
- BREAKING: NDatabase: add kind, pubkey, and created_at columns to nostr_tags table. These columns are non-nullable, so the old database will need to be deleted or manually migrated.
|
|
242
|
+
|
|
243
|
+
## [0.26.3] - 2024-07-18
|
|
244
|
+
|
|
245
|
+
### Fixed
|
|
246
|
+
|
|
247
|
+
- NDatabase: order events by id after created_at.
|
|
248
|
+
|
|
249
|
+
## [0.26.2] - 2024-07-18
|
|
250
|
+
|
|
251
|
+
### Fixed
|
|
252
|
+
|
|
253
|
+
- NDatabase: use unambiguous column names in queries.
|
|
254
|
+
|
|
255
|
+
## [0.26.1] - 2024-07-17
|
|
256
|
+
|
|
257
|
+
### Fixed
|
|
258
|
+
|
|
259
|
+
- NDatabase: fix order of results when the results length exceeds the limit.
|
|
260
|
+
|
|
261
|
+
## [0.26.0] - 2024-07-16
|
|
262
|
+
|
|
263
|
+
### Changed
|
|
264
|
+
|
|
265
|
+
- BREAKING: NPool: remove `reqRelays` option, add `reqRouter`. Rename `eventRelays` to `eventRouter`.
|
|
266
|
+
|
|
267
|
+
## [0.25.0] - 2024-06-29
|
|
268
|
+
|
|
269
|
+
### Added
|
|
270
|
+
|
|
271
|
+
- NDatabase: add `timeout` option to methods for Postgres.
|
|
272
|
+
|
|
273
|
+
## [0.24.0] - 2024-06-27
|
|
274
|
+
|
|
275
|
+
### Added
|
|
276
|
+
|
|
277
|
+
- NDatabase: add `transaction` method.
|
|
278
|
+
|
|
279
|
+
## [0.23.3] - 2024-06-17
|
|
280
|
+
|
|
281
|
+
### Fixed
|
|
282
|
+
|
|
283
|
+
- NDatabase: add intrinsic limits to filters when applicable, skip 0 limit filters.
|
|
284
|
+
|
|
285
|
+
## [0.23.2] - 2024-06-13
|
|
286
|
+
|
|
287
|
+
### Fixed
|
|
288
|
+
|
|
289
|
+
- NDatabase: fix querying by multiple tags.
|
|
290
|
+
|
|
291
|
+
## [0.23.1] - 2024-06-09
|
|
292
|
+
|
|
293
|
+
### Fixed
|
|
294
|
+
|
|
295
|
+
- NDatabase: improve performance of `ids` queries.
|
|
296
|
+
|
|
297
|
+
## [0.23.0] - 2024-06-07
|
|
298
|
+
|
|
299
|
+
### Added
|
|
300
|
+
|
|
301
|
+
- NDatabase: support replaceable event deletions.
|
|
302
|
+
|
|
303
|
+
## [0.22.5] - 2024-06-01
|
|
304
|
+
|
|
305
|
+
### Fixed
|
|
306
|
+
|
|
307
|
+
- NSchema: `created_at` must be a nonnegative integer.
|
|
308
|
+
- Upgrade `nostr-tools` to v2.7.0, remove dependency on `@noble/hashes`.
|
|
309
|
+
- NostrBuildUploader: don't set `dim` tag if nostr.build returns 0 dimensions.
|
|
310
|
+
|
|
311
|
+
## [0.22.4] - 2024-05-24
|
|
312
|
+
|
|
313
|
+
### Changed
|
|
314
|
+
|
|
315
|
+
- Upgrade zod to v3.23.8.
|
|
316
|
+
|
|
317
|
+
## [0.22.3] - 2024-05-24
|
|
318
|
+
|
|
319
|
+
### Added
|
|
320
|
+
|
|
321
|
+
- NostrMetadata: added `display_name` and `bot` fields.
|
|
322
|
+
- NSchema: added `display_name` and `bot` fields to `n.metadata()`.
|
|
323
|
+
|
|
324
|
+
### Fixed
|
|
325
|
+
|
|
326
|
+
- NostrMetadata: added `website` field so `NSchema.metadata()` returns the correct type.
|
|
327
|
+
|
|
328
|
+
### Changed
|
|
329
|
+
|
|
330
|
+
- NSchema: stricter validation of `nip05` as an email-like address.
|
|
331
|
+
- NSchema: stricter validation of `lud06` as a bech32 address.
|
|
332
|
+
- NSchema: stricter validation of `lud16` as an email-like address.
|
|
333
|
+
- NSchema: stricter validation of `picture` and `banner` as URLs.
|
|
334
|
+
|
|
335
|
+
## [0.22.2] - 2024-05-24
|
|
336
|
+
|
|
337
|
+
### Added
|
|
338
|
+
|
|
339
|
+
- NSchema: parse `lud16` more strictly, add `website`.
|
|
340
|
+
|
|
341
|
+
## [0.22.1] - 2024-05-23
|
|
342
|
+
|
|
343
|
+
### Added
|
|
344
|
+
|
|
345
|
+
- Added `HashtagPolicy` to block events with specific hashtags.
|
|
346
|
+
|
|
347
|
+
## [0.22.0] - 2024-05-19
|
|
348
|
+
|
|
349
|
+
### Added
|
|
350
|
+
|
|
351
|
+
- `NUploader` interface and two uploader classes under `@nostrify/nostrify/uploaders`.
|
|
352
|
+
- Blossom uploader (`BlossomUploader`) to upload files to Blossom servers.
|
|
353
|
+
- nostr.build uploader (`NostrBuildUploader`) to upload files to nostr.build.
|
|
354
|
+
- `NIP98` module to verify NIP-98 Requests.
|
|
355
|
+
|
|
356
|
+
## [0.21.1] - 2024-05-18
|
|
357
|
+
|
|
358
|
+
### Changed
|
|
359
|
+
|
|
360
|
+
- NConnectSigner: don't automatically guess the decryption method.
|
|
361
|
+
|
|
362
|
+
## [0.21.0] - 2024-05-18
|
|
363
|
+
|
|
364
|
+
### Added
|
|
365
|
+
|
|
366
|
+
- NConnectSigner: NIP-44 encryption support by setting `{ encryption: 'nip44' }` in the constructor.
|
|
367
|
+
|
|
368
|
+
### Fixed
|
|
369
|
+
|
|
370
|
+
- NDatabase: Postgres FTS now correctly uses the `searchText` option to create the search index.
|
|
371
|
+
|
|
372
|
+
## [0.20.0] - 2024-05-16
|
|
373
|
+
|
|
374
|
+
### Added
|
|
375
|
+
|
|
376
|
+
- NDatabase: Postgres full-text search (FTS) support.
|
|
377
|
+
|
|
378
|
+
### Changed
|
|
379
|
+
|
|
380
|
+
- BREAKING: NDatabase `fts5` option has been renamed to `fts`, and now accepts a string of either `'sqlite'` or `'postgres'`.
|
|
381
|
+
|
|
382
|
+
## [0.19.2] - 2024-05-16
|
|
383
|
+
|
|
384
|
+
### Fixed
|
|
385
|
+
|
|
386
|
+
- NDatabase: fix crash with mixed tag filters.
|
|
387
|
+
|
|
388
|
+
## [0.19.1] - 2024-05-16
|
|
389
|
+
|
|
390
|
+
### Fixed
|
|
391
|
+
|
|
392
|
+
- NDatabase: fix deleting everything for the author when they delete a single event.
|
|
393
|
+
|
|
394
|
+
## [0.19.0] - 2024-05-13
|
|
395
|
+
|
|
396
|
+
### Fixed
|
|
397
|
+
|
|
398
|
+
- Improved performance of NDatabase when querying replaceable events by author.
|
|
399
|
+
- NConnect.signEvent now throws if the connect message was rejected by the relay.
|
|
400
|
+
|
|
401
|
+
## [0.18.0] - 2024-05-04
|
|
402
|
+
|
|
403
|
+
### Added
|
|
404
|
+
|
|
405
|
+
- Added `NSimplePool` class based on SimplePool from nostr-tools.
|
|
406
|
+
|
|
407
|
+
## [0.17.1] - 2024-04-29
|
|
408
|
+
|
|
409
|
+
Redeploy to JSR (to hopefully fix [npm compatibility](https://github.com/jsr-io/jsr/issues/446)).
|
|
410
|
+
|
|
411
|
+
## [0.17.0] - 2024-04-28
|
|
412
|
+
|
|
413
|
+
### Changed
|
|
414
|
+
|
|
415
|
+
- BREAKING: change `NRelay.req` return type from an AsyncGenerator to an AsyncIterable.
|
|
416
|
+
|
|
417
|
+
## [0.16.0] - 2024-04-25
|
|
418
|
+
|
|
419
|
+
### Changed
|
|
420
|
+
|
|
421
|
+
- BREAKING: moved export of `NDenoKv` to `@nostrify/nostrify/denokv`.
|
|
422
|
+
|
|
423
|
+
## [0.15.0] - 2024-04-25
|
|
424
|
+
|
|
425
|
+
### Changed
|
|
426
|
+
|
|
427
|
+
- BREAKING: changed exports of `LNURL`, `Machina`, and `MockRelay` classes.
|
|
428
|
+
|
|
429
|
+
## [0.14.3] - 2024-04-24
|
|
430
|
+
|
|
431
|
+
### Fixed
|
|
432
|
+
|
|
433
|
+
- `NConnectSigner` now closes subscriptions between each call.
|
|
434
|
+
|
|
435
|
+
## [0.14.2] - 2024-04-24
|
|
436
|
+
|
|
437
|
+
### Fixed
|
|
438
|
+
|
|
439
|
+
- `NConnectSigner` - fixed race condition between sending messages and receiving responses.
|
|
440
|
+
|
|
441
|
+
## [0.14.1] - 2024-04-24
|
|
442
|
+
|
|
443
|
+
### Changed
|
|
444
|
+
|
|
445
|
+
- Upgrade `zod` to v3.23.4.
|
|
446
|
+
|
|
447
|
+
## [0.14.0] - 2024-04-24
|
|
448
|
+
|
|
449
|
+
### Fixed
|
|
450
|
+
|
|
451
|
+
- BREAKING: fixed `NConnectSigner.connect` method signature (it doesn't need to accept a pubkey).
|
|
452
|
+
|
|
453
|
+
## [0.13.0] - 2024-04-24
|
|
454
|
+
|
|
455
|
+
### Added
|
|
456
|
+
|
|
457
|
+
- Added Nostr Connect (NIP-46) signer class, `NConnectSigner`.
|
|
458
|
+
|
|
459
|
+
## [0.12.1] - 2024-04-22
|
|
460
|
+
|
|
461
|
+
### Added
|
|
462
|
+
|
|
463
|
+
- Added `InvertPolicy` to take the opposite result of a policy.
|
|
464
|
+
|
|
465
|
+
## [0.12.0] - 2024-04-22
|
|
466
|
+
|
|
467
|
+
### Added
|
|
468
|
+
|
|
469
|
+
- Added `AnyPolicy` policy, a pipeline policy which rejects only if all policies reject.
|
|
470
|
+
|
|
471
|
+
### Changed
|
|
472
|
+
|
|
473
|
+
- BREAKING: Renamed `PipelinePolicy` to `PipePolicy.
|
|
474
|
+
|
|
475
|
+
## [0.11.0] - 2024-04-22
|
|
476
|
+
|
|
477
|
+
### Added
|
|
478
|
+
|
|
479
|
+
- Added moderation policies. Including the `NPolicy` interface and several policies.
|
|
480
|
+
|
|
481
|
+
## [0.10.2] - 2024-04-21
|
|
482
|
+
|
|
483
|
+
### Added
|
|
484
|
+
|
|
485
|
+
- Added Nostr client messages to `NSchema`.
|
|
486
|
+
- Exported `Machina` class to convert callbacks into AsyncGenerators.
|
|
487
|
+
|
|
488
|
+
### Fixed
|
|
489
|
+
|
|
490
|
+
- `NRelay1.count` now works.
|
|
491
|
+
|
|
492
|
+
## [0.10.1] - 2024-04-19
|
|
493
|
+
|
|
494
|
+
### Removed
|
|
495
|
+
|
|
496
|
+
- BREAKING: Removed `close()` method from `NDenoKv` class.
|
|
497
|
+
|
|
498
|
+
## [0.10.0] - 2024-04-19
|
|
499
|
+
|
|
500
|
+
### Added
|
|
501
|
+
|
|
502
|
+
- Added `NDenoKv` storage class, for storing events in Deno KV.
|
|
503
|
+
|
|
504
|
+
[unreleased]: https://gitlab.com/soapbox-pub/nostrify/-/compare/v0.29.0...HEAD
|
|
505
|
+
[0.29.0]: https://gitlab.com/soapbox-pub/nostrify/-/compare/v0.28.0...v0.29.0
|
|
506
|
+
[0.28.0]: https://gitlab.com/soapbox-pub/nostrify/-/compare/v0.27.0...v0.28.0
|
|
507
|
+
[0.27.0]: https://gitlab.com/soapbox-pub/nostrify/-/compare/v0.26.3...v0.27.0
|
|
508
|
+
[0.26.3]: https://gitlab.com/soapbox-pub/nostrify/-/compare/v0.26.2...v0.26.3
|
|
509
|
+
[0.26.2]: https://gitlab.com/soapbox-pub/nostrify/-/compare/v0.26.1...v0.26.2
|
|
510
|
+
[0.26.1]: https://gitlab.com/soapbox-pub/nostrify/-/compare/v0.26.0...v0.26.1
|
|
511
|
+
[0.26.0]: https://gitlab.com/soapbox-pub/nostrify/-/compare/v0.25.0...v0.26.0
|
|
512
|
+
[0.25.0]: https://gitlab.com/soapbox-pub/nostrify/-/compare/v0.24.0...v0.25.0
|
|
513
|
+
[0.24.0]: https://gitlab.com/soapbox-pub/nostrify/-/compare/v0.23.3...v0.24.0
|
|
514
|
+
[0.23.3]: https://gitlab.com/soapbox-pub/nostrify/-/compare/v0.23.2...v0.23.3
|
|
515
|
+
[0.23.2]: https://gitlab.com/soapbox-pub/nostrify/-/compare/v0.23.1...v0.23.2
|
|
516
|
+
[0.23.1]: https://gitlab.com/soapbox-pub/nostrify/-/compare/v0.23.0...v0.23.1
|
|
517
|
+
[0.23.0]: https://gitlab.com/soapbox-pub/nostrify/-/compare/v0.22.5...v0.23.0
|
|
518
|
+
[0.22.5]: https://gitlab.com/soapbox-pub/nostrify/-/compare/v0.22.4...v0.22.5
|
|
519
|
+
[0.22.4]: https://gitlab.com/soapbox-pub/nostrify/-/compare/v0.22.3...v0.22.4
|
|
520
|
+
[0.22.3]: https://gitlab.com/soapbox-pub/nostrify/-/compare/v0.22.2...v0.22.3
|
|
521
|
+
[0.22.2]: https://gitlab.com/soapbox-pub/nostrify/-/compare/v0.22.1...v0.22.2
|
|
522
|
+
[0.22.1]: https://gitlab.com/soapbox-pub/nostrify/-/compare/v0.22.0...v0.22.1
|
|
523
|
+
[0.22.0]: https://gitlab.com/soapbox-pub/nostrify/-/compare/v0.21.1...v0.22.0
|
|
524
|
+
[0.21.1]: https://gitlab.com/soapbox-pub/nostrify/-/compare/v0.21.0...v0.21.1
|
|
525
|
+
[0.21.0]: https://gitlab.com/soapbox-pub/nostrify/-/compare/v0.20.0...v0.21.0
|
|
526
|
+
[0.20.0]: https://gitlab.com/soapbox-pub/nostrify/-/compare/v0.19.2...v0.20.0
|
|
527
|
+
[0.19.2]: https://gitlab.com/soapbox-pub/nostrify/-/compare/v0.19.1...v0.19.2
|
|
528
|
+
[0.19.1]: https://gitlab.com/soapbox-pub/nostrify/-/compare/v0.19.0...v0.19.1
|
|
529
|
+
[0.19.0]: https://gitlab.com/soapbox-pub/nostrify/-/compare/v0.18.0...0.19.0
|
|
530
|
+
[0.18.0]: https://gitlab.com/soapbox-pub/nostrify/-/compare/v0.17.1...0.18.0
|
|
531
|
+
[0.17.1]: https://gitlab.com/soapbox-pub/nostrify/-/compare/v0.17.0...0.17.1
|
|
532
|
+
[0.17.0]: https://gitlab.com/soapbox-pub/nostrify/-/compare/v0.16.0...0.17.0
|
|
533
|
+
[0.16.0]: https://gitlab.com/soapbox-pub/nostrify/-/compare/v0.15.0...0.16.0
|
|
534
|
+
[0.15.0]: https://gitlab.com/soapbox-pub/nostrify/-/compare/v0.14.3...0.15.0
|
|
535
|
+
[0.14.3]: https://gitlab.com/soapbox-pub/nostrify/-/compare/v0.14.2...v0.14.3
|
|
536
|
+
[0.14.2]: https://gitlab.com/soapbox-pub/nostrify/-/compare/v0.14.1...v0.14.2
|
|
537
|
+
[0.14.1]: https://gitlab.com/soapbox-pub/nostrify/-/compare/v0.14.0...v0.14.1
|
|
538
|
+
[0.14.0]: https://gitlab.com/soapbox-pub/nostrify/-/compare/v0.13.0...v0.14.0
|
|
539
|
+
[0.13.0]: https://gitlab.com/soapbox-pub/nostrify/-/compare/v0.12.1...v0.13.0
|
|
540
|
+
[0.12.1]: https://gitlab.com/soapbox-pub/nostrify/-/compare/v0.12.0...v0.12.1
|
|
541
|
+
[0.12.0]: https://gitlab.com/soapbox-pub/nostrify/-/compare/v0.11.0...v0.12.0
|
|
542
|
+
[0.11.0]: https://gitlab.com/soapbox-pub/nostrify/-/compare/v0.10.2...v0.11.0
|
|
543
|
+
[0.10.2]: https://gitlab.com/soapbox-pub/nostrify/-/compare/v0.10.1...v0.10.2
|
|
544
|
+
[0.10.1]: https://gitlab.com/soapbox-pub/nostrify/-/compare/v0.10.0...v0.10.1
|
|
545
|
+
[0.10.0]: https://gitlab.com/soapbox-pub/nostrify/-/compare/v0.9.7...v0.10.0
|
|
546
|
+
[0.9.7]: https://gitlab.com/soapbox-pub/nostrify/-/compare/v0.9.6...v0.9.7
|
|
547
|
+
[0.9.6]: https://gitlab.com/soapbox-pub/nostrify/-/compare/v0.9.5...v0.9.6
|
|
548
|
+
[0.9.5]: https://gitlab.com/soapbox-pub/nostrify/-/compare/v0.9.4...v0.9.5
|
|
549
|
+
[0.9.4]: https://gitlab.com/soapbox-pub/nostrify/-/compare/v0.9.3...v0.9.4
|
|
550
|
+
[0.9.3]: https://gitlab.com/soapbox-pub/nostrify/-/compare/v0.9.2...v0.9.3
|
|
551
|
+
[0.9.2]: https://gitlab.com/soapbox-pub/nostrify/-/compare/v0.9.1...v0.9.2
|
|
552
|
+
[0.9.1]: https://gitlab.com/soapbox-pub/nostrify/-/compare/v0.9.0...v0.9.1
|
|
553
|
+
[0.9.0]: https://gitlab.com/soapbox-pub/nostrify/-/compare/v0.8.1...v0.9.0
|
|
554
|
+
[0.8.1]: https://gitlab.com/soapbox-pub/nostrify/-/compare/v0.8.0...v0.8.1
|
|
555
|
+
[0.8.0]: https://gitlab.com/soapbox-pub/nostrify/-/compare/v0.7.0...v0.8.0
|
|
556
|
+
[0.7.0]: https://gitlab.com/soapbox-pub/nostrify/-/compare/v0.6.0...v0.7.0
|
|
557
|
+
[0.6.0]: https://gitlab.com/soapbox-pub/nostrify/-/compare/v0.5.0...v0.6.0
|
|
558
|
+
[0.5.0]: https://gitlab.com/soapbox-pub/nostrify/-/compare/v0.4.0...v0.5.0
|
|
559
|
+
[0.4.0]: https://gitlab.com/soapbox-pub/nostrify/-/compare/v0.3.0...v0.4.0
|
|
560
|
+
[0.3.0]: https://gitlab.com/soapbox-pub/nostrify/-/compare/v0.2.0...v0.3.0
|
|
561
|
+
[0.2.0]: https://gitlab.com/soapbox-pub/nostrify/-/compare/v0.1.0...v0.2.0
|
|
562
|
+
[0.1.0]: https://gitlab.com/soapbox-pub/nostrify/-/tags/v0.1.0
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2023 Alex Gleason
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|