@libp2p/interface 0.0.1 → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/src/connection/index.d.ts +152 -53
- package/dist/src/connection/index.d.ts.map +1 -1
- package/dist/src/connection/index.js.map +1 -1
- package/dist/src/errors.d.ts.map +1 -1
- package/dist/src/errors.js.map +1 -1
- package/dist/src/index.d.ts +8 -4
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/keys/index.d.ts.map +1 -1
- package/dist/src/keys/index.js.map +1 -1
- package/dist/src/peer-store/tags.d.ts.map +1 -1
- package/dist/src/peer-store/tags.js.map +1 -1
- package/dist/src/pubsub/index.d.ts +236 -0
- package/dist/src/pubsub/index.d.ts.map +1 -0
- package/dist/src/pubsub/index.js +36 -0
- package/dist/src/pubsub/index.js.map +1 -0
- package/dist/src/startable.d.ts.map +1 -1
- package/dist/src/startable.js.map +1 -1
- package/dist/src/stream-handler/index.d.ts +5 -0
- package/dist/src/stream-handler/index.d.ts.map +1 -1
- package/dist/src/stream-muxer/index.d.ts +6 -2
- package/dist/src/stream-muxer/index.d.ts.map +1 -1
- package/dist/src/stream-muxer/stream.d.ts +80 -21
- package/dist/src/stream-muxer/stream.d.ts.map +1 -1
- package/dist/src/stream-muxer/stream.js +224 -168
- package/dist/src/stream-muxer/stream.js.map +1 -1
- package/dist/src/transport/index.d.ts +5 -0
- package/dist/src/transport/index.d.ts.map +1 -1
- package/package.json +8 -11
- package/src/connection/index.ts +180 -59
- package/src/errors.ts +0 -1
- package/src/index.ts +8 -4
- package/src/keys/index.ts +0 -1
- package/src/peer-store/tags.ts +0 -1
- package/src/pubsub/index.ts +269 -0
- package/src/startable.ts +0 -1
- package/src/stream-handler/index.ts +6 -0
- package/src/stream-muxer/index.ts +7 -2
- package/src/stream-muxer/stream.ts +295 -186
- package/src/transport/index.ts +6 -0
- package/dist/src/connection/status.d.ts +0 -4
- package/dist/src/connection/status.d.ts.map +0 -1
- package/dist/src/connection/status.js +0 -4
- package/dist/src/connection/status.js.map +0 -1
- package/src/connection/status.ts +0 -4
|
@@ -1,241 +1,297 @@
|
|
|
1
|
-
// import { logger } from '@libp2p/logger'
|
|
2
1
|
import { abortableSource } from 'abortable-iterator';
|
|
3
|
-
import { anySignal } from 'any-signal';
|
|
4
2
|
import { pushable } from 'it-pushable';
|
|
3
|
+
import defer, {} from 'p-defer';
|
|
5
4
|
import { Uint8ArrayList } from 'uint8arraylist';
|
|
6
5
|
import { CodeError } from '../errors.js';
|
|
7
|
-
// const log = logger('libp2p:stream')
|
|
8
|
-
const log = () => { };
|
|
9
|
-
log.trace = () => { };
|
|
10
|
-
log.error = () => { };
|
|
11
6
|
const ERR_STREAM_RESET = 'ERR_STREAM_RESET';
|
|
12
|
-
const
|
|
13
|
-
const ERR_SINK_ENDED = 'ERR_SINK_ENDED';
|
|
14
|
-
const ERR_DOUBLE_SINK = 'ERR_DOUBLE_SINK';
|
|
7
|
+
const ERR_SINK_INVALID_STATE = 'ERR_SINK_INVALID_STATE';
|
|
15
8
|
function isPromise(res) {
|
|
16
9
|
return res != null && typeof res.then === 'function';
|
|
17
10
|
}
|
|
18
11
|
export class AbstractStream {
|
|
19
12
|
id;
|
|
20
|
-
|
|
13
|
+
direction;
|
|
14
|
+
timeline;
|
|
15
|
+
protocol;
|
|
21
16
|
metadata;
|
|
22
17
|
source;
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
sinkSunk;
|
|
18
|
+
status;
|
|
19
|
+
readStatus;
|
|
20
|
+
writeStatus;
|
|
21
|
+
sinkController;
|
|
22
|
+
sinkEnd;
|
|
29
23
|
endErr;
|
|
30
24
|
streamSource;
|
|
31
25
|
onEnd;
|
|
32
|
-
|
|
26
|
+
onCloseRead;
|
|
27
|
+
onCloseWrite;
|
|
28
|
+
onReset;
|
|
29
|
+
onAbort;
|
|
30
|
+
log;
|
|
33
31
|
constructor(init) {
|
|
34
|
-
this.
|
|
35
|
-
this.
|
|
36
|
-
this.
|
|
37
|
-
|
|
38
|
-
this.
|
|
39
|
-
this.
|
|
32
|
+
this.sinkController = new AbortController();
|
|
33
|
+
this.sinkEnd = defer();
|
|
34
|
+
this.log = init.log;
|
|
35
|
+
// stream status
|
|
36
|
+
this.status = 'open';
|
|
37
|
+
this.readStatus = 'ready';
|
|
38
|
+
this.writeStatus = 'ready';
|
|
40
39
|
this.id = init.id;
|
|
41
40
|
this.metadata = init.metadata ?? {};
|
|
42
|
-
this.
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
open: Date.now()
|
|
46
|
-
}
|
|
41
|
+
this.direction = init.direction;
|
|
42
|
+
this.timeline = {
|
|
43
|
+
open: Date.now()
|
|
47
44
|
};
|
|
48
|
-
this.maxDataSize = init.maxDataSize;
|
|
49
45
|
this.onEnd = init.onEnd;
|
|
46
|
+
this.onCloseRead = init?.onCloseRead;
|
|
47
|
+
this.onCloseWrite = init?.onCloseWrite;
|
|
48
|
+
this.onReset = init?.onReset;
|
|
49
|
+
this.onAbort = init?.onAbort;
|
|
50
50
|
this.source = this.streamSource = pushable({
|
|
51
|
-
onEnd: () => {
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
log.error('error while sending close read', err);
|
|
58
|
-
});
|
|
59
|
-
}
|
|
51
|
+
onEnd: (err) => {
|
|
52
|
+
if (err != null) {
|
|
53
|
+
this.log.trace('source ended with error', err);
|
|
54
|
+
}
|
|
55
|
+
else {
|
|
56
|
+
this.log.trace('source ended');
|
|
60
57
|
}
|
|
61
|
-
this.
|
|
58
|
+
this.readStatus = 'closed';
|
|
59
|
+
this.onSourceEnd(err);
|
|
62
60
|
}
|
|
63
61
|
});
|
|
64
62
|
// necessary because the libp2p upgrader wraps the sink function
|
|
65
63
|
this.sink = this.sink.bind(this);
|
|
66
64
|
}
|
|
65
|
+
async sink(source) {
|
|
66
|
+
if (this.writeStatus !== 'ready') {
|
|
67
|
+
throw new CodeError(`writable end state is "${this.writeStatus}" not "ready"`, ERR_SINK_INVALID_STATE);
|
|
68
|
+
}
|
|
69
|
+
try {
|
|
70
|
+
this.writeStatus = 'writing';
|
|
71
|
+
const options = {
|
|
72
|
+
signal: this.sinkController.signal
|
|
73
|
+
};
|
|
74
|
+
if (this.direction === 'outbound') { // If initiator, open a new stream
|
|
75
|
+
const res = this.sendNewStream(options);
|
|
76
|
+
if (isPromise(res)) {
|
|
77
|
+
await res;
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
source = abortableSource(source, this.sinkController.signal, {
|
|
81
|
+
returnOnAbort: true
|
|
82
|
+
});
|
|
83
|
+
this.log.trace('sink reading from source');
|
|
84
|
+
for await (let data of source) {
|
|
85
|
+
data = data instanceof Uint8Array ? new Uint8ArrayList(data) : data;
|
|
86
|
+
const res = this.sendData(data, options);
|
|
87
|
+
if (isPromise(res)) { // eslint-disable-line max-depth
|
|
88
|
+
await res;
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
this.log.trace('sink finished reading from source');
|
|
92
|
+
this.writeStatus = 'done';
|
|
93
|
+
this.log.trace('sink calling closeWrite');
|
|
94
|
+
await this.closeWrite(options);
|
|
95
|
+
this.onSinkEnd();
|
|
96
|
+
}
|
|
97
|
+
catch (err) {
|
|
98
|
+
this.log.trace('sink ended with error, calling abort with error', err);
|
|
99
|
+
this.abort(err);
|
|
100
|
+
throw err;
|
|
101
|
+
}
|
|
102
|
+
finally {
|
|
103
|
+
this.log.trace('resolve sink end');
|
|
104
|
+
this.sinkEnd.resolve();
|
|
105
|
+
}
|
|
106
|
+
}
|
|
67
107
|
onSourceEnd(err) {
|
|
68
|
-
if (this.
|
|
108
|
+
if (this.timeline.closeRead != null) {
|
|
69
109
|
return;
|
|
70
110
|
}
|
|
71
|
-
this.
|
|
72
|
-
this.sourceEnded = true;
|
|
73
|
-
log.trace('%s stream %s source end - err: %o', this.stat.direction, this.id, err);
|
|
111
|
+
this.timeline.closeRead = Date.now();
|
|
74
112
|
if (err != null && this.endErr == null) {
|
|
75
113
|
this.endErr = err;
|
|
76
114
|
}
|
|
77
|
-
|
|
78
|
-
|
|
115
|
+
this.onCloseRead?.();
|
|
116
|
+
if (this.timeline.closeWrite != null) {
|
|
117
|
+
this.log.trace('source and sink ended');
|
|
118
|
+
this.timeline.close = Date.now();
|
|
79
119
|
if (this.onEnd != null) {
|
|
80
120
|
this.onEnd(this.endErr);
|
|
81
121
|
}
|
|
82
122
|
}
|
|
123
|
+
else {
|
|
124
|
+
this.log.trace('source ended, waiting for sink to end');
|
|
125
|
+
}
|
|
83
126
|
}
|
|
84
127
|
onSinkEnd(err) {
|
|
85
|
-
if (this.
|
|
128
|
+
if (this.timeline.closeWrite != null) {
|
|
86
129
|
return;
|
|
87
130
|
}
|
|
88
|
-
this.
|
|
89
|
-
this.sinkEnded = true;
|
|
90
|
-
log.trace('%s stream %s sink end - err: %o', this.stat.direction, this.id, err);
|
|
131
|
+
this.timeline.closeWrite = Date.now();
|
|
91
132
|
if (err != null && this.endErr == null) {
|
|
92
133
|
this.endErr = err;
|
|
93
134
|
}
|
|
94
|
-
|
|
95
|
-
|
|
135
|
+
this.onCloseWrite?.();
|
|
136
|
+
if (this.timeline.closeRead != null) {
|
|
137
|
+
this.log.trace('sink and source ended');
|
|
138
|
+
this.timeline.close = Date.now();
|
|
96
139
|
if (this.onEnd != null) {
|
|
97
140
|
this.onEnd(this.endErr);
|
|
98
141
|
}
|
|
99
142
|
}
|
|
143
|
+
else {
|
|
144
|
+
this.log.trace('sink ended, waiting for source to end');
|
|
145
|
+
}
|
|
100
146
|
}
|
|
101
147
|
// Close for both Reading and Writing
|
|
102
|
-
close() {
|
|
103
|
-
log.trace('
|
|
104
|
-
this.
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
148
|
+
async close(options) {
|
|
149
|
+
this.log.trace('closing gracefully');
|
|
150
|
+
this.status = 'closing';
|
|
151
|
+
await Promise.all([
|
|
152
|
+
this.closeRead(options),
|
|
153
|
+
this.closeWrite(options)
|
|
154
|
+
]);
|
|
155
|
+
this.status = 'closed';
|
|
156
|
+
this.log.trace('closed gracefully');
|
|
157
|
+
}
|
|
158
|
+
async closeRead(options = {}) {
|
|
159
|
+
if (this.readStatus === 'closing' || this.readStatus === 'closed') {
|
|
111
160
|
return;
|
|
112
161
|
}
|
|
113
|
-
this.
|
|
162
|
+
this.log.trace('closing readable end of stream with starting read status "%s"', this.readStatus);
|
|
163
|
+
const readStatus = this.readStatus;
|
|
164
|
+
this.readStatus = 'closing';
|
|
165
|
+
if (readStatus === 'ready') {
|
|
166
|
+
this.log.trace('ending internal source queue');
|
|
167
|
+
this.streamSource.end();
|
|
168
|
+
}
|
|
169
|
+
if (this.status !== 'reset' && this.status !== 'aborted') {
|
|
170
|
+
this.log.trace('send close read to remote');
|
|
171
|
+
await this.sendCloseRead(options);
|
|
172
|
+
}
|
|
173
|
+
this.log.trace('closed readable end of stream');
|
|
114
174
|
}
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
log.trace('%s stream %s closeWrite', this.stat.direction, this.id);
|
|
118
|
-
if (this.sinkEnded) {
|
|
175
|
+
async closeWrite(options = {}) {
|
|
176
|
+
if (this.writeStatus === 'closing' || this.writeStatus === 'closed') {
|
|
119
177
|
return;
|
|
120
178
|
}
|
|
121
|
-
this.
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
179
|
+
this.log.trace('closing writable end of stream with starting write status "%s"', this.writeStatus);
|
|
180
|
+
const writeStatus = this.writeStatus;
|
|
181
|
+
if (this.writeStatus === 'ready') {
|
|
182
|
+
this.log.trace('sink was never sunk, sink an empty array');
|
|
183
|
+
await this.sink([]);
|
|
184
|
+
}
|
|
185
|
+
this.writeStatus = 'closing';
|
|
186
|
+
if (writeStatus === 'writing') {
|
|
187
|
+
// stop reading from the source passed to `.sink` in the microtask queue
|
|
188
|
+
// - this lets any data queued by the user in the current tick get read
|
|
189
|
+
// before we exit
|
|
190
|
+
await new Promise((resolve, reject) => {
|
|
191
|
+
queueMicrotask(() => {
|
|
192
|
+
this.log.trace('aborting source passed to .sink');
|
|
193
|
+
this.sinkController.abort();
|
|
194
|
+
this.sinkEnd.promise.then(resolve, reject);
|
|
129
195
|
});
|
|
130
|
-
}
|
|
196
|
+
});
|
|
131
197
|
}
|
|
132
|
-
|
|
133
|
-
log.trace('
|
|
198
|
+
if (this.status !== 'reset' && this.status !== 'aborted') {
|
|
199
|
+
this.log.trace('send close write to remote');
|
|
200
|
+
await this.sendCloseWrite(options);
|
|
134
201
|
}
|
|
135
|
-
this.
|
|
202
|
+
this.writeStatus = 'closed';
|
|
203
|
+
this.log.trace('closed writable end of stream');
|
|
136
204
|
}
|
|
137
|
-
|
|
205
|
+
/**
|
|
206
|
+
* Close immediately for reading and writing and send a reset message (local
|
|
207
|
+
* error)
|
|
208
|
+
*/
|
|
138
209
|
abort(err) {
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
this.
|
|
143
|
-
|
|
210
|
+
if (this.status === 'closed' || this.status === 'aborted' || this.status === 'reset') {
|
|
211
|
+
return;
|
|
212
|
+
}
|
|
213
|
+
this.log('abort with error', err);
|
|
214
|
+
// try to send a reset message
|
|
215
|
+
this.log('try to send reset to remote');
|
|
216
|
+
const res = this.sendReset();
|
|
217
|
+
if (isPromise(res)) {
|
|
218
|
+
res.catch((err) => {
|
|
219
|
+
this.log.error('error sending reset message', err);
|
|
220
|
+
});
|
|
221
|
+
}
|
|
222
|
+
this.status = 'aborted';
|
|
223
|
+
this.timeline.abort = Date.now();
|
|
224
|
+
this._closeSinkAndSource(err);
|
|
225
|
+
this.onAbort?.(err);
|
|
144
226
|
}
|
|
145
|
-
|
|
227
|
+
/**
|
|
228
|
+
* Receive a reset message - close immediately for reading and writing (remote
|
|
229
|
+
* error)
|
|
230
|
+
*/
|
|
146
231
|
reset() {
|
|
232
|
+
if (this.status === 'closed' || this.status === 'aborted' || this.status === 'reset') {
|
|
233
|
+
return;
|
|
234
|
+
}
|
|
147
235
|
const err = new CodeError('stream reset', ERR_STREAM_RESET);
|
|
148
|
-
this.
|
|
149
|
-
this.
|
|
150
|
-
this.
|
|
236
|
+
this.status = 'reset';
|
|
237
|
+
this._closeSinkAndSource(err);
|
|
238
|
+
this.onReset?.();
|
|
151
239
|
}
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
if
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
this.abortController.signal,
|
|
162
|
-
this.resetController.signal,
|
|
163
|
-
this.closeController.signal
|
|
164
|
-
]);
|
|
165
|
-
try {
|
|
166
|
-
source = abortableSource(source, signal);
|
|
167
|
-
if (this.stat.direction === 'outbound') { // If initiator, open a new stream
|
|
168
|
-
const res = this.sendNewStream();
|
|
169
|
-
if (isPromise(res)) {
|
|
170
|
-
await res;
|
|
171
|
-
}
|
|
172
|
-
}
|
|
173
|
-
for await (let data of source) {
|
|
174
|
-
while (data.length > 0) {
|
|
175
|
-
if (data.length <= this.maxDataSize) {
|
|
176
|
-
const res = this.sendData(data instanceof Uint8Array ? new Uint8ArrayList(data) : data);
|
|
177
|
-
if (isPromise(res)) { // eslint-disable-line max-depth
|
|
178
|
-
await res;
|
|
179
|
-
}
|
|
180
|
-
break;
|
|
181
|
-
}
|
|
182
|
-
data = data instanceof Uint8Array ? new Uint8ArrayList(data) : data;
|
|
183
|
-
const res = this.sendData(data.sublist(0, this.maxDataSize));
|
|
184
|
-
if (isPromise(res)) {
|
|
185
|
-
await res;
|
|
186
|
-
}
|
|
187
|
-
data.consume(this.maxDataSize);
|
|
188
|
-
}
|
|
189
|
-
}
|
|
240
|
+
_closeSinkAndSource(err) {
|
|
241
|
+
this._closeSink(err);
|
|
242
|
+
this._closeSource(err);
|
|
243
|
+
}
|
|
244
|
+
_closeSink(err) {
|
|
245
|
+
// if the sink function is running, cause it to end
|
|
246
|
+
if (this.writeStatus === 'writing') {
|
|
247
|
+
this.log.trace('end sink source');
|
|
248
|
+
this.sinkController.abort();
|
|
190
249
|
}
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
err.code = ERR_STREAM_RESET;
|
|
199
|
-
}
|
|
200
|
-
if (this.abortController.signal.aborted) {
|
|
201
|
-
err.message = 'stream aborted';
|
|
202
|
-
err.code = ERR_STREAM_ABORT;
|
|
203
|
-
}
|
|
204
|
-
}
|
|
205
|
-
// Send no more data if this stream was remotely reset
|
|
206
|
-
if (err.code === ERR_STREAM_RESET) {
|
|
207
|
-
log.trace('%s stream %s reset', this.stat.direction, this.id);
|
|
208
|
-
}
|
|
209
|
-
else {
|
|
210
|
-
log.trace('%s stream %s error', this.stat.direction, this.id, err);
|
|
211
|
-
try {
|
|
212
|
-
const res = this.sendReset();
|
|
213
|
-
if (isPromise(res)) {
|
|
214
|
-
await res;
|
|
215
|
-
}
|
|
216
|
-
this.stat.timeline.reset = Date.now();
|
|
217
|
-
}
|
|
218
|
-
catch (err) {
|
|
219
|
-
log.trace('%s stream %s error sending reset', this.stat.direction, this.id, err);
|
|
220
|
-
}
|
|
221
|
-
}
|
|
250
|
+
this.onSinkEnd(err);
|
|
251
|
+
}
|
|
252
|
+
_closeSource(err) {
|
|
253
|
+
// if the source is not ending, end it
|
|
254
|
+
if (this.readStatus !== 'closing' && this.readStatus !== 'closed') {
|
|
255
|
+
this.log.trace('ending source with %d bytes to be read by consumer', this.streamSource.readableLength);
|
|
256
|
+
this.readStatus = 'closing';
|
|
222
257
|
this.streamSource.end(err);
|
|
223
|
-
this.onSinkEnd(err);
|
|
224
|
-
throw err;
|
|
225
258
|
}
|
|
226
|
-
|
|
227
|
-
|
|
259
|
+
}
|
|
260
|
+
/**
|
|
261
|
+
* The remote closed for writing so we should expect to receive no more
|
|
262
|
+
* messages
|
|
263
|
+
*/
|
|
264
|
+
remoteCloseWrite() {
|
|
265
|
+
if (this.readStatus === 'closing' || this.readStatus === 'closed') {
|
|
266
|
+
this.log('received remote close write but local source is already closed');
|
|
267
|
+
return;
|
|
228
268
|
}
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
269
|
+
this.log.trace('remote close write');
|
|
270
|
+
this._closeSource();
|
|
271
|
+
}
|
|
272
|
+
/**
|
|
273
|
+
* The remote closed for reading so we should not send any more
|
|
274
|
+
* messages
|
|
275
|
+
*/
|
|
276
|
+
remoteCloseRead() {
|
|
277
|
+
if (this.writeStatus === 'closing' || this.writeStatus === 'closed') {
|
|
278
|
+
this.log('received remote close read but local sink is already closed');
|
|
279
|
+
return;
|
|
234
280
|
}
|
|
235
|
-
|
|
236
|
-
|
|
281
|
+
this.log.trace('remote close read');
|
|
282
|
+
this._closeSink();
|
|
283
|
+
}
|
|
284
|
+
/**
|
|
285
|
+
* The underlying muxer has closed, no more messages can be sent or will
|
|
286
|
+
* be received, close immediately to free up resources
|
|
287
|
+
*/
|
|
288
|
+
destroy() {
|
|
289
|
+
if (this.status === 'closed' || this.status === 'aborted' || this.status === 'reset') {
|
|
290
|
+
this.log('received destroy but we are already closed');
|
|
291
|
+
return;
|
|
237
292
|
}
|
|
238
|
-
this.
|
|
293
|
+
this.log.trace('muxer destroyed');
|
|
294
|
+
this._closeSinkAndSource();
|
|
239
295
|
}
|
|
240
296
|
/**
|
|
241
297
|
* When an extending class reads data from it's implementation-specific source,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stream.js","sourceRoot":"","sources":["../../../src/stream-muxer/stream.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"stream.js","sourceRoot":"","sources":["../../../src/stream-muxer/stream.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,oBAA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AAC,KAAK,CAAC,oBAAoB,CAAC,CAAA;QACpC,IAAI,CAAC,YAAY,EAAE,CAAA;IACrB,CAAC;IAED;;;OAGG;IACH,eAAe;QACb,IAAI,IAAI,CAAC,WAAW,KAAK,SAAS,IAAI,IAAI,CAAC,WAAW,KAAK,QAAQ,EAAE;YACnE,IAAI,CAAC,GAAG,CAAC,6DAA6D,CAAC,CAAA;YACvE,OAAM;SACP;QAED,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,mBAAmB,CAAC,CAAA;QACnC,IAAI,CAAC,UAAU,EAAE,CAAA;IACnB,CAAC;IAED;;;OAGG;IACH,OAAO;QACL,IAAI,IAAI,CAAC,MAAM,KAAK,QAAQ,IAAI,IAAI,CAAC,MAAM,KAAK,SAAS,IAAI,IAAI,CAAC,MAAM,KAAK,OAAO,EAAE;YACpF,IAAI,CAAC,GAAG,CAAC,4CAA4C,CAAC,CAAA;YACtD,OAAM;SACP;QAED,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,iBAAiB,CAAC,CAAA;QAEjC,IAAI,CAAC,mBAAmB,EAAE,CAAA;IAC5B,CAAC;IAED;;;OAGG;IACH,UAAU,CAAE,IAAoB;QAC9B,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;IAC9B,CAAC;IAED;;;OAGG;IACH,oBAAoB;QAClB,OAAO,IAAI,CAAC,YAAY,CAAC,cAAc,CAAA;IACzC,CAAC;CA6BF"}
|
|
@@ -82,6 +82,11 @@ export interface UpgraderOptions {
|
|
|
82
82
|
skipEncryption?: boolean;
|
|
83
83
|
skipProtection?: boolean;
|
|
84
84
|
muxerFactory?: StreamMuxerFactory;
|
|
85
|
+
/**
|
|
86
|
+
* The passed MultiaddrConnection has limits place on duration and/or data
|
|
87
|
+
* transfer amounts so is not expected to be open for very long.
|
|
88
|
+
*/
|
|
89
|
+
transient?: boolean;
|
|
85
90
|
}
|
|
86
91
|
export interface Upgrader {
|
|
87
92
|
/**
|
|
@@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H,SAAS,IAAI;IAEb;;OAEG;IACH,QAAQ,IAAA;CACT;AAED,MAAM,WAAW,eAAe;IAC9B,cAAc,CAAC,EAAE,OAAO,CAAA;IACxB,cAAc,CAAC,EAAE,OAAO,CAAA;IACxB,YAAY,CAAC,EAAE,kBAAkB,CAAA;IAEjC;;;OAGG;IACH,SAAS,CAAC,EAAE,OAAO,CAAA;CACpB;AAED,MAAM,WAAW,QAAQ;IACvB;;OAEG;IACH,eAAe,EAAE,CAAC,MAAM,EAAE,mBAAmB,EAAE,IAAI,CAAC,EAAE,eAAe,KAAK,OAAO,CAAC,UAAU,CAAC,CAAA;IAE7F;;OAEG;IACH,cAAc,EAAE,CAAC,MAAM,EAAE,mBAAmB,EAAE,IAAI,CAAC,EAAE,eAAe,KAAK,OAAO,CAAC,UAAU,CAAC,CAAA;CAC7F"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@libp2p/interface",
|
|
3
|
-
"version": "0.0
|
|
3
|
+
"version": "0.1.0",
|
|
4
4
|
"description": "The interface implemented by a libp2p node",
|
|
5
5
|
"license": "Apache-2.0 OR MIT",
|
|
6
6
|
"homepage": "https://github.com/libp2p/js-libp2p/tree/master/packages/interface#readme",
|
|
@@ -56,10 +56,6 @@
|
|
|
56
56
|
"types": "./dist/src/connection-gater/index.d.ts",
|
|
57
57
|
"import": "./dist/src/connection-gater/index.js"
|
|
58
58
|
},
|
|
59
|
-
"./connection/status": {
|
|
60
|
-
"types": "./dist/src/connection/status.d.ts",
|
|
61
|
-
"import": "./dist/src/connection/status.js"
|
|
62
|
-
},
|
|
63
59
|
"./content-routing": {
|
|
64
60
|
"types": "./dist/src/content-routing/index.d.ts",
|
|
65
61
|
"import": "./dist/src/content-routing/index.js"
|
|
@@ -112,6 +108,10 @@
|
|
|
112
108
|
"types": "./dist/src/peer-store/tags.d.ts",
|
|
113
109
|
"import": "./dist/src/peer-store/tags.js"
|
|
114
110
|
},
|
|
111
|
+
"./pubsub": {
|
|
112
|
+
"types": "./dist/src/pubsub/index.d.ts",
|
|
113
|
+
"import": "./dist/src/pubsub/index.js"
|
|
114
|
+
},
|
|
115
115
|
"./record": {
|
|
116
116
|
"types": "./dist/src/record/index.d.ts",
|
|
117
117
|
"import": "./dist/src/record/index.js"
|
|
@@ -159,19 +159,16 @@
|
|
|
159
159
|
"dependencies": {
|
|
160
160
|
"@multiformats/multiaddr": "^12.1.3",
|
|
161
161
|
"abortable-iterator": "^5.0.1",
|
|
162
|
-
"
|
|
163
|
-
"it-pushable": "^3.1.3",
|
|
162
|
+
"it-pushable": "^3.2.0",
|
|
164
163
|
"it-stream-types": "^2.0.1",
|
|
165
164
|
"multiformats": "^12.0.1",
|
|
165
|
+
"p-defer": "^4.0.0",
|
|
166
166
|
"uint8arraylist": "^2.4.3"
|
|
167
167
|
},
|
|
168
168
|
"devDependencies": {
|
|
169
169
|
"@types/sinon": "^10.0.15",
|
|
170
|
-
"aegir": "^
|
|
170
|
+
"aegir": "^40.0.1",
|
|
171
171
|
"sinon": "^15.1.2",
|
|
172
172
|
"sinon-ts": "^1.0.0"
|
|
173
|
-
},
|
|
174
|
-
"typedoc": {
|
|
175
|
-
"entryPoint": "./src/index.ts"
|
|
176
173
|
}
|
|
177
174
|
}
|