@qntx/nostr 0.9.0 → 0.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE-APACHE +201 -0
- package/README.md +9 -19
- package/dist/client.d.mts +1 -1
- package/dist/core.d.mts +1 -2
- package/dist/{index-D0M3kjY2.d.mts → index-B1fLejg4.d.mts} +2 -2
- package/dist/{index-JD1O7m2v.d.mts → index-CLJEKFGd.d.mts} +2 -2
- package/dist/{index-C1m5cHpd.d.mts → index-uCYwXaaP.d.mts} +3 -3
- package/dist/index.d.mts +5 -6
- package/dist/loaders.d.mts +1 -1
- package/dist/{pool-BDI_u03Q.d.mts → pool-Bfe3Tu40.d.mts} +2 -3
- package/dist/relay.d.mts +3 -3
- package/dist/testing.d.mts +6 -0
- package/dist/testing.mjs +25 -3
- package/dist/testing.mjs.map +1 -1
- package/dist/{message-CcUz22qh.d.mts → verifier-9c-bINrv.d.mts} +21 -2
- package/package.json +21 -46
- package/dist/instance-CI_IaZpf.mjs +0 -220
- package/dist/instance-CI_IaZpf.mjs.map +0 -1
- package/dist/instance-X_WkCnpR.d.mts +0 -15
- package/dist/nostr_crypto_wasm_bg-Czrdty7Q.mjs +0 -4
- package/dist/nostr_crypto_wasm_bg.wasm +0 -0
- package/dist/verifier-BjL2M0ka.d.mts +0 -22
- package/dist/wasm.browser.d.mts +0 -8
- package/dist/wasm.browser.mjs +0 -19
- package/dist/wasm.browser.mjs.map +0 -1
- package/dist/wasm.d.mts +0 -8
- package/dist/wasm.mjs +0 -28
- package/dist/wasm.mjs.map +0 -1
- /package/{LICENSE → LICENSE-MIT} +0 -0
package/LICENSE-APACHE
ADDED
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
+
the copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
+
other entities that control, are controlled by, or are under common
|
|
17
|
+
control with that entity. For the purposes of this definition,
|
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
+
direction or management of such entity, whether by contract or
|
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
+
|
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
+
exercising permissions granted by this License.
|
|
25
|
+
|
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
+
including but not limited to software source code, documentation
|
|
28
|
+
source, and configuration files.
|
|
29
|
+
|
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
|
31
|
+
transformation or translation of a Source form, including but
|
|
32
|
+
not limited to compiled object code, generated documentation,
|
|
33
|
+
and conversions to other media types.
|
|
34
|
+
|
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
+
Object form, made available under the License, as indicated by a
|
|
37
|
+
copyright notice that is included in or attached to the work
|
|
38
|
+
(an example is provided in the Appendix below).
|
|
39
|
+
|
|
40
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
+
form, that is based on (or derived from) the Work and for which the
|
|
42
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
+
of this License, Derivative Works shall not include works that remain
|
|
45
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
+
the Work and Derivative Works thereof.
|
|
47
|
+
|
|
48
|
+
"Contribution" shall mean any work of authorship, including
|
|
49
|
+
the original version of the Work and any modifications or additions
|
|
50
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
52
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
+
means any form of electronic, verbal, or written communication sent
|
|
55
|
+
to the Licensor or its representatives, including but not limited to
|
|
56
|
+
communication on electronic mailing lists, source code control systems,
|
|
57
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
+
excluding communication that is conspicuously marked or otherwise
|
|
60
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
+
|
|
62
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
64
|
+
subsequently incorporated within the Work.
|
|
65
|
+
|
|
66
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
+
Work and such Derivative Works in Source or Object form.
|
|
72
|
+
|
|
73
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
+
(except as stated in this section) patent license to make, have made,
|
|
77
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
+
where such license applies only to those patent claims licensable
|
|
79
|
+
by such Contributor that are necessarily infringed by their
|
|
80
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
+
institute patent litigation against any entity (including a
|
|
83
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
+
or contributory patent infringement, then any patent licenses
|
|
86
|
+
granted to You under this License for that Work shall terminate
|
|
87
|
+
as of the date such litigation is filed.
|
|
88
|
+
|
|
89
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
+
modifications, and in Source or Object form, provided that You
|
|
92
|
+
meet the following conditions:
|
|
93
|
+
|
|
94
|
+
(a) You must give any other recipients of the Work or
|
|
95
|
+
Derivative Works a copy of this License; and
|
|
96
|
+
|
|
97
|
+
(b) You must cause any modified files to carry prominent notices
|
|
98
|
+
stating that You changed the files; and
|
|
99
|
+
|
|
100
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
+
that You distribute, all copyright, patent, trademark, and
|
|
102
|
+
attribution notices from the Source form of the Work,
|
|
103
|
+
excluding those notices that do not pertain to any part of
|
|
104
|
+
the Derivative Works; and
|
|
105
|
+
|
|
106
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
+
distribution, then any Derivative Works that You distribute must
|
|
108
|
+
include a readable copy of the attribution notices contained
|
|
109
|
+
within such NOTICE file, excluding those notices that do not
|
|
110
|
+
pertain to any part of the Derivative Works, in at least one
|
|
111
|
+
of the following places: within a NOTICE text file distributed
|
|
112
|
+
as part of the Derivative Works; within the Source form or
|
|
113
|
+
documentation, if provided along with the Derivative Works; or,
|
|
114
|
+
within a display generated by the Derivative Works, if and
|
|
115
|
+
wherever such third-party notices normally appear. The contents
|
|
116
|
+
of the NOTICE file are for informational purposes only and
|
|
117
|
+
do not modify the License. You may add Your own attribution
|
|
118
|
+
notices within Derivative Works that You distribute, alongside
|
|
119
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
120
|
+
that such additional attribution notices cannot be construed
|
|
121
|
+
as modifying the License.
|
|
122
|
+
|
|
123
|
+
You may add Your own copyright statement to Your modifications and
|
|
124
|
+
may provide additional or different license terms and conditions
|
|
125
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
+
the conditions stated in this License.
|
|
129
|
+
|
|
130
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
+
this License, without any additional terms or conditions.
|
|
134
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
+
the terms of any separate license agreement you may have executed
|
|
136
|
+
with Licensor regarding such Contributions.
|
|
137
|
+
|
|
138
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
+
except as required for reasonable and customary use in describing the
|
|
141
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
142
|
+
|
|
143
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
+
implied, including, without limitation, any warranties or conditions
|
|
148
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
+
appropriateness of using or redistributing the Work and assume any
|
|
151
|
+
risks associated with Your exercise of permissions under this License.
|
|
152
|
+
|
|
153
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
+
unless required by applicable law (such as deliberate and grossly
|
|
156
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
+
liable to You for damages, including any direct, indirect, special,
|
|
158
|
+
incidental, or consequential damages of any character arising as a
|
|
159
|
+
result of this License or out of the use or inability to use the
|
|
160
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
+
other commercial damages or losses), even if such Contributor
|
|
163
|
+
has been advised of the possibility of such damages.
|
|
164
|
+
|
|
165
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
166
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
167
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
168
|
+
or other liability obligations and/or rights consistent with this
|
|
169
|
+
License. However, in accepting such obligations, You may act only
|
|
170
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
171
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
172
|
+
defend, and hold each Contributor harmless for any liability
|
|
173
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
174
|
+
of your accepting any such warranty or additional liability.
|
|
175
|
+
|
|
176
|
+
END OF TERMS AND CONDITIONS
|
|
177
|
+
|
|
178
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
179
|
+
|
|
180
|
+
To apply the Apache License to your work, attach the following
|
|
181
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
182
|
+
replaced with your own identifying information. (Don't include
|
|
183
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
184
|
+
comment syntax for the file format. We also recommend that a
|
|
185
|
+
file or class name and description of purpose be included on the
|
|
186
|
+
same "printed page" as the copyright notice for easier
|
|
187
|
+
identification within third-party archives.
|
|
188
|
+
|
|
189
|
+
Copyright [yyyy] [name of copyright owner]
|
|
190
|
+
|
|
191
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
192
|
+
you may not use this file except in compliance with the License.
|
|
193
|
+
You may obtain a copy of the License at
|
|
194
|
+
|
|
195
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
196
|
+
|
|
197
|
+
Unless required by applicable law or agreed to in writing, software
|
|
198
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
199
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
200
|
+
See the License for the specific language governing permissions and
|
|
201
|
+
limitations under the License.
|
package/README.md
CHANGED
|
@@ -1,25 +1,15 @@
|
|
|
1
|
-
|
|
1
|
+
# @qntx/nostr
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Nostr protocol implementation and SDK in TypeScript: events, keys, filters, signers, relays, storage, gossip, and a `Client` facade in one ESM package.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
```bash
|
|
6
|
+
npm install @qntx/nostr
|
|
7
|
+
```
|
|
6
8
|
|
|
7
|
-
|
|
9
|
+
Subpath entry points mirror the layering: `/core`, `/signer`, `/relay`, `/client`, `/storage`, `/store`, `/loaders`, `/gossip`, `/nips/*`, `/testing`.
|
|
8
10
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
Licensed under the MIT License ([LICENSE](LICENSE) or <https://opensource.org/licenses/MIT>).
|
|
12
|
-
|
|
13
|
-
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in this project shall be licensed as above, without any additional terms or conditions.
|
|
14
|
-
|
|
15
|
-
---
|
|
11
|
+
For WebAssembly-accelerated signing and verification, install [`@qntx/nostr-wasm`](https://www.npmjs.com/package/@qntx/nostr-wasm) and inject its `SigningBackend`/`EventVerifier` (see that package's README).
|
|
16
12
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
A **[QuantX](https://qntx.org)** open-source project.
|
|
20
|
-
|
|
21
|
-
<a href="https://qntx.org"><img alt="QuantX" width="369" src="https://raw.githubusercontent.com/qntx/.github/main/profile/qntx.svg" /></a>
|
|
22
|
-
|
|
23
|
-
Code is law. We write both.
|
|
13
|
+
## License
|
|
24
14
|
|
|
25
|
-
|
|
15
|
+
MIT OR Apache-2.0
|
package/dist/client.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { _ as SyncSummary, a as FetchEachOptions, c as PrivateMessageSendResult, d as SendPrivateMessageOptions, f as SubscribeOptions, g as SyncOptions, h as SyncDirectionName, i as ClientOptions, l as PublishOptions, m as SyncDirection, n as ClientError, o as FetchEventsOptions, p as SubscribePrivateMessagesOptions, r as ClientEventMap, s as FetchPrivateMessagesOptions, t as Client, u as ReceivedPrivateMessage } from "./index-
|
|
1
|
+
import { _ as SyncSummary, a as FetchEachOptions, c as PrivateMessageSendResult, d as SendPrivateMessageOptions, f as SubscribeOptions, g as SyncOptions, h as SyncDirectionName, i as ClientOptions, l as PublishOptions, m as SyncDirection, n as ClientError, o as FetchEventsOptions, p as SubscribePrivateMessagesOptions, r as ClientEventMap, s as FetchPrivateMessagesOptions, t as Client, u as ReceivedPrivateMessage } from "./index-uCYwXaaP.mjs";
|
|
2
2
|
export { Client, ClientError, type ClientEventMap, type ClientOptions, type FetchEachOptions, type FetchEventsOptions, type FetchPrivateMessagesOptions, type PrivateMessageSendResult, type PublishOptions, type ReceivedPrivateMessage, type SendPrivateMessageOptions, type SubscribeOptions, type SubscribePrivateMessagesOptions, SyncDirection, type SyncDirectionName, type SyncOptions, type SyncSummary };
|
package/dist/core.d.mts
CHANGED
|
@@ -2,8 +2,7 @@ import { C as tagName, S as parseEventAddress, _ as eventAddress, a as isMarkedF
|
|
|
2
2
|
import { a as SigningBackend, c as publicKeyFromHex, i as SecretKeyInput, l as signEvent, n as PublicKey, o as finalizeEvent, r as SecretKey, s as getPublicKey, t as Keys, u as toSecretKey } from "./key-CyKN1RTi.mjs";
|
|
3
3
|
import { n as ProfileMetadata, t as EventBuilder } from "./builder-GBddxj8i.mjs";
|
|
4
4
|
import { a as getFilterLimit, i as filterFingerprint, n as canonicalizeFilter, o as matchFilter, r as canonicalizeFilters, s as matchFilters, t as Filter } from "./filter-CfEgQBXt.mjs";
|
|
5
|
-
import { a as
|
|
6
|
-
import { i as verifyEvent, n as SerializedEventVerifier, r as createEventVerifier, t as EventVerifier } from "./verifier-BjL2M0ka.mjs";
|
|
5
|
+
import { a as ClientMessage, c as SubscriptionId, d as encodeClientMessage, f as encodeRelayMessage, h as parseRelayMessage, i as verifyEvent, l as assertSubscriptionId, m as parseClientMessage, n as SerializedEventVerifier, o as CountResult, p as mergeCountHll, r as createEventVerifier, s as RelayMessage, t as EventVerifier, u as createSubscriptionId } from "./verifier-9c-bINrv.mjs";
|
|
7
6
|
import { a as NostrError, i as MessageError, n as EventValidationError, o as UrlError, r as HexError, s as WasmPoisonedError, t as CryptoError } from "./error-BquXDmIN.mjs";
|
|
8
7
|
import { S as SUBSCRIPTION_ID_MAX_CHARS, _ as normalizeURL, a as classifyKind, b as SECRET_KEY_BYTES, c as isRegularKind, d as assertSecretKeyBytes, f as bytesToHex, g as normalizeRelayUrls, h as isHex64, i as KnownKind, l as isReplaceableKind, m as isHex32, n as KindClassification, o as isAddressableKind, p as hexToBytes, r as KindName, s as isEphemeralKind, t as Kind, u as assertHex32, v as EVENT_ID_BYTES, x as SIGNATURE_BYTES, y as PUBLIC_KEY_BYTES } from "./index-Hp26bgYG.mjs";
|
|
9
8
|
export { type ClientMessage, type CountResult, CryptoError, EVENT_ID_BYTES, type Event, type EventAddress, EventBuilder, type EventTemplate, EventValidationError, type EventVerifier, type Filter, HexError, Keys, Kind, type KindClassification, type KindName, type KnownKind, MessageError, NostrError, PUBLIC_KEY_BYTES, type ProfileMetadata, type PublicKey, type RelayMessage, SECRET_KEY_BYTES, SIGNATURE_BYTES, SUBSCRIPTION_ID_MAX_CHARS, SecretKey, type SecretKeyInput, type SerializedEventVerifier, type SigningBackend, type SubscriptionId, Tag, type TagInput, type UnsignedEvent, UrlError, WasmPoisonedError, assertHex32, assertSecretKeyBytes, assertSubscriptionId, bytesToHex, canonicalizeFilter, canonicalizeFilters, classifyKind, createEventVerifier, createSubscriptionId, encodeClientMessage, encodeRelayMessage, eventAddress, filterFingerprint, finalizeEvent, firstTagValue, formatEventAddress, getDTag, getEventHash, getFilterLimit, getPublicKey, hexToBytes, isAddressableKind, isEphemeralKind, isHex32, isHex64, isMarkedFailed, isRegularKind, isReplaceableKind, isReplaceableWinner, isTag, itemCompare, matchFilter, matchFilters, mergeCountHll, normalizeRelayUrls, normalizeURL, parseClientMessage, parseEventAddress, parseRelayMessage, publicKeyFromHex, serializeEvent, signEvent, signedMatchesUnsigned, sortEvents, sortedEvents, tagName, tagValue, toSecretKey, validateEvent, validateSignedEvent, verifyEvent };
|
|
@@ -3,7 +3,7 @@ import { n as ProfileMetadata } from "./builder-GBddxj8i.mjs";
|
|
|
3
3
|
import { t as RelayListItem } from "./nip65-BL79HI8N.mjs";
|
|
4
4
|
import { t as Gossip } from "./gossip-BWb9HmfK.mjs";
|
|
5
5
|
import { a as NostrError } from "./error-BquXDmIN.mjs";
|
|
6
|
-
import { _ as Closer, n as Pool } from "./pool-
|
|
6
|
+
import { _ as Closer, n as Pool } from "./pool-Bfe3Tu40.mjs";
|
|
7
7
|
import { r as OutboxBound, t as EventStore } from "./types-Ccox7-5v.mjs";
|
|
8
8
|
import { t as ReactiveEventStore } from "./reactive-X4p6nABy.mjs";
|
|
9
9
|
import { i as EventPointer, t as AddressPointer } from "./nip19-DpPN17bY.mjs";
|
|
@@ -186,4 +186,4 @@ type CreateLoadersOptions = {
|
|
|
186
186
|
declare function createLoaders(opts: CreateLoadersOptions): Loaders;
|
|
187
187
|
//#endregion
|
|
188
188
|
export { EventRef as _, OutboxFeed as a, NostrUser as c, ListLoaders as d, ListResult as f, EventLoader as g, ReplaceableLoader as h, OutboxError as i, ProfileLoader as l, ReplaceableLoadResult as m, Loaders as n, OutboxFeedOptions as o, LoadStyle as p, createLoaders as r, groupAuthorsByOutboxRelay as s, CreateLoadersOptions as t, bareNostrUser as u };
|
|
189
|
-
//# sourceMappingURL=index-
|
|
189
|
+
//# sourceMappingURL=index-B1fLejg4.d.mts.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { t as Event } from "./event-j3BwI5dF.mjs";
|
|
2
2
|
import { t as Filter } from "./filter-CfEgQBXt.mjs";
|
|
3
3
|
import { a as NostrError } from "./error-BquXDmIN.mjs";
|
|
4
|
-
import { _ as Closer, n as Pool } from "./pool-
|
|
4
|
+
import { _ as Closer, n as Pool } from "./pool-Bfe3Tu40.mjs";
|
|
5
5
|
//#region src/relay/error.d.ts
|
|
6
6
|
/** Base class for relay errors; carries the relay URL when known. */
|
|
7
7
|
declare class RelayError extends NostrError {
|
|
@@ -79,4 +79,4 @@ declare function fetchRouted(pool: Pool, jobs: ReadonlyArray<RoutedJob>, opts?:
|
|
|
79
79
|
}): Promise<Event[]>;
|
|
80
80
|
//#endregion
|
|
81
81
|
export { isInsecureRelayUrl as a, RelayError as c, RelayTimeoutError as d, fetchRouted as i, RelayPublishError as l, RoutedJob as n, RelayClosedError as o, fanIn as r, RelayConnectionError as s, FanInOptions as t, RelaySuspendedError as u };
|
|
82
|
-
//# sourceMappingURL=index-
|
|
82
|
+
//# sourceMappingURL=index-CLJEKFGd.d.mts.map
|
|
@@ -3,10 +3,10 @@ import { t as EventBuilder } from "./builder-GBddxj8i.mjs";
|
|
|
3
3
|
import { t as Filter } from "./filter-CfEgQBXt.mjs";
|
|
4
4
|
import { t as Gossip } from "./gossip-BWb9HmfK.mjs";
|
|
5
5
|
import { a as NostrError } from "./error-BquXDmIN.mjs";
|
|
6
|
-
import { _ as Closer, a as PoolFetchResult, n as Pool, o as PoolOptions, s as PoolPublishResult } from "./pool-
|
|
6
|
+
import { _ as Closer, a as PoolFetchResult, n as Pool, o as PoolOptions, s as PoolPublishResult } from "./pool-Bfe3Tu40.mjs";
|
|
7
7
|
import { t as EventStore } from "./types-Ccox7-5v.mjs";
|
|
8
8
|
import { t as ReactiveEventStore } from "./reactive-X4p6nABy.mjs";
|
|
9
|
-
import { a as OutboxFeed, n as Loaders } from "./index-
|
|
9
|
+
import { a as OutboxFeed, n as Loaders } from "./index-B1fLejg4.mjs";
|
|
10
10
|
import { a as Rumor } from "./nip59-CdDoJptA.mjs";
|
|
11
11
|
import { i as ReplyTo, r as Recipient } from "./nip17-B7MI82Iq.mjs";
|
|
12
12
|
import { t as NostrSigner } from "./types-BJ4wZ7JJ.mjs";
|
|
@@ -290,4 +290,4 @@ declare class Client {
|
|
|
290
290
|
}
|
|
291
291
|
//#endregion
|
|
292
292
|
export { SyncSummary as _, FetchEachOptions as a, PrivateMessageSendResult as c, SendPrivateMessageOptions as d, SubscribeOptions as f, SyncOptions as g, SyncDirectionName as h, ClientOptions as i, PublishOptions as l, SyncDirection as m, ClientError as n, FetchEventsOptions as o, SubscribePrivateMessagesOptions as p, ClientEventMap as r, FetchPrivateMessagesOptions as s, Client as t, ReceivedPrivateMessage as u };
|
|
293
|
-
//# sourceMappingURL=index-
|
|
293
|
+
//# sourceMappingURL=index-uCYwXaaP.d.mts.map
|
package/dist/index.d.mts
CHANGED
|
@@ -4,23 +4,22 @@ import { n as ProfileMetadata, t as EventBuilder } from "./builder-GBddxj8i.mjs"
|
|
|
4
4
|
import { a as getFilterLimit, i as filterFingerprint, n as canonicalizeFilter, o as matchFilter, r as canonicalizeFilters, s as matchFilters, t as Filter } from "./filter-CfEgQBXt.mjs";
|
|
5
5
|
import { a as relayListEventBuilder, i as readRelays, n as RelayMarker, o as relayListToTags, r as parseRelayList, s as writeRelays, t as RelayListItem } from "./nip65-BL79HI8N.mjs";
|
|
6
6
|
import { i as RoutedFilter, r as PubkeyRoutes, t as Gossip } from "./gossip-BWb9HmfK.mjs";
|
|
7
|
-
import { a as
|
|
8
|
-
import { i as verifyEvent, n as SerializedEventVerifier, r as createEventVerifier, t as EventVerifier } from "./verifier-BjL2M0ka.mjs";
|
|
7
|
+
import { a as ClientMessage, c as SubscriptionId, d as encodeClientMessage, f as encodeRelayMessage, h as parseRelayMessage, i as verifyEvent, l as assertSubscriptionId, m as parseClientMessage, n as SerializedEventVerifier, o as CountResult, p as mergeCountHll, r as createEventVerifier, s as RelayMessage, t as EventVerifier, u as createSubscriptionId } from "./verifier-9c-bINrv.mjs";
|
|
9
8
|
import { a as NostrError, i as MessageError, n as EventValidationError, o as UrlError, r as HexError, s as WasmPoisonedError, t as CryptoError } from "./error-BquXDmIN.mjs";
|
|
10
|
-
import { _ as Closer, a as PoolFetchResult, c as PoolSubscribeOptions, d as RelayOptions, f as RelayStatus, g as RelayFetchResult, h as RelayFetchEnd, i as PoolEventMap, l as Relay, m as PublishResult, n as Pool, o as PoolOptions, p as RelayStatusName, r as PoolCountResult, s as PoolPublishResult, t as InvalidEventPolicy, u as RelayEventMap, v as RelaySubscription, y as SubscribeOptions } from "./pool-
|
|
9
|
+
import { _ as Closer, a as PoolFetchResult, c as PoolSubscribeOptions, d as RelayOptions, f as RelayStatus, g as RelayFetchResult, h as RelayFetchEnd, i as PoolEventMap, l as Relay, m as PublishResult, n as Pool, o as PoolOptions, p as RelayStatusName, r as PoolCountResult, s as PoolPublishResult, t as InvalidEventPolicy, u as RelayEventMap, v as RelaySubscription, y as SubscribeOptions } from "./pool-Bfe3Tu40.mjs";
|
|
11
10
|
import { i as useWebSocketImplementation } from "./websocket-CmeqvAkp.mjs";
|
|
12
11
|
import { i as PutResult, n as NegentropyItem, r as OutboxBound, t as EventStore } from "./types-Ccox7-5v.mjs";
|
|
13
12
|
import { i as Watch, n as ReactiveEventStoreEventMap, r as ReactiveEventStoreOptions, t as ReactiveEventStore } from "./reactive-X4p6nABy.mjs";
|
|
14
13
|
import { _ as noteEncode, a as NAddr, b as nsecEncode, c as NPub, d as Note, f as ProfilePointer, g as neventEncode, h as naddrEncode, i as EventPointer, l as NSec, n as Bech32MaxSize, o as NEvent, p as decode, r as DecodedResult, s as NProfile, t as AddressPointer, u as Nip19Error, v as nprofileEncode, y as npubEncode } from "./nip19-DpPN17bY.mjs";
|
|
15
|
-
import { a as OutboxFeed, c as NostrUser, f as ListResult, h as ReplaceableLoader, i as OutboxError, m as ReplaceableLoadResult, n as Loaders, o as OutboxFeedOptions, p as LoadStyle, r as createLoaders, s as groupAuthorsByOutboxRelay, u as bareNostrUser } from "./index-
|
|
14
|
+
import { a as OutboxFeed, c as NostrUser, f as ListResult, h as ReplaceableLoader, i as OutboxError, m as ReplaceableLoadResult, n as Loaders, o as OutboxFeedOptions, p as LoadStyle, r as createLoaders, s as groupAuthorsByOutboxRelay, u as bareNostrUser } from "./index-B1fLejg4.mjs";
|
|
16
15
|
import { t as NostrSigner } from "./types-BJ4wZ7JJ.mjs";
|
|
17
16
|
import { t as StorageError } from "./error-BD_0QFKT.mjs";
|
|
18
|
-
import { _ as SyncSummary, c as PrivateMessageSendResult, d as SendPrivateMessageOptions, g as SyncOptions, h as SyncDirectionName, i as ClientOptions, m as SyncDirection, n as ClientError, p as SubscribePrivateMessagesOptions, r as ClientEventMap, s as FetchPrivateMessagesOptions, t as Client, u as ReceivedPrivateMessage } from "./index-
|
|
17
|
+
import { _ as SyncSummary, c as PrivateMessageSendResult, d as SendPrivateMessageOptions, g as SyncOptions, h as SyncDirectionName, i as ClientOptions, m as SyncDirection, n as ClientError, p as SubscribePrivateMessagesOptions, r as ClientEventMap, s as FetchPrivateMessagesOptions, t as Client, u as ReceivedPrivateMessage } from "./index-uCYwXaaP.mjs";
|
|
19
18
|
import { S as SUBSCRIPTION_ID_MAX_CHARS, _ as normalizeURL, a as classifyKind, b as SECRET_KEY_BYTES, c as isRegularKind, f as bytesToHex, h as isHex64, i as KnownKind, l as isReplaceableKind, m as isHex32, n as KindClassification, o as isAddressableKind, p as hexToBytes, r as KindName, s as isEphemeralKind, t as Kind, v as EVENT_ID_BYTES, x as SIGNATURE_BYTES, y as PUBLIC_KEY_BYTES } from "./index-Hp26bgYG.mjs";
|
|
20
19
|
import { a as Nip07Signer, c as isNip07Available, i as Nip46Transport, l as KeysSigner, n as Nip46SignerOptions, o as WindowNostr, r as Nip46SubscribeOptions, s as getWindowNostr, t as Nip46Signer, u as NoSignerError } from "./index-C0mFpelb.mjs";
|
|
21
20
|
import { Nip21Error, NostrURI, isNostrURI, parseNostrURI } from "./nips/nip21.mjs";
|
|
22
21
|
import { ReplyTagsOptions, ThreadReferences, buildReplyTags, parseThreadTags, replyTo } from "./nips/nip10.mjs";
|
|
23
22
|
import { isAuthRequired, makeAuthEvent } from "./nips/nip42.mjs";
|
|
24
|
-
import { a as isInsecureRelayUrl, c as RelayError, d as RelayTimeoutError, l as RelayPublishError, o as RelayClosedError, s as RelayConnectionError, u as RelaySuspendedError } from "./index-
|
|
23
|
+
import { a as isInsecureRelayUrl, c as RelayError, d as RelayTimeoutError, l as RelayPublishError, o as RelayClosedError, s as RelayConnectionError, u as RelaySuspendedError } from "./index-CLJEKFGd.mjs";
|
|
25
24
|
import { a as IndexedDbEventStoreOptions, i as IndexedDbEventStore, n as SqlValue, o as MemoryEventStore, r as SqliteEventStore, t as SqlDriver } from "./index-CoX7SnO7.mjs";
|
|
26
25
|
export { type AddressPointer, Bech32MaxSize, Client, ClientError, type ClientEventMap, type ClientMessage, type ClientOptions, type Closer, type CountResult, CryptoError, type DecodedResult, EVENT_ID_BYTES, type Event, type EventAddress, EventBuilder, type EventPointer, type EventStore, type EventTemplate, EventValidationError, type EventVerifier, type FetchPrivateMessagesOptions, type Filter, Gossip, HexError, IndexedDbEventStore, type IndexedDbEventStoreOptions, type InvalidEventPolicy, Keys, KeysSigner, Kind, type KindClassification, type KindName, type KnownKind, type ListResult, type LoadStyle, type Loaders, MemoryEventStore, MessageError, type NAddr, type NEvent, type NProfile, type NPub, type NSec, type NegentropyItem, Nip07Signer, Nip19Error, Nip21Error, Nip46Signer, type Nip46SignerOptions, type Nip46SubscribeOptions, type Nip46Transport, NoSignerError, NostrError, type NostrSigner, type NostrURI, type NostrUser, type Note, type OutboxBound, OutboxError, OutboxFeed, type OutboxFeedOptions, PUBLIC_KEY_BYTES, Pool, type PoolCountResult, type PoolEventMap, type PoolFetchResult, type PoolOptions, type PoolPublishResult, type PoolSubscribeOptions, type PrivateMessageSendResult, type ProfileMetadata, type ProfilePointer, type PubkeyRoutes, type PublicKey, type PublishResult, type PutResult, ReactiveEventStore, type ReactiveEventStoreEventMap, type ReactiveEventStoreOptions, type ReceivedPrivateMessage, Relay, RelayClosedError, RelayConnectionError, RelayError, type RelayEventMap, type RelayFetchEnd, type RelayFetchResult, type RelayListItem, type RelayMarker, type RelayMessage, type RelayOptions, RelayPublishError, RelayStatus, type RelayStatusName, type RelaySubscription, RelaySuspendedError, RelayTimeoutError, type ReplaceableLoadResult, type ReplaceableLoader, type ReplyTagsOptions, type RoutedFilter, SECRET_KEY_BYTES, SIGNATURE_BYTES, SUBSCRIPTION_ID_MAX_CHARS, SecretKey, type SecretKeyInput, type SendPrivateMessageOptions, type SerializedEventVerifier, type SigningBackend, type SqlDriver, type SqlValue, SqliteEventStore, StorageError, type SubscribeOptions, type SubscribePrivateMessagesOptions, type SubscriptionId, SyncDirection, type SyncDirectionName, type SyncOptions, type SyncSummary, Tag, type TagInput, type ThreadReferences, type UnsignedEvent, UrlError, WasmPoisonedError, type Watch, type WindowNostr, assertSubscriptionId, bareNostrUser, buildReplyTags, bytesToHex, canonicalizeFilter, canonicalizeFilters, classifyKind, createEventVerifier, createLoaders, createSubscriptionId, encodeClientMessage, encodeRelayMessage, eventAddress, filterFingerprint, finalizeEvent, formatEventAddress, getDTag, getEventHash, getFilterLimit, getPublicKey, getWindowNostr, groupAuthorsByOutboxRelay, hexToBytes, isAddressableKind, isAuthRequired, isEphemeralKind, isHex32, isHex64, isInsecureRelayUrl, isNip07Available, isNostrURI, isRegularKind, isReplaceableKind, isReplaceableWinner, isTag, itemCompare, makeAuthEvent, matchFilter, matchFilters, mergeCountHll, naddrEncode, neventEncode, decode as nip19Decode, normalizeURL, noteEncode, nprofileEncode, npubEncode, nsecEncode, parseClientMessage, parseEventAddress, parseNostrURI, parseRelayList, parseRelayMessage, parseThreadTags, publicKeyFromHex, readRelays, relayListEventBuilder, relayListToTags, replyTo, serializeEvent, signEvent, signedMatchesUnsigned, sortEvents, sortedEvents, tagName, tagValue, toSecretKey, useWebSocketImplementation, validateEvent, validateSignedEvent, verifyEvent, writeRelays };
|
package/dist/loaders.d.mts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { r as OutboxBound } from "./types-Ccox7-5v.mjs";
|
|
2
|
-
import { _ as EventRef, a as OutboxFeed, c as NostrUser, d as ListLoaders, f as ListResult, g as EventLoader, h as ReplaceableLoader, i as OutboxError, l as ProfileLoader, m as ReplaceableLoadResult, n as Loaders, o as OutboxFeedOptions, p as LoadStyle, r as createLoaders, s as groupAuthorsByOutboxRelay, t as CreateLoadersOptions, u as bareNostrUser } from "./index-
|
|
2
|
+
import { _ as EventRef, a as OutboxFeed, c as NostrUser, d as ListLoaders, f as ListResult, g as EventLoader, h as ReplaceableLoader, i as OutboxError, l as ProfileLoader, m as ReplaceableLoadResult, n as Loaders, o as OutboxFeedOptions, p as LoadStyle, r as createLoaders, s as groupAuthorsByOutboxRelay, t as CreateLoadersOptions, u as bareNostrUser } from "./index-B1fLejg4.mjs";
|
|
3
3
|
export { CreateLoadersOptions, type EventLoader, type EventRef, type ListLoaders, type ListResult, type LoadStyle, Loaders, type NostrUser, type OutboxBound, OutboxError, OutboxFeed, type OutboxFeedOptions, type ProfileLoader, type ReplaceableLoadResult, type ReplaceableLoader, bareNostrUser, createLoaders, groupAuthorsByOutboxRelay };
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { n as EventTemplate, t as Event } from "./event-j3BwI5dF.mjs";
|
|
2
2
|
import { t as Filter } from "./filter-CfEgQBXt.mjs";
|
|
3
|
-
import {
|
|
4
|
-
import { t as EventVerifier } from "./verifier-BjL2M0ka.mjs";
|
|
3
|
+
import { o as CountResult, t as EventVerifier } from "./verifier-9c-bINrv.mjs";
|
|
5
4
|
import { a as NegentropyStorageVector } from "./nip77-wHA_nEV5.mjs";
|
|
6
5
|
import { t as WebSocketConstructor } from "./websocket-CmeqvAkp.mjs";
|
|
7
6
|
//#region src/relay/subscription.d.ts
|
|
@@ -393,4 +392,4 @@ declare class Pool {
|
|
|
393
392
|
}
|
|
394
393
|
//#endregion
|
|
395
394
|
export { Closer as _, PoolFetchResult as a, SubscriptionHandlers as b, PoolSubscribeOptions as c, RelayOptions as d, RelayStatus as f, RelayFetchResult as g, RelayFetchEnd as h, PoolEventMap as i, Relay as l, PublishResult as m, Pool as n, PoolOptions as o, RelayStatusName as p, PoolCountResult as r, PoolPublishResult as s, InvalidEventPolicy as t, RelayEventMap as u, RelaySubscription as v, subscriptionToAsyncIterable as x, SubscribeOptions as y };
|
|
396
|
-
//# sourceMappingURL=pool-
|
|
395
|
+
//# sourceMappingURL=pool-Bfe3Tu40.d.mts.map
|
package/dist/relay.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { _ as Closer, a as PoolFetchResult, b as SubscriptionHandlers, c as PoolSubscribeOptions, d as RelayOptions, f as RelayStatus, g as RelayFetchResult, h as RelayFetchEnd, i as PoolEventMap, l as Relay, m as PublishResult, n as Pool, o as PoolOptions, p as RelayStatusName, r as PoolCountResult, s as PoolPublishResult, t as InvalidEventPolicy, u as RelayEventMap, v as RelaySubscription, x as subscriptionToAsyncIterable, y as SubscribeOptions } from "./pool-
|
|
1
|
+
import { o as CountResult } from "./verifier-9c-bINrv.mjs";
|
|
2
|
+
import { _ as Closer, a as PoolFetchResult, b as SubscriptionHandlers, c as PoolSubscribeOptions, d as RelayOptions, f as RelayStatus, g as RelayFetchResult, h as RelayFetchEnd, i as PoolEventMap, l as Relay, m as PublishResult, n as Pool, o as PoolOptions, p as RelayStatusName, r as PoolCountResult, s as PoolPublishResult, t as InvalidEventPolicy, u as RelayEventMap, v as RelaySubscription, x as subscriptionToAsyncIterable, y as SubscribeOptions } from "./pool-Bfe3Tu40.mjs";
|
|
3
3
|
import { i as useWebSocketImplementation, n as WebSocketLike, r as getWebSocketImplementation, t as WebSocketConstructor } from "./websocket-CmeqvAkp.mjs";
|
|
4
|
-
import { a as isInsecureRelayUrl, c as RelayError, d as RelayTimeoutError, i as fetchRouted, l as RelayPublishError, n as RoutedJob, o as RelayClosedError, r as fanIn, s as RelayConnectionError, t as FanInOptions, u as RelaySuspendedError } from "./index-
|
|
4
|
+
import { a as isInsecureRelayUrl, c as RelayError, d as RelayTimeoutError, i as fetchRouted, l as RelayPublishError, n as RoutedJob, o as RelayClosedError, r as fanIn, s as RelayConnectionError, t as FanInOptions, u as RelaySuspendedError } from "./index-CLJEKFGd.mjs";
|
|
5
5
|
export { type Closer, type CountResult, type FanInOptions, type InvalidEventPolicy, Pool, type PoolCountResult, type PoolEventMap, type PoolFetchResult, type PoolOptions, type PoolPublishResult, type PoolSubscribeOptions, type PublishResult, Relay, RelayClosedError, RelayConnectionError, RelayError, type RelayEventMap, type RelayFetchEnd, type RelayFetchResult, type RelayOptions, RelayPublishError, RelayStatus, type RelayStatusName, type RelaySubscription, RelaySuspendedError, RelayTimeoutError, type RoutedJob, type SubscribeOptions, type SubscriptionHandlers, type WebSocketConstructor, type WebSocketLike, fanIn, fetchRouted, getWebSocketImplementation, isInsecureRelayUrl, subscriptionToAsyncIterable, useWebSocketImplementation };
|
package/dist/testing.d.mts
CHANGED
|
@@ -34,6 +34,12 @@ type FakeRelay = {
|
|
|
34
34
|
* failure handling.
|
|
35
35
|
*/
|
|
36
36
|
deliver: (event: Event) => void;
|
|
37
|
+
/**
|
|
38
|
+
* Live subscriptions whose filters match the event and whose initial dump already finished (their
|
|
39
|
+
* EOSE is on the wire). A publish that waits for this to be non-zero always lands on the client's
|
|
40
|
+
* live path — an earlier event is just another initial-page row.
|
|
41
|
+
*/
|
|
42
|
+
matchingLiveSubscribers: (event: Event) => number;
|
|
37
43
|
disconnect: () => void;
|
|
38
44
|
closeSubscriptions: (reason: string) => void;
|
|
39
45
|
configure: (opts: Partial<FakeRelayOptions>) => void;
|
package/dist/testing.mjs
CHANGED
|
@@ -75,6 +75,14 @@ var FakeRelayCore = class {
|
|
|
75
75
|
this.#deliver(event);
|
|
76
76
|
})();
|
|
77
77
|
}
|
|
78
|
+
matchingLiveSubscribers(event) {
|
|
79
|
+
let count = 0;
|
|
80
|
+
for (const session of this.#sessions) for (const id of session.eosed) {
|
|
81
|
+
const filters = session.subs.get(id);
|
|
82
|
+
if (filters !== void 0 && subMatches(filters, event)) count += 1;
|
|
83
|
+
}
|
|
84
|
+
return count;
|
|
85
|
+
}
|
|
78
86
|
disconnect() {
|
|
79
87
|
const sessions = [...this.#sessions];
|
|
80
88
|
this.#sessions.clear();
|
|
@@ -88,6 +96,7 @@ var FakeRelayCore = class {
|
|
|
88
96
|
reason
|
|
89
97
|
]);
|
|
90
98
|
session.subs.clear();
|
|
99
|
+
session.eosed.clear();
|
|
91
100
|
session.negs.clear();
|
|
92
101
|
}
|
|
93
102
|
}
|
|
@@ -99,6 +108,7 @@ var FakeRelayCore = class {
|
|
|
99
108
|
const session = {
|
|
100
109
|
transport,
|
|
101
110
|
subs: /* @__PURE__ */ new Map(),
|
|
111
|
+
eosed: /* @__PURE__ */ new Set(),
|
|
102
112
|
negs: /* @__PURE__ */ new Map(),
|
|
103
113
|
authed: false,
|
|
104
114
|
queue: Promise.resolve()
|
|
@@ -265,22 +275,34 @@ var FakeRelayCore = class {
|
|
|
265
275
|
id,
|
|
266
276
|
"auth-required: we only serve to authed users"
|
|
267
277
|
]);
|
|
278
|
+
session.subs.delete(id);
|
|
279
|
+
session.eosed.delete(id);
|
|
268
280
|
return;
|
|
269
281
|
}
|
|
270
282
|
session.subs.set(id, filters);
|
|
283
|
+
session.eosed.delete(id);
|
|
271
284
|
const matched = await this.#matched(filters);
|
|
272
|
-
if (this.#opts.eoseBeforeEvents === true)
|
|
285
|
+
if (this.#opts.eoseBeforeEvents === true) {
|
|
286
|
+
this.#send(session, ["EOSE", id]);
|
|
287
|
+
session.eosed.add(id);
|
|
288
|
+
}
|
|
273
289
|
for (const event of matched) this.#send(session, [
|
|
274
290
|
"EVENT",
|
|
275
291
|
id,
|
|
276
292
|
event
|
|
277
293
|
]);
|
|
278
|
-
if (this.#opts.eoseBeforeEvents !== true)
|
|
294
|
+
if (this.#opts.eoseBeforeEvents !== true) {
|
|
295
|
+
this.#send(session, ["EOSE", id]);
|
|
296
|
+
session.eosed.add(id);
|
|
297
|
+
}
|
|
279
298
|
return;
|
|
280
299
|
}
|
|
281
300
|
case "CLOSE": {
|
|
282
301
|
const [, id] = items;
|
|
283
|
-
if (typeof id === "string")
|
|
302
|
+
if (typeof id === "string") {
|
|
303
|
+
session.subs.delete(id);
|
|
304
|
+
session.eosed.delete(id);
|
|
305
|
+
}
|
|
284
306
|
return;
|
|
285
307
|
}
|
|
286
308
|
case "COUNT": {
|