libp2p 0.35.8 → 0.36.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/index.min.js +55 -0
- package/dist/src/circuit/auto-relay.d.ts +8 -10
- package/dist/src/circuit/auto-relay.d.ts.map +1 -1
- package/dist/src/config.d.ts +2 -0
- package/dist/src/config.d.ts.map +1 -1
- package/dist/src/connection-manager/auto-dialler.d.ts +1 -1
- package/dist/src/connection-manager/auto-dialler.d.ts.map +1 -1
- package/dist/src/connection-manager/index.d.ts +1 -2
- package/dist/src/connection-manager/index.d.ts.map +1 -1
- package/dist/src/content-routing/utils.d.ts +3 -3
- package/dist/src/content-routing/utils.d.ts.map +1 -1
- package/dist/src/dialer/dial-request.d.ts.map +1 -1
- package/dist/src/dialer/index.d.ts +12 -7
- package/dist/src/dialer/index.d.ts.map +1 -1
- package/dist/src/errors.d.ts +2 -0
- package/dist/src/fetch/constants.d.ts +2 -0
- package/dist/src/fetch/constants.d.ts.map +1 -0
- package/dist/src/fetch/index.d.ts +76 -0
- package/dist/src/fetch/index.d.ts.map +1 -0
- package/dist/src/fetch/proto.d.ts +134 -0
- package/dist/src/identify/index.d.ts +4 -4
- package/dist/src/identify/index.d.ts.map +1 -1
- package/dist/src/index.d.ts +116 -7
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/metrics/index.d.ts +9 -4
- package/dist/src/metrics/index.d.ts.map +1 -1
- package/dist/src/metrics/tracked-map.d.ts +6 -1
- package/dist/src/metrics/tracked-map.d.ts.map +1 -1
- package/dist/src/peer-routing.d.ts +1 -1
- package/dist/src/peer-routing.d.ts.map +1 -1
- package/dist/src/peer-store/address-book.d.ts +30 -84
- package/dist/src/peer-store/address-book.d.ts.map +1 -1
- package/dist/src/peer-store/index.d.ts +28 -94
- package/dist/src/peer-store/index.d.ts.map +1 -1
- package/dist/src/peer-store/key-book.d.ts +31 -15
- package/dist/src/peer-store/key-book.d.ts.map +1 -1
- package/dist/src/peer-store/metadata-book.d.ts +33 -29
- package/dist/src/peer-store/metadata-book.d.ts.map +1 -1
- package/dist/src/peer-store/pb/peer.d.ts +222 -0
- package/dist/src/peer-store/proto-book.d.ts +27 -28
- package/dist/src/peer-store/proto-book.d.ts.map +1 -1
- package/dist/src/peer-store/store.d.ts +73 -0
- package/dist/src/peer-store/store.d.ts.map +1 -0
- package/dist/src/peer-store/types.d.ts +202 -0
- package/dist/src/peer-store/types.d.ts.map +1 -0
- package/dist/src/ping/index.d.ts.map +1 -1
- package/dist/src/record/peer-record/index.d.ts +2 -2
- package/dist/src/record/peer-record/index.d.ts.map +1 -1
- package/dist/src/registrar.d.ts +5 -5
- package/dist/src/registrar.d.ts.map +1 -1
- package/dist/src/types.d.ts +90 -0
- package/dist/src/types.d.ts.map +1 -0
- package/dist/src/upgrader.d.ts +8 -2
- package/dist/src/upgrader.d.ts.map +1 -1
- package/package.json +23 -26
- package/src/circuit/auto-relay.js +52 -38
- package/src/config.js +2 -0
- package/src/connection-manager/auto-dialler.js +20 -8
- package/src/connection-manager/index.js +42 -22
- package/src/content-routing/utils.js +4 -4
- package/src/dialer/dial-request.js +4 -1
- package/src/dialer/index.js +38 -8
- package/src/errors.js +2 -0
- package/src/fetch/README.md +36 -0
- package/src/fetch/constants.js +6 -0
- package/src/fetch/index.js +159 -0
- package/src/fetch/proto.d.ts +134 -0
- package/src/fetch/proto.js +333 -0
- package/src/fetch/proto.proto +15 -0
- package/src/identify/index.js +47 -38
- package/src/index.js +72 -27
- package/src/metrics/index.js +15 -8
- package/src/metrics/tracked-map.js +40 -14
- package/src/peer-routing.js +4 -1
- package/src/peer-store/address-book.js +254 -226
- package/src/peer-store/index.js +79 -110
- package/src/peer-store/key-book.js +99 -54
- package/src/peer-store/metadata-book.js +171 -101
- package/src/peer-store/pb/peer.d.ts +222 -0
- package/src/peer-store/pb/peer.js +643 -0
- package/src/peer-store/pb/peer.proto +31 -0
- package/src/peer-store/proto-book.js +171 -105
- package/src/peer-store/store.js +263 -0
- package/src/peer-store/types.ts +245 -0
- package/src/ping/index.js +6 -0
- package/src/record/peer-record/index.js +1 -1
- package/src/record/utils.js +1 -1
- package/src/registrar.js +4 -4
- package/src/types.ts +98 -0
- package/src/upgrader.js +32 -2
- package/dist/src/peer-store/book.d.ts +0 -81
- package/dist/src/peer-store/book.d.ts.map +0 -1
- package/dist/src/peer-store/persistent/consts.d.ts +0 -6
- package/dist/src/peer-store/persistent/consts.d.ts.map +0 -1
- package/dist/src/peer-store/persistent/index.d.ts +0 -129
- package/dist/src/peer-store/persistent/index.d.ts.map +0 -1
- package/dist/src/peer-store/persistent/pb/address-book.d.ts +0 -198
- package/dist/src/peer-store/persistent/pb/proto-book.d.ts +0 -59
- package/src/peer-store/book.js +0 -124
- package/src/peer-store/persistent/consts.js +0 -15
- package/src/peer-store/persistent/index.js +0 -408
- package/src/peer-store/persistent/pb/address-book.d.ts +0 -198
- package/src/peer-store/persistent/pb/address-book.js +0 -522
- package/src/peer-store/persistent/pb/address-book.proto +0 -27
- package/src/peer-store/persistent/pb/proto-book.d.ts +0 -59
- package/src/peer-store/persistent/pb/proto-book.js +0 -157
- package/src/peer-store/persistent/pb/proto-book.proto +0 -5
|
@@ -1,157 +0,0 @@
|
|
|
1
|
-
/*eslint-disable*/
|
|
2
|
-
"use strict";
|
|
3
|
-
|
|
4
|
-
var $protobuf = require("protobufjs/minimal");
|
|
5
|
-
|
|
6
|
-
// Common aliases
|
|
7
|
-
var $Reader = $protobuf.Reader, $Writer = $protobuf.Writer, $util = $protobuf.util;
|
|
8
|
-
|
|
9
|
-
// Exported root namespace
|
|
10
|
-
var $root = $protobuf.roots["libp2p-proto-book"] || ($protobuf.roots["libp2p-proto-book"] = {});
|
|
11
|
-
|
|
12
|
-
$root.Protocols = (function() {
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
* Properties of a Protocols.
|
|
16
|
-
* @exports IProtocols
|
|
17
|
-
* @interface IProtocols
|
|
18
|
-
* @property {Array.<string>|null} [protocols] Protocols protocols
|
|
19
|
-
*/
|
|
20
|
-
|
|
21
|
-
/**
|
|
22
|
-
* Constructs a new Protocols.
|
|
23
|
-
* @exports Protocols
|
|
24
|
-
* @classdesc Represents a Protocols.
|
|
25
|
-
* @implements IProtocols
|
|
26
|
-
* @constructor
|
|
27
|
-
* @param {IProtocols=} [p] Properties to set
|
|
28
|
-
*/
|
|
29
|
-
function Protocols(p) {
|
|
30
|
-
this.protocols = [];
|
|
31
|
-
if (p)
|
|
32
|
-
for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
|
|
33
|
-
if (p[ks[i]] != null)
|
|
34
|
-
this[ks[i]] = p[ks[i]];
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
/**
|
|
38
|
-
* Protocols protocols.
|
|
39
|
-
* @member {Array.<string>} protocols
|
|
40
|
-
* @memberof Protocols
|
|
41
|
-
* @instance
|
|
42
|
-
*/
|
|
43
|
-
Protocols.prototype.protocols = $util.emptyArray;
|
|
44
|
-
|
|
45
|
-
/**
|
|
46
|
-
* Encodes the specified Protocols message. Does not implicitly {@link Protocols.verify|verify} messages.
|
|
47
|
-
* @function encode
|
|
48
|
-
* @memberof Protocols
|
|
49
|
-
* @static
|
|
50
|
-
* @param {IProtocols} m Protocols message or plain object to encode
|
|
51
|
-
* @param {$protobuf.Writer} [w] Writer to encode to
|
|
52
|
-
* @returns {$protobuf.Writer} Writer
|
|
53
|
-
*/
|
|
54
|
-
Protocols.encode = function encode(m, w) {
|
|
55
|
-
if (!w)
|
|
56
|
-
w = $Writer.create();
|
|
57
|
-
if (m.protocols != null && m.protocols.length) {
|
|
58
|
-
for (var i = 0; i < m.protocols.length; ++i)
|
|
59
|
-
w.uint32(10).string(m.protocols[i]);
|
|
60
|
-
}
|
|
61
|
-
return w;
|
|
62
|
-
};
|
|
63
|
-
|
|
64
|
-
/**
|
|
65
|
-
* Decodes a Protocols message from the specified reader or buffer.
|
|
66
|
-
* @function decode
|
|
67
|
-
* @memberof Protocols
|
|
68
|
-
* @static
|
|
69
|
-
* @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from
|
|
70
|
-
* @param {number} [l] Message length if known beforehand
|
|
71
|
-
* @returns {Protocols} Protocols
|
|
72
|
-
* @throws {Error} If the payload is not a reader or valid buffer
|
|
73
|
-
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
74
|
-
*/
|
|
75
|
-
Protocols.decode = function decode(r, l) {
|
|
76
|
-
if (!(r instanceof $Reader))
|
|
77
|
-
r = $Reader.create(r);
|
|
78
|
-
var c = l === undefined ? r.len : r.pos + l, m = new $root.Protocols();
|
|
79
|
-
while (r.pos < c) {
|
|
80
|
-
var t = r.uint32();
|
|
81
|
-
switch (t >>> 3) {
|
|
82
|
-
case 1:
|
|
83
|
-
if (!(m.protocols && m.protocols.length))
|
|
84
|
-
m.protocols = [];
|
|
85
|
-
m.protocols.push(r.string());
|
|
86
|
-
break;
|
|
87
|
-
default:
|
|
88
|
-
r.skipType(t & 7);
|
|
89
|
-
break;
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
return m;
|
|
93
|
-
};
|
|
94
|
-
|
|
95
|
-
/**
|
|
96
|
-
* Creates a Protocols message from a plain object. Also converts values to their respective internal types.
|
|
97
|
-
* @function fromObject
|
|
98
|
-
* @memberof Protocols
|
|
99
|
-
* @static
|
|
100
|
-
* @param {Object.<string,*>} d Plain object
|
|
101
|
-
* @returns {Protocols} Protocols
|
|
102
|
-
*/
|
|
103
|
-
Protocols.fromObject = function fromObject(d) {
|
|
104
|
-
if (d instanceof $root.Protocols)
|
|
105
|
-
return d;
|
|
106
|
-
var m = new $root.Protocols();
|
|
107
|
-
if (d.protocols) {
|
|
108
|
-
if (!Array.isArray(d.protocols))
|
|
109
|
-
throw TypeError(".Protocols.protocols: array expected");
|
|
110
|
-
m.protocols = [];
|
|
111
|
-
for (var i = 0; i < d.protocols.length; ++i) {
|
|
112
|
-
m.protocols[i] = String(d.protocols[i]);
|
|
113
|
-
}
|
|
114
|
-
}
|
|
115
|
-
return m;
|
|
116
|
-
};
|
|
117
|
-
|
|
118
|
-
/**
|
|
119
|
-
* Creates a plain object from a Protocols message. Also converts values to other types if specified.
|
|
120
|
-
* @function toObject
|
|
121
|
-
* @memberof Protocols
|
|
122
|
-
* @static
|
|
123
|
-
* @param {Protocols} m Protocols
|
|
124
|
-
* @param {$protobuf.IConversionOptions} [o] Conversion options
|
|
125
|
-
* @returns {Object.<string,*>} Plain object
|
|
126
|
-
*/
|
|
127
|
-
Protocols.toObject = function toObject(m, o) {
|
|
128
|
-
if (!o)
|
|
129
|
-
o = {};
|
|
130
|
-
var d = {};
|
|
131
|
-
if (o.arrays || o.defaults) {
|
|
132
|
-
d.protocols = [];
|
|
133
|
-
}
|
|
134
|
-
if (m.protocols && m.protocols.length) {
|
|
135
|
-
d.protocols = [];
|
|
136
|
-
for (var j = 0; j < m.protocols.length; ++j) {
|
|
137
|
-
d.protocols[j] = m.protocols[j];
|
|
138
|
-
}
|
|
139
|
-
}
|
|
140
|
-
return d;
|
|
141
|
-
};
|
|
142
|
-
|
|
143
|
-
/**
|
|
144
|
-
* Converts this Protocols to JSON.
|
|
145
|
-
* @function toJSON
|
|
146
|
-
* @memberof Protocols
|
|
147
|
-
* @instance
|
|
148
|
-
* @returns {Object.<string,*>} JSON object
|
|
149
|
-
*/
|
|
150
|
-
Protocols.prototype.toJSON = function toJSON() {
|
|
151
|
-
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
152
|
-
};
|
|
153
|
-
|
|
154
|
-
return Protocols;
|
|
155
|
-
})();
|
|
156
|
-
|
|
157
|
-
module.exports = $root;
|