@streamr/trackerless-network 103.1.2 → 103.2.0-experiment.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/exports.cjs +4489 -0
- package/dist/exports.cjs.map +1 -0
- package/dist/exports.d.ts +1391 -0
- package/dist/exports.js +4477 -0
- package/dist/exports.js.map +1 -0
- package/package.json +25 -18
- package/dist/generated/google/protobuf/any.d.ts +0 -180
- package/dist/generated/google/protobuf/any.js +0 -155
- package/dist/generated/google/protobuf/any.js.map +0 -1
- package/dist/generated/google/protobuf/empty.d.ts +0 -31
- package/dist/generated/google/protobuf/empty.js +0 -45
- package/dist/generated/google/protobuf/empty.js.map +0 -1
- package/dist/generated/google/protobuf/timestamp.d.ts +0 -156
- package/dist/generated/google/protobuf/timestamp.js +0 -136
- package/dist/generated/google/protobuf/timestamp.js.map +0 -1
- package/dist/generated/packages/dht/protos/DhtRpc.client.d.ts +0 -371
- package/dist/generated/packages/dht/protos/DhtRpc.client.js +0 -292
- package/dist/generated/packages/dht/protos/DhtRpc.client.js.map +0 -1
- package/dist/generated/packages/dht/protos/DhtRpc.d.ts +0 -1031
- package/dist/generated/packages/dht/protos/DhtRpc.js +0 -702
- package/dist/generated/packages/dht/protos/DhtRpc.js.map +0 -1
- package/dist/generated/packages/dht/protos/DhtRpc.server.d.ts +0 -168
- package/dist/generated/packages/dht/protos/DhtRpc.server.js +0 -3
- package/dist/generated/packages/dht/protos/DhtRpc.server.js.map +0 -1
- package/dist/generated/packages/proto-rpc/protos/ProtoRpc.d.ts +0 -87
- package/dist/generated/packages/proto-rpc/protos/ProtoRpc.js +0 -66
- package/dist/generated/packages/proto-rpc/protos/ProtoRpc.js.map +0 -1
- package/dist/generated/packages/trackerless-network/protos/NetworkRpc.client.d.ts +0 -237
- package/dist/generated/packages/trackerless-network/protos/NetworkRpc.client.js +0 -190
- package/dist/generated/packages/trackerless-network/protos/NetworkRpc.client.js.map +0 -1
- package/dist/generated/packages/trackerless-network/protos/NetworkRpc.d.ts +0 -687
- package/dist/generated/packages/trackerless-network/protos/NetworkRpc.js +0 -479
- package/dist/generated/packages/trackerless-network/protos/NetworkRpc.js.map +0 -1
- package/dist/generated/packages/trackerless-network/protos/NetworkRpc.server.d.ts +0 -102
- package/dist/generated/packages/trackerless-network/protos/NetworkRpc.server.js +0 -3
- package/dist/generated/packages/trackerless-network/protos/NetworkRpc.server.js.map +0 -1
- package/dist/package.json +0 -56
- package/dist/src/ContentDeliveryManager.d.ts +0 -82
- package/dist/src/ContentDeliveryManager.js +0 -325
- package/dist/src/ContentDeliveryManager.js.map +0 -1
- package/dist/src/NetworkNode.d.ts +0 -44
- package/dist/src/NetworkNode.js +0 -98
- package/dist/src/NetworkNode.js.map +0 -1
- package/dist/src/NetworkStack.d.ts +0 -36
- package/dist/src/NetworkStack.js +0 -165
- package/dist/src/NetworkStack.js.map +0 -1
- package/dist/src/NodeInfoClient.d.ts +0 -9
- package/dist/src/NodeInfoClient.js +0 -21
- package/dist/src/NodeInfoClient.js.map +0 -1
- package/dist/src/NodeInfoRpcLocal.d.ts +0 -12
- package/dist/src/NodeInfoRpcLocal.js +0 -22
- package/dist/src/NodeInfoRpcLocal.js.map +0 -1
- package/dist/src/NodeInfoRpcRemote.d.ts +0 -6
- package/dist/src/NodeInfoRpcRemote.js +0 -11
- package/dist/src/NodeInfoRpcRemote.js.map +0 -1
- package/dist/src/StreamPartNetworkSplitAvoidance.d.ts +0 -18
- package/dist/src/StreamPartNetworkSplitAvoidance.js +0 -74
- package/dist/src/StreamPartNetworkSplitAvoidance.js.map +0 -1
- package/dist/src/StreamPartReconnect.d.ts +0 -11
- package/dist/src/StreamPartReconnect.js +0 -37
- package/dist/src/StreamPartReconnect.js.map +0 -1
- package/dist/src/content-delivery-layer/ContentDeliveryLayerNode.d.ts +0 -78
- package/dist/src/content-delivery-layer/ContentDeliveryLayerNode.js +0 -240
- package/dist/src/content-delivery-layer/ContentDeliveryLayerNode.js.map +0 -1
- package/dist/src/content-delivery-layer/ContentDeliveryRpcLocal.d.ts +0 -23
- package/dist/src/content-delivery-layer/ContentDeliveryRpcLocal.js +0 -40
- package/dist/src/content-delivery-layer/ContentDeliveryRpcLocal.js.map +0 -1
- package/dist/src/content-delivery-layer/ContentDeliveryRpcRemote.d.ts +0 -11
- package/dist/src/content-delivery-layer/ContentDeliveryRpcRemote.js +0 -38
- package/dist/src/content-delivery-layer/ContentDeliveryRpcRemote.js.map +0 -1
- package/dist/src/content-delivery-layer/DuplicateMessageDetector.d.ts +0 -55
- package/dist/src/content-delivery-layer/DuplicateMessageDetector.js +0 -159
- package/dist/src/content-delivery-layer/DuplicateMessageDetector.js.map +0 -1
- package/dist/src/content-delivery-layer/NodeList.d.ts +0 -26
- package/dist/src/content-delivery-layer/NodeList.js +0 -93
- package/dist/src/content-delivery-layer/NodeList.js.map +0 -1
- package/dist/src/content-delivery-layer/createContentDeliveryLayerNode.d.ts +0 -14
- package/dist/src/content-delivery-layer/createContentDeliveryLayerNode.js +0 -129
- package/dist/src/content-delivery-layer/createContentDeliveryLayerNode.js.map +0 -1
- package/dist/src/content-delivery-layer/formStreamPartDeliveryServiceId.d.ts +0 -3
- package/dist/src/content-delivery-layer/formStreamPartDeliveryServiceId.js +0 -9
- package/dist/src/content-delivery-layer/formStreamPartDeliveryServiceId.js.map +0 -1
- package/dist/src/content-delivery-layer/inspection/InspectSession.d.ts +0 -19
- package/dist/src/content-delivery-layer/inspection/InspectSession.js +0 -43
- package/dist/src/content-delivery-layer/inspection/InspectSession.js.map +0 -1
- package/dist/src/content-delivery-layer/inspection/Inspector.d.ts +0 -30
- package/dist/src/content-delivery-layer/inspection/Inspector.js +0 -75
- package/dist/src/content-delivery-layer/inspection/Inspector.js.map +0 -1
- package/dist/src/content-delivery-layer/neighbor-discovery/HandshakeRpcLocal.d.ts +0 -29
- package/dist/src/content-delivery-layer/neighbor-discovery/HandshakeRpcLocal.js +0 -106
- package/dist/src/content-delivery-layer/neighbor-discovery/HandshakeRpcLocal.js.map +0 -1
- package/dist/src/content-delivery-layer/neighbor-discovery/HandshakeRpcRemote.d.ts +0 -14
- package/dist/src/content-delivery-layer/neighbor-discovery/HandshakeRpcRemote.js +0 -55
- package/dist/src/content-delivery-layer/neighbor-discovery/HandshakeRpcRemote.js.map +0 -1
- package/dist/src/content-delivery-layer/neighbor-discovery/Handshaker.d.ts +0 -32
- package/dist/src/content-delivery-layer/neighbor-discovery/Handshaker.js +0 -149
- package/dist/src/content-delivery-layer/neighbor-discovery/Handshaker.js.map +0 -1
- package/dist/src/content-delivery-layer/neighbor-discovery/NeighborFinder.d.ts +0 -22
- package/dist/src/content-delivery-layer/neighbor-discovery/NeighborFinder.js +0 -64
- package/dist/src/content-delivery-layer/neighbor-discovery/NeighborFinder.js.map +0 -1
- package/dist/src/content-delivery-layer/neighbor-discovery/NeighborUpdateManager.d.ts +0 -27
- package/dist/src/content-delivery-layer/neighbor-discovery/NeighborUpdateManager.js +0 -47
- package/dist/src/content-delivery-layer/neighbor-discovery/NeighborUpdateManager.js.map +0 -1
- package/dist/src/content-delivery-layer/neighbor-discovery/NeighborUpdateRpcLocal.d.ts +0 -25
- package/dist/src/content-delivery-layer/neighbor-discovery/NeighborUpdateRpcLocal.js +0 -52
- package/dist/src/content-delivery-layer/neighbor-discovery/NeighborUpdateRpcLocal.js.map +0 -1
- package/dist/src/content-delivery-layer/neighbor-discovery/NeighborUpdateRpcRemote.d.ts +0 -11
- package/dist/src/content-delivery-layer/neighbor-discovery/NeighborUpdateRpcRemote.js +0 -31
- package/dist/src/content-delivery-layer/neighbor-discovery/NeighborUpdateRpcRemote.js.map +0 -1
- package/dist/src/content-delivery-layer/plumtree/PausedNeighbors.d.ts +0 -12
- package/dist/src/content-delivery-layer/plumtree/PausedNeighbors.js +0 -50
- package/dist/src/content-delivery-layer/plumtree/PausedNeighbors.js.map +0 -1
- package/dist/src/content-delivery-layer/plumtree/PlumtreeManager.d.ts +0 -37
- package/dist/src/content-delivery-layer/plumtree/PlumtreeManager.js +0 -141
- package/dist/src/content-delivery-layer/plumtree/PlumtreeManager.js.map +0 -1
- package/dist/src/content-delivery-layer/plumtree/PlumtreeRpcLocal.d.ts +0 -20
- package/dist/src/content-delivery-layer/plumtree/PlumtreeRpcLocal.js +0 -37
- package/dist/src/content-delivery-layer/plumtree/PlumtreeRpcLocal.js.map +0 -1
- package/dist/src/content-delivery-layer/plumtree/PlumtreeRpcRemote.d.ts +0 -8
- package/dist/src/content-delivery-layer/plumtree/PlumtreeRpcRemote.js +0 -26
- package/dist/src/content-delivery-layer/plumtree/PlumtreeRpcRemote.js.map +0 -1
- package/dist/src/content-delivery-layer/propagation/FifoMapWithTTL.d.ts +0 -29
- package/dist/src/content-delivery-layer/propagation/FifoMapWithTTL.js +0 -93
- package/dist/src/content-delivery-layer/propagation/FifoMapWithTTL.js.map +0 -1
- package/dist/src/content-delivery-layer/propagation/Propagation.d.ts +0 -35
- package/dist/src/content-delivery-layer/propagation/Propagation.js +0 -68
- package/dist/src/content-delivery-layer/propagation/Propagation.js.map +0 -1
- package/dist/src/content-delivery-layer/propagation/PropagationTaskStore.d.ts +0 -22
- package/dist/src/content-delivery-layer/propagation/PropagationTaskStore.js +0 -33
- package/dist/src/content-delivery-layer/propagation/PropagationTaskStore.js.map +0 -1
- package/dist/src/content-delivery-layer/proxy/ProxyClient.d.ts +0 -46
- package/dist/src/content-delivery-layer/proxy/ProxyClient.js +0 -214
- package/dist/src/content-delivery-layer/proxy/ProxyClient.js.map +0 -1
- package/dist/src/content-delivery-layer/proxy/ProxyConnectionRpcLocal.d.ts +0 -34
- package/dist/src/content-delivery-layer/proxy/ProxyConnectionRpcLocal.js +0 -72
- package/dist/src/content-delivery-layer/proxy/ProxyConnectionRpcLocal.js.map +0 -1
- package/dist/src/content-delivery-layer/proxy/ProxyConnectionRpcRemote.d.ts +0 -7
- package/dist/src/content-delivery-layer/proxy/ProxyConnectionRpcRemote.js +0 -27
- package/dist/src/content-delivery-layer/proxy/ProxyConnectionRpcRemote.js.map +0 -1
- package/dist/src/content-delivery-layer/temporary-connection/TemporaryConnectionRpcLocal.d.ts +0 -26
- package/dist/src/content-delivery-layer/temporary-connection/TemporaryConnectionRpcLocal.js +0 -45
- package/dist/src/content-delivery-layer/temporary-connection/TemporaryConnectionRpcLocal.js.map +0 -1
- package/dist/src/content-delivery-layer/temporary-connection/TemporaryConnectionRpcRemote.d.ts +0 -6
- package/dist/src/content-delivery-layer/temporary-connection/TemporaryConnectionRpcRemote.js +0 -31
- package/dist/src/content-delivery-layer/temporary-connection/TemporaryConnectionRpcRemote.js.map +0 -1
- package/dist/src/control-layer/ControlLayerNode.d.ts +0 -16
- package/dist/src/control-layer/ControlLayerNode.js +0 -3
- package/dist/src/control-layer/ControlLayerNode.js.map +0 -1
- package/dist/src/control-layer/ExternalNetworkRpc.d.ts +0 -16
- package/dist/src/control-layer/ExternalNetworkRpc.js +0 -23
- package/dist/src/control-layer/ExternalNetworkRpc.js.map +0 -1
- package/dist/src/control-layer/PeerDescriptorStoreManager.d.ts +0 -28
- package/dist/src/control-layer/PeerDescriptorStoreManager.js +0 -78
- package/dist/src/control-layer/PeerDescriptorStoreManager.js.map +0 -1
- package/dist/src/discovery-layer/DiscoveryLayerNode.d.ts +0 -28
- package/dist/src/discovery-layer/DiscoveryLayerNode.js +0 -3
- package/dist/src/discovery-layer/DiscoveryLayerNode.js.map +0 -1
- package/dist/src/exports.d.ts +0 -6
- package/dist/src/exports.js +0 -24
- package/dist/src/exports.js.map +0 -1
- package/dist/src/types.d.ts +0 -6
- package/dist/src/types.js +0 -3
- package/dist/src/types.js.map +0 -1
- package/dist/src/utils.d.ts +0 -3
- package/dist/src/utils.js +0 -17
- package/dist/src/utils.js.map +0 -1
- package/dist/test/benchmark/first-message.d.ts +0 -1
- package/dist/test/benchmark/first-message.js +0 -139
- package/dist/test/benchmark/first-message.js.map +0 -1
- package/dist/test/utils/utils.d.ts +0 -15
- package/dist/test/utils/utils.js +0 -106
- package/dist/test/utils/utils.js.map +0 -1
|
@@ -0,0 +1,1391 @@
|
|
|
1
|
+
import * as _protobuf_ts_runtime from '@protobuf-ts/runtime';
|
|
2
|
+
import { MessageType, PartialMessage, IBinaryReader, BinaryReadOptions, IBinaryWriter, BinaryWriteOptions, IMessageType, JsonWriteOptions, JsonValue, JsonReadOptions } from '@protobuf-ts/runtime';
|
|
3
|
+
import * as _protobuf_ts_runtime_rpc from '@protobuf-ts/runtime-rpc';
|
|
4
|
+
import { ServiceInfo, RpcOptions, UnaryCall, RpcTransport, ServerCallContext } from '@protobuf-ts/runtime-rpc';
|
|
5
|
+
import { PeerDescriptor as PeerDescriptor$1, DhtAddress, RingContacts, RpcRemote, ListeningRpcCommunicator, ConnectionLocker, LockID, ITransport, DataEntry, ConnectionsView, DhtNodeOptions } from '@streamr/dht';
|
|
6
|
+
import { ClassType, ClientTransport, ProtoRpcClient } from '@streamr/proto-rpc';
|
|
7
|
+
import { StreamPartID, UserID, ChangeFieldType, MetricsContext } from '@streamr/utils';
|
|
8
|
+
import { EventEmitter } from 'eventemitter3';
|
|
9
|
+
import { MarkRequired } from 'ts-essentials';
|
|
10
|
+
|
|
11
|
+
type ExternalRpcClient = ServiceInfo & ClassType;
|
|
12
|
+
type ExternalRpcClientClass<T extends ExternalRpcClient> = {
|
|
13
|
+
new (clientTransport: ClientTransport): T;
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
declare class Empty$Type extends MessageType<Empty> {
|
|
17
|
+
constructor();
|
|
18
|
+
create(value?: PartialMessage<Empty>): Empty;
|
|
19
|
+
internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: Empty): Empty;
|
|
20
|
+
internalBinaryWrite(message: Empty, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* A generic empty message that you can re-use to avoid defining duplicated
|
|
24
|
+
* empty messages in your APIs. A typical example is to use it as the request
|
|
25
|
+
* or the response type of an API method. For instance:
|
|
26
|
+
*
|
|
27
|
+
* service Foo {
|
|
28
|
+
* rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty);
|
|
29
|
+
* }
|
|
30
|
+
*
|
|
31
|
+
*
|
|
32
|
+
* @generated from protobuf message google.protobuf.Empty
|
|
33
|
+
*/
|
|
34
|
+
interface Empty {
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* @generated MessageType for protobuf message google.protobuf.Empty
|
|
38
|
+
*/
|
|
39
|
+
declare const Empty: Empty$Type;
|
|
40
|
+
|
|
41
|
+
declare class Any$Type extends MessageType<Any> {
|
|
42
|
+
constructor();
|
|
43
|
+
/**
|
|
44
|
+
* Pack the message into a new `Any`.
|
|
45
|
+
*
|
|
46
|
+
* Uses 'type.googleapis.com/full.type.name' as the type URL.
|
|
47
|
+
*/
|
|
48
|
+
pack<T extends object>(message: T, type: IMessageType<T>): Any;
|
|
49
|
+
/**
|
|
50
|
+
* Unpack the message from the `Any`.
|
|
51
|
+
*/
|
|
52
|
+
unpack<T extends object>(any: Any, type: IMessageType<T>, options?: Partial<BinaryReadOptions>): T;
|
|
53
|
+
/**
|
|
54
|
+
* Does the given `Any` contain a packed message of the given type?
|
|
55
|
+
*/
|
|
56
|
+
contains(any: Any, type: IMessageType<any> | string): boolean;
|
|
57
|
+
/**
|
|
58
|
+
* Convert the message to canonical JSON value.
|
|
59
|
+
*
|
|
60
|
+
* You have to provide the `typeRegistry` option so that the
|
|
61
|
+
* packed message can be converted to JSON.
|
|
62
|
+
*
|
|
63
|
+
* The `typeRegistry` option is also required to read
|
|
64
|
+
* `google.protobuf.Any` from JSON format.
|
|
65
|
+
*/
|
|
66
|
+
internalJsonWrite(any: Any, options: JsonWriteOptions): JsonValue;
|
|
67
|
+
internalJsonRead(json: JsonValue, options: JsonReadOptions, target?: Any): Any;
|
|
68
|
+
typeNameToUrl(name: string): string;
|
|
69
|
+
typeUrlToName(url: string): string;
|
|
70
|
+
create(value?: PartialMessage<Any>): Any;
|
|
71
|
+
internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: Any): Any;
|
|
72
|
+
internalBinaryWrite(message: Any, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter;
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* `Any` contains an arbitrary serialized protocol buffer message along with a
|
|
76
|
+
* URL that describes the type of the serialized message.
|
|
77
|
+
*
|
|
78
|
+
* Protobuf library provides support to pack/unpack Any values in the form
|
|
79
|
+
* of utility functions or additional generated methods of the Any type.
|
|
80
|
+
*
|
|
81
|
+
* Example 1: Pack and unpack a message in C++.
|
|
82
|
+
*
|
|
83
|
+
* Foo foo = ...;
|
|
84
|
+
* Any any;
|
|
85
|
+
* any.PackFrom(foo);
|
|
86
|
+
* ...
|
|
87
|
+
* if (any.UnpackTo(&foo)) {
|
|
88
|
+
* ...
|
|
89
|
+
* }
|
|
90
|
+
*
|
|
91
|
+
* Example 2: Pack and unpack a message in Java.
|
|
92
|
+
*
|
|
93
|
+
* Foo foo = ...;
|
|
94
|
+
* Any any = Any.pack(foo);
|
|
95
|
+
* ...
|
|
96
|
+
* if (any.is(Foo.class)) {
|
|
97
|
+
* foo = any.unpack(Foo.class);
|
|
98
|
+
* }
|
|
99
|
+
* // or ...
|
|
100
|
+
* if (any.isSameTypeAs(Foo.getDefaultInstance())) {
|
|
101
|
+
* foo = any.unpack(Foo.getDefaultInstance());
|
|
102
|
+
* }
|
|
103
|
+
*
|
|
104
|
+
* Example 3: Pack and unpack a message in Python.
|
|
105
|
+
*
|
|
106
|
+
* foo = Foo(...)
|
|
107
|
+
* any = Any()
|
|
108
|
+
* any.Pack(foo)
|
|
109
|
+
* ...
|
|
110
|
+
* if any.Is(Foo.DESCRIPTOR):
|
|
111
|
+
* any.Unpack(foo)
|
|
112
|
+
* ...
|
|
113
|
+
*
|
|
114
|
+
* Example 4: Pack and unpack a message in Go
|
|
115
|
+
*
|
|
116
|
+
* foo := &pb.Foo{...}
|
|
117
|
+
* any, err := anypb.New(foo)
|
|
118
|
+
* if err != nil {
|
|
119
|
+
* ...
|
|
120
|
+
* }
|
|
121
|
+
* ...
|
|
122
|
+
* foo := &pb.Foo{}
|
|
123
|
+
* if err := any.UnmarshalTo(foo); err != nil {
|
|
124
|
+
* ...
|
|
125
|
+
* }
|
|
126
|
+
*
|
|
127
|
+
* The pack methods provided by protobuf library will by default use
|
|
128
|
+
* 'type.googleapis.com/full.type.name' as the type URL and the unpack
|
|
129
|
+
* methods only use the fully qualified type name after the last '/'
|
|
130
|
+
* in the type URL, for example "foo.bar.com/x/y.z" will yield type
|
|
131
|
+
* name "y.z".
|
|
132
|
+
*
|
|
133
|
+
* JSON
|
|
134
|
+
* ====
|
|
135
|
+
* The JSON representation of an `Any` value uses the regular
|
|
136
|
+
* representation of the deserialized, embedded message, with an
|
|
137
|
+
* additional field `@type` which contains the type URL. Example:
|
|
138
|
+
*
|
|
139
|
+
* package google.profile;
|
|
140
|
+
* message Person {
|
|
141
|
+
* string first_name = 1;
|
|
142
|
+
* string last_name = 2;
|
|
143
|
+
* }
|
|
144
|
+
*
|
|
145
|
+
* {
|
|
146
|
+
* "@type": "type.googleapis.com/google.profile.Person",
|
|
147
|
+
* "firstName": <string>,
|
|
148
|
+
* "lastName": <string>
|
|
149
|
+
* }
|
|
150
|
+
*
|
|
151
|
+
* If the embedded message type is well-known and has a custom JSON
|
|
152
|
+
* representation, that representation will be embedded adding a field
|
|
153
|
+
* `value` which holds the custom JSON in addition to the `@type`
|
|
154
|
+
* field. Example (for message [google.protobuf.Duration][]):
|
|
155
|
+
*
|
|
156
|
+
* {
|
|
157
|
+
* "@type": "type.googleapis.com/google.protobuf.Duration",
|
|
158
|
+
* "value": "1.212s"
|
|
159
|
+
* }
|
|
160
|
+
*
|
|
161
|
+
*
|
|
162
|
+
* @generated from protobuf message google.protobuf.Any
|
|
163
|
+
*/
|
|
164
|
+
interface Any {
|
|
165
|
+
/**
|
|
166
|
+
* A URL/resource name that uniquely identifies the type of the serialized
|
|
167
|
+
* protocol buffer message. This string must contain at least
|
|
168
|
+
* one "/" character. The last segment of the URL's path must represent
|
|
169
|
+
* the fully qualified name of the type (as in
|
|
170
|
+
* `path/google.protobuf.Duration`). The name should be in a canonical form
|
|
171
|
+
* (e.g., leading "." is not accepted).
|
|
172
|
+
*
|
|
173
|
+
* In practice, teams usually precompile into the binary all types that they
|
|
174
|
+
* expect it to use in the context of Any. However, for URLs which use the
|
|
175
|
+
* scheme `http`, `https`, or no scheme, one can optionally set up a type
|
|
176
|
+
* server that maps type URLs to message definitions as follows:
|
|
177
|
+
*
|
|
178
|
+
* * If no scheme is provided, `https` is assumed.
|
|
179
|
+
* * An HTTP GET on the URL must yield a [google.protobuf.Type][]
|
|
180
|
+
* value in binary format, or produce an error.
|
|
181
|
+
* * Applications are allowed to cache lookup results based on the
|
|
182
|
+
* URL, or have them precompiled into a binary to avoid any
|
|
183
|
+
* lookup. Therefore, binary compatibility needs to be preserved
|
|
184
|
+
* on changes to types. (Use versioned type names to manage
|
|
185
|
+
* breaking changes.)
|
|
186
|
+
*
|
|
187
|
+
* Note: this functionality is not currently available in the official
|
|
188
|
+
* protobuf release, and it is not used for type URLs beginning with
|
|
189
|
+
* type.googleapis.com. As of May 2023, there are no widely used type server
|
|
190
|
+
* implementations and no plans to implement one.
|
|
191
|
+
*
|
|
192
|
+
* Schemes other than `http`, `https` (or the empty scheme) might be
|
|
193
|
+
* used with implementation specific semantics.
|
|
194
|
+
*
|
|
195
|
+
*
|
|
196
|
+
* @generated from protobuf field: string type_url = 1
|
|
197
|
+
*/
|
|
198
|
+
typeUrl: string;
|
|
199
|
+
/**
|
|
200
|
+
* Must be a valid serialized protocol buffer of the above specified type.
|
|
201
|
+
*
|
|
202
|
+
* @generated from protobuf field: bytes value = 2
|
|
203
|
+
*/
|
|
204
|
+
value: Uint8Array;
|
|
205
|
+
}
|
|
206
|
+
/**
|
|
207
|
+
* @generated MessageType for protobuf message google.protobuf.Any
|
|
208
|
+
*/
|
|
209
|
+
declare const Any: Any$Type;
|
|
210
|
+
|
|
211
|
+
/**
|
|
212
|
+
* @generated from protobuf enum dht.NodeType
|
|
213
|
+
*/
|
|
214
|
+
declare enum NodeType {
|
|
215
|
+
/**
|
|
216
|
+
* @generated from protobuf enum value: NODEJS = 0;
|
|
217
|
+
*/
|
|
218
|
+
NODEJS = 0,
|
|
219
|
+
/**
|
|
220
|
+
* @generated from protobuf enum value: BROWSER = 1;
|
|
221
|
+
*/
|
|
222
|
+
BROWSER = 1
|
|
223
|
+
}
|
|
224
|
+
declare class PeerDescriptor$Type extends MessageType<PeerDescriptor> {
|
|
225
|
+
constructor();
|
|
226
|
+
}
|
|
227
|
+
/**
|
|
228
|
+
* @generated from protobuf message dht.PeerDescriptor
|
|
229
|
+
*/
|
|
230
|
+
interface PeerDescriptor {
|
|
231
|
+
/**
|
|
232
|
+
* @generated from protobuf field: bytes nodeId = 1
|
|
233
|
+
*/
|
|
234
|
+
nodeId: Uint8Array;
|
|
235
|
+
/**
|
|
236
|
+
* @generated from protobuf field: dht.NodeType type = 2
|
|
237
|
+
*/
|
|
238
|
+
type: NodeType;
|
|
239
|
+
/**
|
|
240
|
+
* @generated from protobuf field: dht.ConnectivityMethod udp = 3
|
|
241
|
+
*/
|
|
242
|
+
udp?: ConnectivityMethod;
|
|
243
|
+
/**
|
|
244
|
+
* @generated from protobuf field: dht.ConnectivityMethod tcp = 4
|
|
245
|
+
*/
|
|
246
|
+
tcp?: ConnectivityMethod;
|
|
247
|
+
/**
|
|
248
|
+
* @generated from protobuf field: dht.ConnectivityMethod websocket = 5
|
|
249
|
+
*/
|
|
250
|
+
websocket?: ConnectivityMethod;
|
|
251
|
+
/**
|
|
252
|
+
* @generated from protobuf field: optional uint32 region = 6
|
|
253
|
+
*/
|
|
254
|
+
region?: number;
|
|
255
|
+
/**
|
|
256
|
+
* @generated from protobuf field: optional uint32 ipAddress = 7
|
|
257
|
+
*/
|
|
258
|
+
ipAddress?: number;
|
|
259
|
+
/**
|
|
260
|
+
* @generated from protobuf field: optional bytes publicKey = 8
|
|
261
|
+
*/
|
|
262
|
+
publicKey?: Uint8Array;
|
|
263
|
+
/**
|
|
264
|
+
* signature of fields 2-8
|
|
265
|
+
*
|
|
266
|
+
* @generated from protobuf field: optional bytes signature = 9
|
|
267
|
+
*/
|
|
268
|
+
signature?: Uint8Array;
|
|
269
|
+
}
|
|
270
|
+
/**
|
|
271
|
+
* @generated MessageType for protobuf message dht.PeerDescriptor
|
|
272
|
+
*/
|
|
273
|
+
declare const PeerDescriptor: PeerDescriptor$Type;
|
|
274
|
+
declare class ConnectivityMethod$Type extends MessageType<ConnectivityMethod> {
|
|
275
|
+
constructor();
|
|
276
|
+
}
|
|
277
|
+
/**
|
|
278
|
+
* @generated from protobuf message dht.ConnectivityMethod
|
|
279
|
+
*/
|
|
280
|
+
interface ConnectivityMethod {
|
|
281
|
+
/**
|
|
282
|
+
* @generated from protobuf field: uint32 port = 1
|
|
283
|
+
*/
|
|
284
|
+
port: number;
|
|
285
|
+
/**
|
|
286
|
+
* @generated from protobuf field: string host = 2
|
|
287
|
+
*/
|
|
288
|
+
host: string;
|
|
289
|
+
/**
|
|
290
|
+
* @generated from protobuf field: bool tls = 3
|
|
291
|
+
*/
|
|
292
|
+
tls: boolean;
|
|
293
|
+
}
|
|
294
|
+
/**
|
|
295
|
+
* @generated MessageType for protobuf message dht.ConnectivityMethod
|
|
296
|
+
*/
|
|
297
|
+
declare const ConnectivityMethod: ConnectivityMethod$Type;
|
|
298
|
+
|
|
299
|
+
/**
|
|
300
|
+
* @generated from protobuf enum ContentType
|
|
301
|
+
*/
|
|
302
|
+
declare enum ContentType {
|
|
303
|
+
/**
|
|
304
|
+
* @generated from protobuf enum value: JSON = 0;
|
|
305
|
+
*/
|
|
306
|
+
JSON = 0,
|
|
307
|
+
/**
|
|
308
|
+
* @generated from protobuf enum value: BINARY = 1;
|
|
309
|
+
*/
|
|
310
|
+
BINARY = 1
|
|
311
|
+
}
|
|
312
|
+
/**
|
|
313
|
+
* @generated from protobuf enum EncryptionType
|
|
314
|
+
*/
|
|
315
|
+
declare enum EncryptionType {
|
|
316
|
+
/**
|
|
317
|
+
* @generated from protobuf enum value: NONE = 0;
|
|
318
|
+
*/
|
|
319
|
+
NONE = 0,
|
|
320
|
+
/**
|
|
321
|
+
* @generated from protobuf enum value: AES = 1;
|
|
322
|
+
*/
|
|
323
|
+
AES = 1
|
|
324
|
+
}
|
|
325
|
+
/**
|
|
326
|
+
* @generated from protobuf enum AsymmetricEncryptionType
|
|
327
|
+
*/
|
|
328
|
+
declare enum AsymmetricEncryptionType {
|
|
329
|
+
/**
|
|
330
|
+
* default
|
|
331
|
+
*
|
|
332
|
+
* @generated from protobuf enum value: RSA = 0;
|
|
333
|
+
*/
|
|
334
|
+
RSA = 0,
|
|
335
|
+
/**
|
|
336
|
+
* @generated from protobuf enum value: ML_KEM = 1;
|
|
337
|
+
*/
|
|
338
|
+
ML_KEM = 1
|
|
339
|
+
}
|
|
340
|
+
/**
|
|
341
|
+
* @generated from protobuf enum SignatureType
|
|
342
|
+
*/
|
|
343
|
+
declare enum SignatureType {
|
|
344
|
+
/**
|
|
345
|
+
* @generated from protobuf enum value: ECDSA_SECP256K1_LEGACY = 0;
|
|
346
|
+
*/
|
|
347
|
+
ECDSA_SECP256K1_LEGACY = 0,
|
|
348
|
+
/**
|
|
349
|
+
* @generated from protobuf enum value: ECDSA_SECP256K1_EVM = 1;
|
|
350
|
+
*/
|
|
351
|
+
ECDSA_SECP256K1_EVM = 1,
|
|
352
|
+
/**
|
|
353
|
+
* @generated from protobuf enum value: ERC_1271 = 2;
|
|
354
|
+
*/
|
|
355
|
+
ERC_1271 = 2,
|
|
356
|
+
/**
|
|
357
|
+
* @generated from protobuf enum value: ML_DSA_87 = 3;
|
|
358
|
+
*/
|
|
359
|
+
ML_DSA_87 = 3,
|
|
360
|
+
/**
|
|
361
|
+
* @generated from protobuf enum value: ECDSA_SECP256R1 = 4;
|
|
362
|
+
*/
|
|
363
|
+
ECDSA_SECP256R1 = 4
|
|
364
|
+
}
|
|
365
|
+
/**
|
|
366
|
+
* @generated from protobuf enum ProxyDirection
|
|
367
|
+
*/
|
|
368
|
+
declare enum ProxyDirection {
|
|
369
|
+
/**
|
|
370
|
+
* @generated from protobuf enum value: PUBLISH = 0;
|
|
371
|
+
*/
|
|
372
|
+
PUBLISH = 0,
|
|
373
|
+
/**
|
|
374
|
+
* @generated from protobuf enum value: SUBSCRIBE = 1;
|
|
375
|
+
*/
|
|
376
|
+
SUBSCRIBE = 1
|
|
377
|
+
}
|
|
378
|
+
declare class MessageID$Type extends MessageType<MessageID> {
|
|
379
|
+
constructor();
|
|
380
|
+
}
|
|
381
|
+
/**
|
|
382
|
+
* @generated from protobuf message MessageID
|
|
383
|
+
*/
|
|
384
|
+
interface MessageID {
|
|
385
|
+
/**
|
|
386
|
+
* @generated from protobuf field: string streamId = 1
|
|
387
|
+
*/
|
|
388
|
+
streamId: string;
|
|
389
|
+
/**
|
|
390
|
+
* @generated from protobuf field: int32 streamPartition = 2
|
|
391
|
+
*/
|
|
392
|
+
streamPartition: number;
|
|
393
|
+
/**
|
|
394
|
+
* @generated from protobuf field: int64 timestamp = 3
|
|
395
|
+
*/
|
|
396
|
+
timestamp: number;
|
|
397
|
+
/**
|
|
398
|
+
* @generated from protobuf field: int32 sequenceNumber = 4
|
|
399
|
+
*/
|
|
400
|
+
sequenceNumber: number;
|
|
401
|
+
/**
|
|
402
|
+
* @generated from protobuf field: bytes publisherId = 5
|
|
403
|
+
*/
|
|
404
|
+
publisherId: Uint8Array;
|
|
405
|
+
/**
|
|
406
|
+
* @generated from protobuf field: string messageChainId = 6
|
|
407
|
+
*/
|
|
408
|
+
messageChainId: string;
|
|
409
|
+
}
|
|
410
|
+
/**
|
|
411
|
+
* @generated MessageType for protobuf message MessageID
|
|
412
|
+
*/
|
|
413
|
+
declare const MessageID: MessageID$Type;
|
|
414
|
+
declare class MessageRef$Type extends MessageType<MessageRef> {
|
|
415
|
+
constructor();
|
|
416
|
+
}
|
|
417
|
+
/**
|
|
418
|
+
* @generated from protobuf message MessageRef
|
|
419
|
+
*/
|
|
420
|
+
interface MessageRef {
|
|
421
|
+
/**
|
|
422
|
+
* @generated from protobuf field: int64 timestamp = 1
|
|
423
|
+
*/
|
|
424
|
+
timestamp: number;
|
|
425
|
+
/**
|
|
426
|
+
* @generated from protobuf field: int32 sequenceNumber = 2
|
|
427
|
+
*/
|
|
428
|
+
sequenceNumber: number;
|
|
429
|
+
}
|
|
430
|
+
/**
|
|
431
|
+
* @generated MessageType for protobuf message MessageRef
|
|
432
|
+
*/
|
|
433
|
+
declare const MessageRef: MessageRef$Type;
|
|
434
|
+
declare class StreamMessage$Type extends MessageType<StreamMessage> {
|
|
435
|
+
constructor();
|
|
436
|
+
}
|
|
437
|
+
/**
|
|
438
|
+
* @generated from protobuf message StreamMessage
|
|
439
|
+
*/
|
|
440
|
+
interface StreamMessage {
|
|
441
|
+
/**
|
|
442
|
+
* this is a required field but in generated NetworkRpc.ts it is incorrectly annotated as optional (NET-1082)
|
|
443
|
+
*
|
|
444
|
+
* @generated from protobuf field: MessageID messageId = 1
|
|
445
|
+
*/
|
|
446
|
+
messageId?: MessageID;
|
|
447
|
+
/**
|
|
448
|
+
* @generated from protobuf field: optional MessageRef previousMessageRef = 2
|
|
449
|
+
*/
|
|
450
|
+
previousMessageRef?: MessageRef;
|
|
451
|
+
/**
|
|
452
|
+
* @generated from protobuf field: bytes signature = 3
|
|
453
|
+
*/
|
|
454
|
+
signature: Uint8Array;
|
|
455
|
+
/**
|
|
456
|
+
* @generated from protobuf field: SignatureType signatureType = 4
|
|
457
|
+
*/
|
|
458
|
+
signatureType: SignatureType;
|
|
459
|
+
/**
|
|
460
|
+
* @generated from protobuf oneof: body
|
|
461
|
+
*/
|
|
462
|
+
body: {
|
|
463
|
+
oneofKind: "contentMessage";
|
|
464
|
+
/**
|
|
465
|
+
* @generated from protobuf field: ContentMessage contentMessage = 5
|
|
466
|
+
*/
|
|
467
|
+
contentMessage: ContentMessage;
|
|
468
|
+
} | {
|
|
469
|
+
oneofKind: "groupKeyRequest";
|
|
470
|
+
/**
|
|
471
|
+
* @generated from protobuf field: GroupKeyRequest groupKeyRequest = 6
|
|
472
|
+
*/
|
|
473
|
+
groupKeyRequest: GroupKeyRequest;
|
|
474
|
+
} | {
|
|
475
|
+
oneofKind: "groupKeyResponse";
|
|
476
|
+
/**
|
|
477
|
+
* @generated from protobuf field: GroupKeyResponse groupKeyResponse = 7
|
|
478
|
+
*/
|
|
479
|
+
groupKeyResponse: GroupKeyResponse;
|
|
480
|
+
} | {
|
|
481
|
+
oneofKind: undefined;
|
|
482
|
+
};
|
|
483
|
+
}
|
|
484
|
+
/**
|
|
485
|
+
* @generated MessageType for protobuf message StreamMessage
|
|
486
|
+
*/
|
|
487
|
+
declare const StreamMessage: StreamMessage$Type;
|
|
488
|
+
declare class ContentMessage$Type extends MessageType<ContentMessage> {
|
|
489
|
+
constructor();
|
|
490
|
+
}
|
|
491
|
+
/**
|
|
492
|
+
* @generated from protobuf message ContentMessage
|
|
493
|
+
*/
|
|
494
|
+
interface ContentMessage {
|
|
495
|
+
/**
|
|
496
|
+
* @generated from protobuf field: bytes content = 1
|
|
497
|
+
*/
|
|
498
|
+
content: Uint8Array;
|
|
499
|
+
/**
|
|
500
|
+
* @generated from protobuf field: ContentType contentType = 2
|
|
501
|
+
*/
|
|
502
|
+
contentType: ContentType;
|
|
503
|
+
/**
|
|
504
|
+
* @generated from protobuf field: EncryptionType encryptionType = 3
|
|
505
|
+
*/
|
|
506
|
+
encryptionType: EncryptionType;
|
|
507
|
+
/**
|
|
508
|
+
* @generated from protobuf field: optional string groupKeyId = 4
|
|
509
|
+
*/
|
|
510
|
+
groupKeyId?: string;
|
|
511
|
+
/**
|
|
512
|
+
* @generated from protobuf field: optional EncryptedGroupKey newGroupKey = 5
|
|
513
|
+
*/
|
|
514
|
+
newGroupKey?: EncryptedGroupKey;
|
|
515
|
+
}
|
|
516
|
+
/**
|
|
517
|
+
* @generated MessageType for protobuf message ContentMessage
|
|
518
|
+
*/
|
|
519
|
+
declare const ContentMessage: ContentMessage$Type;
|
|
520
|
+
declare class GroupKeyRequest$Type extends MessageType<GroupKeyRequest> {
|
|
521
|
+
constructor();
|
|
522
|
+
}
|
|
523
|
+
/**
|
|
524
|
+
* @generated from protobuf message GroupKeyRequest
|
|
525
|
+
*/
|
|
526
|
+
interface GroupKeyRequest {
|
|
527
|
+
/**
|
|
528
|
+
* @generated from protobuf field: string requestId = 1
|
|
529
|
+
*/
|
|
530
|
+
requestId: string;
|
|
531
|
+
/**
|
|
532
|
+
* @generated from protobuf field: bytes recipientId = 2
|
|
533
|
+
*/
|
|
534
|
+
recipientId: Uint8Array;
|
|
535
|
+
/**
|
|
536
|
+
* @generated from protobuf field: bytes publicKey = 3
|
|
537
|
+
*/
|
|
538
|
+
publicKey: Uint8Array;
|
|
539
|
+
/**
|
|
540
|
+
* @generated from protobuf field: repeated string groupKeyIds = 4
|
|
541
|
+
*/
|
|
542
|
+
groupKeyIds: string[];
|
|
543
|
+
/**
|
|
544
|
+
* @generated from protobuf field: AsymmetricEncryptionType encryptionType = 5
|
|
545
|
+
*/
|
|
546
|
+
encryptionType: AsymmetricEncryptionType;
|
|
547
|
+
}
|
|
548
|
+
/**
|
|
549
|
+
* @generated MessageType for protobuf message GroupKeyRequest
|
|
550
|
+
*/
|
|
551
|
+
declare const GroupKeyRequest: GroupKeyRequest$Type;
|
|
552
|
+
declare class GroupKeyResponse$Type extends MessageType<GroupKeyResponse> {
|
|
553
|
+
constructor();
|
|
554
|
+
}
|
|
555
|
+
/**
|
|
556
|
+
* @generated from protobuf message GroupKeyResponse
|
|
557
|
+
*/
|
|
558
|
+
interface GroupKeyResponse {
|
|
559
|
+
/**
|
|
560
|
+
* @generated from protobuf field: string requestId = 1
|
|
561
|
+
*/
|
|
562
|
+
requestId: string;
|
|
563
|
+
/**
|
|
564
|
+
* @generated from protobuf field: bytes recipientId = 2
|
|
565
|
+
*/
|
|
566
|
+
recipientId: Uint8Array;
|
|
567
|
+
/**
|
|
568
|
+
* @generated from protobuf field: repeated EncryptedGroupKey groupKeys = 3
|
|
569
|
+
*/
|
|
570
|
+
groupKeys: EncryptedGroupKey[];
|
|
571
|
+
/**
|
|
572
|
+
* @generated from protobuf field: AsymmetricEncryptionType encryptionType = 4
|
|
573
|
+
*/
|
|
574
|
+
encryptionType: AsymmetricEncryptionType;
|
|
575
|
+
}
|
|
576
|
+
/**
|
|
577
|
+
* @generated MessageType for protobuf message GroupKeyResponse
|
|
578
|
+
*/
|
|
579
|
+
declare const GroupKeyResponse: GroupKeyResponse$Type;
|
|
580
|
+
declare class EncryptedGroupKey$Type extends MessageType<EncryptedGroupKey> {
|
|
581
|
+
constructor();
|
|
582
|
+
}
|
|
583
|
+
/**
|
|
584
|
+
* @generated from protobuf message EncryptedGroupKey
|
|
585
|
+
*/
|
|
586
|
+
interface EncryptedGroupKey {
|
|
587
|
+
/**
|
|
588
|
+
* @generated from protobuf field: string id = 1
|
|
589
|
+
*/
|
|
590
|
+
id: string;
|
|
591
|
+
/**
|
|
592
|
+
* @generated from protobuf field: bytes data = 2
|
|
593
|
+
*/
|
|
594
|
+
data: Uint8Array;
|
|
595
|
+
}
|
|
596
|
+
/**
|
|
597
|
+
* @generated MessageType for protobuf message EncryptedGroupKey
|
|
598
|
+
*/
|
|
599
|
+
declare const EncryptedGroupKey: EncryptedGroupKey$Type;
|
|
600
|
+
declare class LeaveStreamPartNotice$Type extends MessageType<LeaveStreamPartNotice> {
|
|
601
|
+
constructor();
|
|
602
|
+
}
|
|
603
|
+
/**
|
|
604
|
+
* @generated from protobuf message LeaveStreamPartNotice
|
|
605
|
+
*/
|
|
606
|
+
interface LeaveStreamPartNotice {
|
|
607
|
+
/**
|
|
608
|
+
* @generated from protobuf field: string streamPartId = 1
|
|
609
|
+
*/
|
|
610
|
+
streamPartId: string;
|
|
611
|
+
/**
|
|
612
|
+
* @generated from protobuf field: bool isEntryPoint = 2
|
|
613
|
+
*/
|
|
614
|
+
isEntryPoint: boolean;
|
|
615
|
+
}
|
|
616
|
+
/**
|
|
617
|
+
* @generated MessageType for protobuf message LeaveStreamPartNotice
|
|
618
|
+
*/
|
|
619
|
+
declare const LeaveStreamPartNotice: LeaveStreamPartNotice$Type;
|
|
620
|
+
declare class ProxyConnectionRequest$Type extends MessageType<ProxyConnectionRequest> {
|
|
621
|
+
constructor();
|
|
622
|
+
}
|
|
623
|
+
/**
|
|
624
|
+
* @generated from protobuf message ProxyConnectionRequest
|
|
625
|
+
*/
|
|
626
|
+
interface ProxyConnectionRequest {
|
|
627
|
+
/**
|
|
628
|
+
* @generated from protobuf field: optional ProxyDirection direction = 1
|
|
629
|
+
*/
|
|
630
|
+
direction?: ProxyDirection;
|
|
631
|
+
/**
|
|
632
|
+
* @generated from protobuf field: bytes userId = 2
|
|
633
|
+
*/
|
|
634
|
+
userId: Uint8Array;
|
|
635
|
+
}
|
|
636
|
+
/**
|
|
637
|
+
* @generated MessageType for protobuf message ProxyConnectionRequest
|
|
638
|
+
*/
|
|
639
|
+
declare const ProxyConnectionRequest: ProxyConnectionRequest$Type;
|
|
640
|
+
declare class ProxyConnectionResponse$Type extends MessageType<ProxyConnectionResponse> {
|
|
641
|
+
constructor();
|
|
642
|
+
}
|
|
643
|
+
/**
|
|
644
|
+
* @generated from protobuf message ProxyConnectionResponse
|
|
645
|
+
*/
|
|
646
|
+
interface ProxyConnectionResponse {
|
|
647
|
+
/**
|
|
648
|
+
* @generated from protobuf field: bool accepted = 1
|
|
649
|
+
*/
|
|
650
|
+
accepted: boolean;
|
|
651
|
+
}
|
|
652
|
+
/**
|
|
653
|
+
* @generated MessageType for protobuf message ProxyConnectionResponse
|
|
654
|
+
*/
|
|
655
|
+
declare const ProxyConnectionResponse: ProxyConnectionResponse$Type;
|
|
656
|
+
declare class TemporaryConnectionRequest$Type extends MessageType<TemporaryConnectionRequest> {
|
|
657
|
+
constructor();
|
|
658
|
+
}
|
|
659
|
+
/**
|
|
660
|
+
* @generated from protobuf message TemporaryConnectionRequest
|
|
661
|
+
*/
|
|
662
|
+
interface TemporaryConnectionRequest {
|
|
663
|
+
}
|
|
664
|
+
/**
|
|
665
|
+
* @generated MessageType for protobuf message TemporaryConnectionRequest
|
|
666
|
+
*/
|
|
667
|
+
declare const TemporaryConnectionRequest: TemporaryConnectionRequest$Type;
|
|
668
|
+
declare class TemporaryConnectionResponse$Type extends MessageType<TemporaryConnectionResponse> {
|
|
669
|
+
constructor();
|
|
670
|
+
}
|
|
671
|
+
/**
|
|
672
|
+
* @generated from protobuf message TemporaryConnectionResponse
|
|
673
|
+
*/
|
|
674
|
+
interface TemporaryConnectionResponse {
|
|
675
|
+
/**
|
|
676
|
+
* @generated from protobuf field: bool accepted = 1
|
|
677
|
+
*/
|
|
678
|
+
accepted: boolean;
|
|
679
|
+
}
|
|
680
|
+
/**
|
|
681
|
+
* @generated MessageType for protobuf message TemporaryConnectionResponse
|
|
682
|
+
*/
|
|
683
|
+
declare const TemporaryConnectionResponse: TemporaryConnectionResponse$Type;
|
|
684
|
+
declare class CloseTemporaryConnection$Type extends MessageType<CloseTemporaryConnection> {
|
|
685
|
+
constructor();
|
|
686
|
+
}
|
|
687
|
+
/**
|
|
688
|
+
* @generated from protobuf message CloseTemporaryConnection
|
|
689
|
+
*/
|
|
690
|
+
interface CloseTemporaryConnection {
|
|
691
|
+
}
|
|
692
|
+
/**
|
|
693
|
+
* @generated MessageType for protobuf message CloseTemporaryConnection
|
|
694
|
+
*/
|
|
695
|
+
declare const CloseTemporaryConnection: CloseTemporaryConnection$Type;
|
|
696
|
+
declare class StreamPartitionInfo$Type extends MessageType<StreamPartitionInfo$1> {
|
|
697
|
+
constructor();
|
|
698
|
+
}
|
|
699
|
+
/**
|
|
700
|
+
* @generated from protobuf message StreamPartitionInfo
|
|
701
|
+
*/
|
|
702
|
+
interface StreamPartitionInfo$1 {
|
|
703
|
+
/**
|
|
704
|
+
* @generated from protobuf field: string id = 1
|
|
705
|
+
*/
|
|
706
|
+
id: string;
|
|
707
|
+
/**
|
|
708
|
+
* @generated from protobuf field: repeated dht.PeerDescriptor controlLayerNeighbors = 2
|
|
709
|
+
*/
|
|
710
|
+
controlLayerNeighbors: PeerDescriptor[];
|
|
711
|
+
/**
|
|
712
|
+
* @generated from protobuf field: repeated dht.PeerDescriptor deprecatedContentDeliveryLayerNeighbors = 3
|
|
713
|
+
*/
|
|
714
|
+
deprecatedContentDeliveryLayerNeighbors: PeerDescriptor[];
|
|
715
|
+
/**
|
|
716
|
+
* @generated from protobuf field: repeated ContentDeliveryLayerNeighborInfo contentDeliveryLayerNeighbors = 4
|
|
717
|
+
*/
|
|
718
|
+
contentDeliveryLayerNeighbors: ContentDeliveryLayerNeighborInfo$1[];
|
|
719
|
+
}
|
|
720
|
+
/**
|
|
721
|
+
* @generated MessageType for protobuf message StreamPartitionInfo
|
|
722
|
+
*/
|
|
723
|
+
declare const StreamPartitionInfo$1: StreamPartitionInfo$Type;
|
|
724
|
+
declare class ContentDeliveryLayerNeighborInfo$Type extends MessageType<ContentDeliveryLayerNeighborInfo$1> {
|
|
725
|
+
constructor();
|
|
726
|
+
}
|
|
727
|
+
/**
|
|
728
|
+
* @generated from protobuf message ContentDeliveryLayerNeighborInfo
|
|
729
|
+
*/
|
|
730
|
+
interface ContentDeliveryLayerNeighborInfo$1 {
|
|
731
|
+
/**
|
|
732
|
+
* @generated from protobuf field: dht.PeerDescriptor peerDescriptor = 1
|
|
733
|
+
*/
|
|
734
|
+
peerDescriptor?: PeerDescriptor;
|
|
735
|
+
/**
|
|
736
|
+
* @generated from protobuf field: optional int32 rtt = 2
|
|
737
|
+
*/
|
|
738
|
+
rtt?: number;
|
|
739
|
+
}
|
|
740
|
+
/**
|
|
741
|
+
* @generated MessageType for protobuf message ContentDeliveryLayerNeighborInfo
|
|
742
|
+
*/
|
|
743
|
+
declare const ContentDeliveryLayerNeighborInfo$1: ContentDeliveryLayerNeighborInfo$Type;
|
|
744
|
+
declare class ControlLayerInfo$Type extends MessageType<ControlLayerInfo> {
|
|
745
|
+
constructor();
|
|
746
|
+
}
|
|
747
|
+
/**
|
|
748
|
+
* @generated from protobuf message ControlLayerInfo
|
|
749
|
+
*/
|
|
750
|
+
interface ControlLayerInfo {
|
|
751
|
+
/**
|
|
752
|
+
* @generated from protobuf field: repeated dht.PeerDescriptor neighbors = 1
|
|
753
|
+
*/
|
|
754
|
+
neighbors: PeerDescriptor[];
|
|
755
|
+
/**
|
|
756
|
+
* @generated from protobuf field: repeated dht.PeerDescriptor connections = 2
|
|
757
|
+
*/
|
|
758
|
+
connections: PeerDescriptor[];
|
|
759
|
+
}
|
|
760
|
+
/**
|
|
761
|
+
* @generated MessageType for protobuf message ControlLayerInfo
|
|
762
|
+
*/
|
|
763
|
+
declare const ControlLayerInfo: ControlLayerInfo$Type;
|
|
764
|
+
declare class NodeInfoResponse$Type extends MessageType<NodeInfoResponse> {
|
|
765
|
+
constructor();
|
|
766
|
+
}
|
|
767
|
+
/**
|
|
768
|
+
* @generated from protobuf message NodeInfoResponse
|
|
769
|
+
*/
|
|
770
|
+
interface NodeInfoResponse {
|
|
771
|
+
/**
|
|
772
|
+
* @generated from protobuf field: dht.PeerDescriptor peerDescriptor = 1
|
|
773
|
+
*/
|
|
774
|
+
peerDescriptor?: PeerDescriptor;
|
|
775
|
+
/**
|
|
776
|
+
* @generated from protobuf field: repeated StreamPartitionInfo streamPartitions = 2
|
|
777
|
+
*/
|
|
778
|
+
streamPartitions: StreamPartitionInfo$1[];
|
|
779
|
+
/**
|
|
780
|
+
* @generated from protobuf field: ControlLayerInfo controlLayer = 3
|
|
781
|
+
*/
|
|
782
|
+
controlLayer?: ControlLayerInfo;
|
|
783
|
+
/**
|
|
784
|
+
* @generated from protobuf field: string applicationVersion = 4
|
|
785
|
+
*/
|
|
786
|
+
applicationVersion: string;
|
|
787
|
+
}
|
|
788
|
+
/**
|
|
789
|
+
* @generated MessageType for protobuf message NodeInfoResponse
|
|
790
|
+
*/
|
|
791
|
+
declare const NodeInfoResponse: NodeInfoResponse$Type;
|
|
792
|
+
|
|
793
|
+
interface DiscoveryLayerNodeEvents {
|
|
794
|
+
manualRejoinRequired: () => void;
|
|
795
|
+
nearbyContactAdded: (peerDescriptor: PeerDescriptor$1) => void;
|
|
796
|
+
nearbyContactRemoved: (peerDescriptor: PeerDescriptor$1) => void;
|
|
797
|
+
randomContactAdded: (peerDescriptor: PeerDescriptor$1) => void;
|
|
798
|
+
randomContactRemoved: (peerDescriptor: PeerDescriptor$1) => void;
|
|
799
|
+
ringContactAdded: (peerDescriptor: PeerDescriptor$1) => void;
|
|
800
|
+
ringContactRemoved: (peerDescriptor: PeerDescriptor$1) => void;
|
|
801
|
+
}
|
|
802
|
+
interface DiscoveryLayerNode {
|
|
803
|
+
on<T extends keyof DiscoveryLayerNodeEvents>(eventName: T, listener: (peerDescriptor: PeerDescriptor$1) => void): void;
|
|
804
|
+
on<T extends keyof DiscoveryLayerNodeEvents>(eventName: T, listener: () => void): void;
|
|
805
|
+
off<T extends keyof DiscoveryLayerNodeEvents>(eventName: T, listener: (peerDescriptor: PeerDescriptor$1) => void): void;
|
|
806
|
+
off<T extends keyof DiscoveryLayerNodeEvents>(eventName: T, listener: () => void): void;
|
|
807
|
+
once<T extends keyof DiscoveryLayerNodeEvents>(eventName: T, listener: (peerDescriptor: PeerDescriptor$1) => void): void;
|
|
808
|
+
once<T extends keyof DiscoveryLayerNodeEvents>(eventName: T, listener: () => void): void;
|
|
809
|
+
removeContact: (nodeId: DhtAddress) => void;
|
|
810
|
+
getClosestContacts: (maxCount?: number) => PeerDescriptor$1[];
|
|
811
|
+
getRandomContacts: (maxCount?: number) => PeerDescriptor$1[];
|
|
812
|
+
getRingContacts: () => RingContacts;
|
|
813
|
+
getNeighbors: () => PeerDescriptor$1[];
|
|
814
|
+
getNeighborCount(): number;
|
|
815
|
+
joinDht: (entryPoints: PeerDescriptor$1[], doRandomJoin?: boolean, retry?: boolean) => Promise<void>;
|
|
816
|
+
joinRing: () => Promise<void>;
|
|
817
|
+
start: () => Promise<void>;
|
|
818
|
+
stop: () => Promise<void>;
|
|
819
|
+
}
|
|
820
|
+
|
|
821
|
+
/**
|
|
822
|
+
* @generated from protobuf service ContentDeliveryRpc
|
|
823
|
+
*/
|
|
824
|
+
interface IContentDeliveryRpcClient {
|
|
825
|
+
/**
|
|
826
|
+
* @generated from protobuf rpc: sendStreamMessage
|
|
827
|
+
*/
|
|
828
|
+
sendStreamMessage(input: StreamMessage, options?: RpcOptions): UnaryCall<StreamMessage, Empty>;
|
|
829
|
+
/**
|
|
830
|
+
* @generated from protobuf rpc: leaveStreamPartNotice
|
|
831
|
+
*/
|
|
832
|
+
leaveStreamPartNotice(input: LeaveStreamPartNotice, options?: RpcOptions): UnaryCall<LeaveStreamPartNotice, Empty>;
|
|
833
|
+
}
|
|
834
|
+
/**
|
|
835
|
+
* @generated from protobuf service ContentDeliveryRpc
|
|
836
|
+
*/
|
|
837
|
+
declare class ContentDeliveryRpcClient implements IContentDeliveryRpcClient, ServiceInfo {
|
|
838
|
+
private readonly _transport;
|
|
839
|
+
typeName: string;
|
|
840
|
+
methods: _protobuf_ts_runtime_rpc.MethodInfo<any, any>[];
|
|
841
|
+
options: {
|
|
842
|
+
[extensionName: string]: _protobuf_ts_runtime.JsonValue;
|
|
843
|
+
};
|
|
844
|
+
constructor(_transport: RpcTransport);
|
|
845
|
+
/**
|
|
846
|
+
* @generated from protobuf rpc: sendStreamMessage
|
|
847
|
+
*/
|
|
848
|
+
sendStreamMessage(input: StreamMessage, options?: RpcOptions): UnaryCall<StreamMessage, Empty>;
|
|
849
|
+
/**
|
|
850
|
+
* @generated from protobuf rpc: leaveStreamPartNotice
|
|
851
|
+
*/
|
|
852
|
+
leaveStreamPartNotice(input: LeaveStreamPartNotice, options?: RpcOptions): UnaryCall<LeaveStreamPartNotice, Empty>;
|
|
853
|
+
}
|
|
854
|
+
|
|
855
|
+
declare class ContentDeliveryRpcRemote extends RpcRemote<ContentDeliveryRpcClient> {
|
|
856
|
+
private rtt?;
|
|
857
|
+
sendStreamMessage(msg: StreamMessage, bufferWhileConnecting?: boolean): Promise<void>;
|
|
858
|
+
leaveStreamPartNotice(streamPartId: StreamPartID, isLocalNodeEntryPoint: boolean): void;
|
|
859
|
+
setRtt(rtt: number): void;
|
|
860
|
+
getRtt(): number | undefined;
|
|
861
|
+
}
|
|
862
|
+
|
|
863
|
+
interface Events$5 {
|
|
864
|
+
nodeAdded: (id: DhtAddress, remote: ContentDeliveryRpcRemote) => void;
|
|
865
|
+
nodeRemoved: (id: DhtAddress, remote: ContentDeliveryRpcRemote) => void;
|
|
866
|
+
}
|
|
867
|
+
declare class NodeList extends EventEmitter<Events$5> {
|
|
868
|
+
private readonly nodes;
|
|
869
|
+
private readonly limit;
|
|
870
|
+
private ownId;
|
|
871
|
+
constructor(ownId: DhtAddress, limit: number);
|
|
872
|
+
add(remote: ContentDeliveryRpcRemote): void;
|
|
873
|
+
remove(nodeId: DhtAddress): void;
|
|
874
|
+
has(nodeId: DhtAddress): boolean;
|
|
875
|
+
replaceAll(neighbors: ContentDeliveryRpcRemote[]): void;
|
|
876
|
+
getIds(): DhtAddress[];
|
|
877
|
+
get(id: DhtAddress): ContentDeliveryRpcRemote | undefined;
|
|
878
|
+
size(exclude?: DhtAddress[]): number;
|
|
879
|
+
getRandom(exclude: DhtAddress[]): ContentDeliveryRpcRemote | undefined;
|
|
880
|
+
getFirst(exclude: DhtAddress[], wsOnly?: boolean): ContentDeliveryRpcRemote | undefined;
|
|
881
|
+
getFirstAndLast(exclude: DhtAddress[]): ContentDeliveryRpcRemote[];
|
|
882
|
+
getLast(exclude: DhtAddress[]): ContentDeliveryRpcRemote | undefined;
|
|
883
|
+
getAll(): ContentDeliveryRpcRemote[];
|
|
884
|
+
stop(): void;
|
|
885
|
+
}
|
|
886
|
+
|
|
887
|
+
interface InspectorOptions {
|
|
888
|
+
localPeerDescriptor: PeerDescriptor$1;
|
|
889
|
+
streamPartId: StreamPartID;
|
|
890
|
+
rpcCommunicator: ListeningRpcCommunicator;
|
|
891
|
+
connectionLocker: ConnectionLocker;
|
|
892
|
+
inspectionTimeout?: number;
|
|
893
|
+
openInspectConnection?: (peerDescriptor: PeerDescriptor$1, lockId: LockID) => Promise<void>;
|
|
894
|
+
closeInspectConnection?: (peerDescriptor: PeerDescriptor$1, lockId: LockID) => Promise<void>;
|
|
895
|
+
}
|
|
896
|
+
declare class Inspector {
|
|
897
|
+
private readonly sessions;
|
|
898
|
+
private readonly streamPartId;
|
|
899
|
+
private readonly localPeerDescriptor;
|
|
900
|
+
private readonly rpcCommunicator;
|
|
901
|
+
private readonly connectionLocker;
|
|
902
|
+
private readonly inspectionTimeout;
|
|
903
|
+
private readonly openInspectConnection;
|
|
904
|
+
private readonly closeInspectConnection;
|
|
905
|
+
constructor(options: InspectorOptions);
|
|
906
|
+
defaultOpenInspectConnection(peerDescriptor: PeerDescriptor$1, lockId: LockID): Promise<void>;
|
|
907
|
+
defaultCloseInspectConnection(peerDescriptor: PeerDescriptor$1, lockId: LockID): Promise<void>;
|
|
908
|
+
inspect(peerDescriptor: PeerDescriptor$1): Promise<boolean>;
|
|
909
|
+
markMessage(sender: DhtAddress, messageId: MessageID): void;
|
|
910
|
+
isInspected(nodeId: DhtAddress): boolean;
|
|
911
|
+
stop(): void;
|
|
912
|
+
}
|
|
913
|
+
|
|
914
|
+
interface HandshakerOptions {
|
|
915
|
+
localPeerDescriptor: PeerDescriptor$1;
|
|
916
|
+
streamPartId: StreamPartID;
|
|
917
|
+
neighbors: NodeList;
|
|
918
|
+
leftNodeView: NodeList;
|
|
919
|
+
rightNodeView: NodeList;
|
|
920
|
+
nearbyNodeView: NodeList;
|
|
921
|
+
randomNodeView: NodeList;
|
|
922
|
+
rpcCommunicator: ListeningRpcCommunicator;
|
|
923
|
+
maxNeighborCount: number;
|
|
924
|
+
ongoingHandshakes: Set<DhtAddress>;
|
|
925
|
+
rpcRequestTimeout?: number;
|
|
926
|
+
}
|
|
927
|
+
declare class Handshaker {
|
|
928
|
+
private options;
|
|
929
|
+
private readonly rpcLocal;
|
|
930
|
+
constructor(options: HandshakerOptions);
|
|
931
|
+
attemptHandshakesOnContacts(excludedIds: DhtAddress[]): Promise<DhtAddress[]>;
|
|
932
|
+
private selectParallelTargetsAndHandshake;
|
|
933
|
+
private selectParallelTargets;
|
|
934
|
+
private doParallelHandshakes;
|
|
935
|
+
private selectNewTargetAndHandshake;
|
|
936
|
+
private handshakeWithTarget;
|
|
937
|
+
private handshakeWithInterleaving;
|
|
938
|
+
private createRpcRemote;
|
|
939
|
+
private createContentDeliveryRpcRemote;
|
|
940
|
+
getOngoingHandshakes(): Set<DhtAddress>;
|
|
941
|
+
}
|
|
942
|
+
|
|
943
|
+
interface FindNeighborsSessionOptions {
|
|
944
|
+
neighbors: NodeList;
|
|
945
|
+
nearbyNodeView: NodeList;
|
|
946
|
+
leftNodeView: NodeList;
|
|
947
|
+
rightNodeView: NodeList;
|
|
948
|
+
randomNodeView: NodeList;
|
|
949
|
+
doFindNeighbors: (excludedNodes: DhtAddress[]) => Promise<DhtAddress[]>;
|
|
950
|
+
minCount: number;
|
|
951
|
+
}
|
|
952
|
+
declare class NeighborFinder {
|
|
953
|
+
private readonly abortController;
|
|
954
|
+
private readonly options;
|
|
955
|
+
private running;
|
|
956
|
+
constructor(options: FindNeighborsSessionOptions);
|
|
957
|
+
private findNeighbors;
|
|
958
|
+
isRunning(): boolean;
|
|
959
|
+
start(excluded?: DhtAddress[]): void;
|
|
960
|
+
stop(): void;
|
|
961
|
+
}
|
|
962
|
+
|
|
963
|
+
interface NeighborUpdateManagerOptions {
|
|
964
|
+
localPeerDescriptor: PeerDescriptor$1;
|
|
965
|
+
neighbors: NodeList;
|
|
966
|
+
nearbyNodeView: NodeList;
|
|
967
|
+
neighborFinder: NeighborFinder;
|
|
968
|
+
streamPartId: StreamPartID;
|
|
969
|
+
rpcCommunicator: ListeningRpcCommunicator;
|
|
970
|
+
neighborUpdateInterval: number;
|
|
971
|
+
neighborTargetCount: number;
|
|
972
|
+
ongoingHandshakes: Set<DhtAddress>;
|
|
973
|
+
}
|
|
974
|
+
declare class NeighborUpdateManager {
|
|
975
|
+
private readonly abortController;
|
|
976
|
+
private readonly options;
|
|
977
|
+
private readonly rpcLocal;
|
|
978
|
+
constructor(options: NeighborUpdateManagerOptions);
|
|
979
|
+
start(): Promise<void>;
|
|
980
|
+
stop(): void;
|
|
981
|
+
private updateNeighborInfo;
|
|
982
|
+
private createRemote;
|
|
983
|
+
}
|
|
984
|
+
|
|
985
|
+
type SendToNeighborFn = (neighborId: DhtAddress, msg: StreamMessage) => Promise<void>;
|
|
986
|
+
interface ConstructorOptions {
|
|
987
|
+
sendToNeighbor: SendToNeighborFn;
|
|
988
|
+
minPropagationTargets: number;
|
|
989
|
+
maxMessages: number;
|
|
990
|
+
ttl: number;
|
|
991
|
+
}
|
|
992
|
+
/**
|
|
993
|
+
* Message propagation logic of a node. Given a message, this class will actively attempt to propagate it to
|
|
994
|
+
* `minPropagationTargets` neighbors until success or TTL expiration.
|
|
995
|
+
*
|
|
996
|
+
* Setting `minPropagationTargets = 0` effectively disables any propagation reattempts. A message will then
|
|
997
|
+
* only be propagated exactly once, to neighbors that are present at that moment, in a fire-and-forget manner.
|
|
998
|
+
*/
|
|
999
|
+
declare class Propagation {
|
|
1000
|
+
private readonly sendToNeighbor;
|
|
1001
|
+
private readonly minPropagationTargets;
|
|
1002
|
+
private readonly activeTaskStore;
|
|
1003
|
+
constructor({ sendToNeighbor, minPropagationTargets, maxMessages, ttl }: ConstructorOptions);
|
|
1004
|
+
/**
|
|
1005
|
+
* Node should invoke this when it learns about a new message
|
|
1006
|
+
*/
|
|
1007
|
+
feedUnseenMessage(message: StreamMessage, targets: DhtAddress[], source: DhtAddress | null): void;
|
|
1008
|
+
/**
|
|
1009
|
+
* Node should invoke this when it learns about a new node stream assignment
|
|
1010
|
+
*/
|
|
1011
|
+
onNeighborJoined(neighborId: DhtAddress): void;
|
|
1012
|
+
private sendAndAwaitThenMark;
|
|
1013
|
+
}
|
|
1014
|
+
|
|
1015
|
+
/**
|
|
1016
|
+
* @generated from protobuf service ProxyConnectionRpc
|
|
1017
|
+
*/
|
|
1018
|
+
interface IProxyConnectionRpc<T = ServerCallContext> {
|
|
1019
|
+
/**
|
|
1020
|
+
* @generated from protobuf rpc: requestConnection
|
|
1021
|
+
*/
|
|
1022
|
+
requestConnection(request: ProxyConnectionRequest, context: T): Promise<ProxyConnectionResponse>;
|
|
1023
|
+
}
|
|
1024
|
+
/**
|
|
1025
|
+
* @generated from protobuf service TemporaryConnectionRpc
|
|
1026
|
+
*/
|
|
1027
|
+
interface ITemporaryConnectionRpc<T = ServerCallContext> {
|
|
1028
|
+
/**
|
|
1029
|
+
* @generated from protobuf rpc: openConnection
|
|
1030
|
+
*/
|
|
1031
|
+
openConnection(request: TemporaryConnectionRequest, context: T): Promise<TemporaryConnectionResponse>;
|
|
1032
|
+
/**
|
|
1033
|
+
* @generated from protobuf rpc: closeConnection
|
|
1034
|
+
*/
|
|
1035
|
+
closeConnection(request: CloseTemporaryConnection, context: T): Promise<Empty>;
|
|
1036
|
+
}
|
|
1037
|
+
|
|
1038
|
+
interface ProxyConnection {
|
|
1039
|
+
userId: UserID;
|
|
1040
|
+
remote: ContentDeliveryRpcRemote;
|
|
1041
|
+
direction?: ProxyDirection;
|
|
1042
|
+
}
|
|
1043
|
+
interface ProxyConnectionRpcLocalOptions {
|
|
1044
|
+
localPeerDescriptor: PeerDescriptor$1;
|
|
1045
|
+
streamPartId: StreamPartID;
|
|
1046
|
+
rpcCommunicator: ListeningRpcCommunicator;
|
|
1047
|
+
}
|
|
1048
|
+
interface Events$4 {
|
|
1049
|
+
newConnection: (nodeId: DhtAddress) => void;
|
|
1050
|
+
}
|
|
1051
|
+
declare class ProxyConnectionRpcLocal extends EventEmitter<Events$4> implements IProxyConnectionRpc {
|
|
1052
|
+
private readonly options;
|
|
1053
|
+
private readonly connections;
|
|
1054
|
+
constructor(options: ProxyConnectionRpcLocalOptions);
|
|
1055
|
+
getConnection(nodeId: DhtAddress): ProxyConnection | undefined;
|
|
1056
|
+
hasConnection(nodeId: DhtAddress): boolean;
|
|
1057
|
+
removeConnection(nodeId: DhtAddress): void;
|
|
1058
|
+
stop(): void;
|
|
1059
|
+
getPropagationTargets(msg: StreamMessage): DhtAddress[];
|
|
1060
|
+
private getNodeIdsForUserId;
|
|
1061
|
+
private getSubscribers;
|
|
1062
|
+
requestConnection(request: ProxyConnectionRequest, context: ServerCallContext): Promise<ProxyConnectionResponse>;
|
|
1063
|
+
}
|
|
1064
|
+
|
|
1065
|
+
interface TemporaryConnectionRpcLocalOptions {
|
|
1066
|
+
rpcCommunicator: ListeningRpcCommunicator;
|
|
1067
|
+
localPeerDescriptor: PeerDescriptor;
|
|
1068
|
+
streamPartId: StreamPartID;
|
|
1069
|
+
connectionLocker: ConnectionLocker;
|
|
1070
|
+
}
|
|
1071
|
+
declare class TemporaryConnectionRpcLocal implements ITemporaryConnectionRpc {
|
|
1072
|
+
private readonly options;
|
|
1073
|
+
private readonly temporaryNodes;
|
|
1074
|
+
private readonly lockId;
|
|
1075
|
+
constructor(options: TemporaryConnectionRpcLocalOptions);
|
|
1076
|
+
getNodes(): NodeList;
|
|
1077
|
+
hasNode(node: DhtAddress): boolean;
|
|
1078
|
+
removeNode(nodeId: DhtAddress): void;
|
|
1079
|
+
openConnection(_request: TemporaryConnectionRequest, context: ServerCallContext): Promise<TemporaryConnectionResponse>;
|
|
1080
|
+
closeConnection(_request: CloseTemporaryConnection, context: ServerCallContext): Promise<Empty>;
|
|
1081
|
+
}
|
|
1082
|
+
|
|
1083
|
+
type ContentDeliveryLayerNeighborInfo = MarkRequired<ContentDeliveryLayerNeighborInfo$1, 'peerDescriptor'>;
|
|
1084
|
+
type StreamPartitionInfo = ChangeFieldType<Required<StreamPartitionInfo$1>, 'contentDeliveryLayerNeighbors', ContentDeliveryLayerNeighborInfo[]>;
|
|
1085
|
+
type NodeInfo = ChangeFieldType<Required<NodeInfoResponse>, 'streamPartitions', StreamPartitionInfo[]>;
|
|
1086
|
+
|
|
1087
|
+
interface Options {
|
|
1088
|
+
neighbors: NodeList;
|
|
1089
|
+
localPeerDescriptor: PeerDescriptor$1;
|
|
1090
|
+
rpcCommunicator: ListeningRpcCommunicator;
|
|
1091
|
+
maxPausedNeighbors?: number;
|
|
1092
|
+
}
|
|
1093
|
+
interface Events$3 {
|
|
1094
|
+
message: (msg: StreamMessage) => void;
|
|
1095
|
+
}
|
|
1096
|
+
declare class PlumtreeManager extends EventEmitter<Events$3> {
|
|
1097
|
+
private readonly neighbors;
|
|
1098
|
+
private readonly localPeerDescriptor;
|
|
1099
|
+
private readonly localPausedNeighbors;
|
|
1100
|
+
private readonly remotePausedNeighbors;
|
|
1101
|
+
private readonly rpcLocal;
|
|
1102
|
+
private readonly latestMessages;
|
|
1103
|
+
private readonly rpcCommunicator;
|
|
1104
|
+
private readonly metadataTimestampsAheadOfRealData;
|
|
1105
|
+
private readonly maxPausedNeighbors;
|
|
1106
|
+
constructor(options: Options);
|
|
1107
|
+
pauseNeighbor(node: PeerDescriptor$1, msgChainId: string): Promise<void>;
|
|
1108
|
+
resumeNeighbor(node: PeerDescriptor$1, msgChainId: string, fromTimestamp: number): Promise<void>;
|
|
1109
|
+
private onNeighborRemoved;
|
|
1110
|
+
getLatestMessageTimestamp(msgChainId: string): number;
|
|
1111
|
+
private sendBuffer;
|
|
1112
|
+
private onMetadata;
|
|
1113
|
+
private createRemote;
|
|
1114
|
+
broadcast(msg: StreamMessage, previousNode: DhtAddress): void;
|
|
1115
|
+
isNeighborPaused(node: PeerDescriptor$1, msgChainId: string): boolean;
|
|
1116
|
+
stop(): void;
|
|
1117
|
+
}
|
|
1118
|
+
|
|
1119
|
+
interface Events$2 {
|
|
1120
|
+
message: (message: StreamMessage) => void;
|
|
1121
|
+
neighborConnected: (nodeId: DhtAddress) => void;
|
|
1122
|
+
entryPointLeaveDetected: () => void;
|
|
1123
|
+
}
|
|
1124
|
+
interface StrictContentDeliveryLayerNodeOptions {
|
|
1125
|
+
streamPartId: StreamPartID;
|
|
1126
|
+
discoveryLayerNode: DiscoveryLayerNode;
|
|
1127
|
+
transport: ITransport;
|
|
1128
|
+
connectionLocker: ConnectionLocker;
|
|
1129
|
+
localPeerDescriptor: PeerDescriptor$1;
|
|
1130
|
+
nodeViewSize: number;
|
|
1131
|
+
nearbyNodeView: NodeList;
|
|
1132
|
+
randomNodeView: NodeList;
|
|
1133
|
+
leftNodeView: NodeList;
|
|
1134
|
+
rightNodeView: NodeList;
|
|
1135
|
+
neighbors: NodeList;
|
|
1136
|
+
handshaker: Handshaker;
|
|
1137
|
+
neighborFinder: NeighborFinder;
|
|
1138
|
+
neighborUpdateManager: NeighborUpdateManager;
|
|
1139
|
+
propagation: Propagation;
|
|
1140
|
+
rpcCommunicator: ListeningRpcCommunicator;
|
|
1141
|
+
neighborTargetCount: number;
|
|
1142
|
+
inspector: Inspector;
|
|
1143
|
+
temporaryConnectionRpcLocal: TemporaryConnectionRpcLocal;
|
|
1144
|
+
isLocalNodeEntryPoint: () => boolean;
|
|
1145
|
+
proxyConnectionRpcLocal?: ProxyConnectionRpcLocal;
|
|
1146
|
+
rpcRequestTimeout?: number;
|
|
1147
|
+
plumtreeManager?: PlumtreeManager;
|
|
1148
|
+
}
|
|
1149
|
+
declare class ContentDeliveryLayerNode extends EventEmitter<Events$2> {
|
|
1150
|
+
private started;
|
|
1151
|
+
private readonly duplicateDetectors;
|
|
1152
|
+
private options;
|
|
1153
|
+
private readonly contentDeliveryRpcLocal;
|
|
1154
|
+
private abortController;
|
|
1155
|
+
private messagesPropagated;
|
|
1156
|
+
constructor(options: StrictContentDeliveryLayerNodeOptions);
|
|
1157
|
+
start(): Promise<void>;
|
|
1158
|
+
private registerDefaultServerMethods;
|
|
1159
|
+
private onRingContactsUpdated;
|
|
1160
|
+
private onNearbyContactAdded;
|
|
1161
|
+
private onNearbyContactRemoved;
|
|
1162
|
+
private updateNearbyNodeView;
|
|
1163
|
+
private onRandomContactAdded;
|
|
1164
|
+
private onRandomContactRemoved;
|
|
1165
|
+
private onNodeDisconnected;
|
|
1166
|
+
hasProxyConnection(nodeId: DhtAddress): boolean;
|
|
1167
|
+
stop(): void;
|
|
1168
|
+
broadcast(msg: StreamMessage, previousNode?: DhtAddress): void;
|
|
1169
|
+
inspect(peerDescriptor: PeerDescriptor$1): Promise<boolean>;
|
|
1170
|
+
private getPropagationTargets;
|
|
1171
|
+
getOwnNodeId(): DhtAddress;
|
|
1172
|
+
getOutgoingHandshakeCount(): number;
|
|
1173
|
+
getNeighbors(): PeerDescriptor$1[];
|
|
1174
|
+
getInfos(): ContentDeliveryLayerNeighborInfo[];
|
|
1175
|
+
getNearbyNodeView(): NodeList;
|
|
1176
|
+
getDiagnosticInfo(): Record<string, unknown>;
|
|
1177
|
+
private isStopped;
|
|
1178
|
+
}
|
|
1179
|
+
|
|
1180
|
+
interface ControlLayerNode extends ITransport {
|
|
1181
|
+
joinDht(entryPointDescriptors: PeerDescriptor$1[]): Promise<void>;
|
|
1182
|
+
hasJoined(): boolean;
|
|
1183
|
+
getLocalPeerDescriptor(): PeerDescriptor$1;
|
|
1184
|
+
fetchDataFromDht(key: DhtAddress): Promise<DataEntry[]>;
|
|
1185
|
+
storeDataToDht(key: DhtAddress, data: Any): Promise<PeerDescriptor$1[]>;
|
|
1186
|
+
deleteDataFromDht(key: DhtAddress, waitForCompletion: boolean): Promise<void>;
|
|
1187
|
+
waitForNetworkConnectivity(): Promise<void>;
|
|
1188
|
+
getTransport(): ITransport;
|
|
1189
|
+
getNeighbors(): PeerDescriptor$1[];
|
|
1190
|
+
getConnectionsView(): ConnectionsView;
|
|
1191
|
+
start(): Promise<void>;
|
|
1192
|
+
stop(): Promise<void>;
|
|
1193
|
+
}
|
|
1194
|
+
|
|
1195
|
+
interface StreamPartNetworkSplitAvoidanceOptions {
|
|
1196
|
+
discoveryLayerNode: DiscoveryLayerNode;
|
|
1197
|
+
discoverEntryPoints: (excludedNodes?: Set<DhtAddress>) => Promise<PeerDescriptor$1[]>;
|
|
1198
|
+
exponentialRunOfBaseDelay?: number;
|
|
1199
|
+
}
|
|
1200
|
+
declare class StreamPartNetworkSplitAvoidance {
|
|
1201
|
+
private readonly abortController;
|
|
1202
|
+
private readonly options;
|
|
1203
|
+
private readonly excludedNodes;
|
|
1204
|
+
private running;
|
|
1205
|
+
constructor(options: StreamPartNetworkSplitAvoidanceOptions);
|
|
1206
|
+
avoidNetworkSplit(): Promise<void>;
|
|
1207
|
+
isRunning(): boolean;
|
|
1208
|
+
destroy(): void;
|
|
1209
|
+
}
|
|
1210
|
+
|
|
1211
|
+
interface ProxyClientOptions {
|
|
1212
|
+
transport: ITransport;
|
|
1213
|
+
localPeerDescriptor: PeerDescriptor$1;
|
|
1214
|
+
streamPartId: StreamPartID;
|
|
1215
|
+
connectionLocker: ConnectionLocker;
|
|
1216
|
+
maxPropagationBufferSize: number;
|
|
1217
|
+
minPropagationTargets: number;
|
|
1218
|
+
propagationBufferTtl: number;
|
|
1219
|
+
}
|
|
1220
|
+
interface Events$1 {
|
|
1221
|
+
message: (message: StreamMessage) => void;
|
|
1222
|
+
}
|
|
1223
|
+
declare class ProxyClient extends EventEmitter<Events$1> {
|
|
1224
|
+
private readonly rpcCommunicator;
|
|
1225
|
+
private readonly contentDeliveryRpcLocal;
|
|
1226
|
+
private readonly options;
|
|
1227
|
+
private readonly duplicateDetectors;
|
|
1228
|
+
private definition?;
|
|
1229
|
+
private readonly connections;
|
|
1230
|
+
private readonly propagation;
|
|
1231
|
+
private readonly neighbors;
|
|
1232
|
+
private readonly abortController;
|
|
1233
|
+
constructor(options: ProxyClientOptions);
|
|
1234
|
+
private registerDefaultServerMethods;
|
|
1235
|
+
setProxies(nodes: PeerDescriptor$1[], userId: UserID, direction?: ProxyDirection, connectionCount?: number): Promise<void>;
|
|
1236
|
+
private updateConnections;
|
|
1237
|
+
private getInvalidConnections;
|
|
1238
|
+
private openRandomConnections;
|
|
1239
|
+
private attemptConnection;
|
|
1240
|
+
private closeRandomConnections;
|
|
1241
|
+
private closeConnection;
|
|
1242
|
+
private removeConnection;
|
|
1243
|
+
broadcast(msg: StreamMessage, previousNode?: DhtAddress): void;
|
|
1244
|
+
hasConnection(nodeId: DhtAddress, direction?: ProxyDirection): boolean;
|
|
1245
|
+
getDirection(): ProxyDirection | undefined;
|
|
1246
|
+
private onNodeDisconnected;
|
|
1247
|
+
start(): Promise<void>;
|
|
1248
|
+
getDiagnosticInfo(): Record<string, unknown>;
|
|
1249
|
+
stop(): void;
|
|
1250
|
+
}
|
|
1251
|
+
|
|
1252
|
+
type StreamPartDelivery = {
|
|
1253
|
+
broadcast: (msg: StreamMessage) => void;
|
|
1254
|
+
stop: () => Promise<void>;
|
|
1255
|
+
} & ({
|
|
1256
|
+
proxied: false;
|
|
1257
|
+
discoveryLayerNode: DiscoveryLayerNode;
|
|
1258
|
+
node: ContentDeliveryLayerNode;
|
|
1259
|
+
networkSplitAvoidance: StreamPartNetworkSplitAvoidance;
|
|
1260
|
+
getDiagnosticInfo: () => Record<string, unknown>;
|
|
1261
|
+
} | {
|
|
1262
|
+
proxied: true;
|
|
1263
|
+
client: ProxyClient;
|
|
1264
|
+
getDiagnosticInfo: () => Record<string, unknown>;
|
|
1265
|
+
});
|
|
1266
|
+
interface Events {
|
|
1267
|
+
newMessage: (msg: StreamMessage) => void;
|
|
1268
|
+
}
|
|
1269
|
+
interface ContentDeliveryManagerOptions {
|
|
1270
|
+
metricsContext?: MetricsContext;
|
|
1271
|
+
streamPartitionNeighborTargetCount?: number;
|
|
1272
|
+
streamPartitionMinPropagationTargets?: number;
|
|
1273
|
+
streamPartitionMaxPropagationBufferSize?: number;
|
|
1274
|
+
acceptProxyConnections?: boolean;
|
|
1275
|
+
rpcRequestTimeout?: number;
|
|
1276
|
+
neighborUpdateInterval?: number;
|
|
1277
|
+
bufferWhileConnecting?: boolean;
|
|
1278
|
+
}
|
|
1279
|
+
type PlumtreeOptions = {
|
|
1280
|
+
enabled: true;
|
|
1281
|
+
maxPausedNeighbors?: number;
|
|
1282
|
+
} | {
|
|
1283
|
+
enabled: false;
|
|
1284
|
+
};
|
|
1285
|
+
interface StreamPartDeliveryOptions {
|
|
1286
|
+
plumtreeOptimization?: PlumtreeOptions;
|
|
1287
|
+
}
|
|
1288
|
+
declare const streamPartIdToDataKey: (streamPartId: StreamPartID) => DhtAddress;
|
|
1289
|
+
declare class ContentDeliveryManager extends EventEmitter<Events> {
|
|
1290
|
+
private transport?;
|
|
1291
|
+
private connectionLocker?;
|
|
1292
|
+
private controlLayerNode?;
|
|
1293
|
+
private readonly metricsContext;
|
|
1294
|
+
private readonly metrics;
|
|
1295
|
+
private readonly options;
|
|
1296
|
+
private readonly streamParts;
|
|
1297
|
+
private readonly knownStreamPartEntryPoints;
|
|
1298
|
+
private started;
|
|
1299
|
+
private destroyed;
|
|
1300
|
+
constructor(options: ContentDeliveryManagerOptions);
|
|
1301
|
+
start(startedAndJoinedControlLayerNode: ControlLayerNode, transport: ITransport, connectionLocker: ConnectionLocker): Promise<void>;
|
|
1302
|
+
destroy(): Promise<void>;
|
|
1303
|
+
broadcast(msg: StreamMessage, streamPartDeliveryOptions?: StreamPartDeliveryOptions): void;
|
|
1304
|
+
leaveStreamPart(streamPartId: StreamPartID): Promise<void>;
|
|
1305
|
+
joinStreamPart(streamPartId: StreamPartID, streamPartDeliveryOptions?: StreamPartDeliveryOptions): void;
|
|
1306
|
+
private startLayersAndJoinDht;
|
|
1307
|
+
private createDiscoveryLayerNode;
|
|
1308
|
+
private createContentDeliveryLayerNode;
|
|
1309
|
+
setProxies(streamPartId: StreamPartID, nodes: PeerDescriptor$1[], userId: UserID, direction?: ProxyDirection, connectionCount?: number): Promise<void>;
|
|
1310
|
+
private createProxyClient;
|
|
1311
|
+
inspect(peerDescriptor: PeerDescriptor$1, streamPartId: StreamPartID): Promise<boolean>;
|
|
1312
|
+
getNodeInfo(): StreamPartitionInfo[];
|
|
1313
|
+
setStreamPartEntryPoints(streamPartId: StreamPartID, entryPoints: PeerDescriptor$1[]): void;
|
|
1314
|
+
isProxiedStreamPart(streamPartId: StreamPartID, direction?: ProxyDirection): boolean;
|
|
1315
|
+
getStreamPartDelivery(streamPartId: StreamPartID): StreamPartDelivery | undefined;
|
|
1316
|
+
hasStreamPart(streamPartId: StreamPartID): boolean;
|
|
1317
|
+
getPeerDescriptor(): PeerDescriptor$1;
|
|
1318
|
+
getNodeId(): DhtAddress;
|
|
1319
|
+
getNeighbors(streamPartId: StreamPartID): DhtAddress[];
|
|
1320
|
+
getStreamParts(): StreamPartID[];
|
|
1321
|
+
getDiagnosticInfo(): Record<string, unknown>;
|
|
1322
|
+
}
|
|
1323
|
+
|
|
1324
|
+
interface NetworkOptions {
|
|
1325
|
+
layer0?: DhtNodeOptions;
|
|
1326
|
+
networkNode?: ContentDeliveryManagerOptions;
|
|
1327
|
+
metricsContext?: MetricsContext;
|
|
1328
|
+
}
|
|
1329
|
+
declare class NetworkStack {
|
|
1330
|
+
private controlLayerNode?;
|
|
1331
|
+
private contentDeliveryManager?;
|
|
1332
|
+
private stopped;
|
|
1333
|
+
private readonly metricsContext;
|
|
1334
|
+
private readonly options;
|
|
1335
|
+
private nodeInfoRpcLocal?;
|
|
1336
|
+
private nodeInfoClient?;
|
|
1337
|
+
constructor(options: NetworkOptions);
|
|
1338
|
+
joinStreamPart(streamPartId: StreamPartID, neighborRequirement?: {
|
|
1339
|
+
minCount: number;
|
|
1340
|
+
timeout: number;
|
|
1341
|
+
}, streamPartDeliveryOptions?: StreamPartDeliveryOptions): Promise<void>;
|
|
1342
|
+
broadcast(msg: StreamMessage, streamPartDeliveryOptions?: StreamPartDeliveryOptions): Promise<void>;
|
|
1343
|
+
start(doJoin?: boolean): Promise<void>;
|
|
1344
|
+
private ensureConnectedToControlLayer;
|
|
1345
|
+
getContentDeliveryManager(): ContentDeliveryManager;
|
|
1346
|
+
getControlLayerNode(): ControlLayerNode;
|
|
1347
|
+
getMetricsContext(): MetricsContext;
|
|
1348
|
+
fetchNodeInfo(node: PeerDescriptor$1): Promise<NodeInfo>;
|
|
1349
|
+
createNodeInfo(): NodeInfo;
|
|
1350
|
+
getOptions(): NetworkOptions;
|
|
1351
|
+
private getConnectionManager;
|
|
1352
|
+
stop(): Promise<void>;
|
|
1353
|
+
}
|
|
1354
|
+
|
|
1355
|
+
declare const createNetworkNode: (opts: NetworkOptions) => NetworkNode;
|
|
1356
|
+
/**
|
|
1357
|
+
* Convenience wrapper for building client-facing functionality. Used by client.
|
|
1358
|
+
*/
|
|
1359
|
+
declare class NetworkNode {
|
|
1360
|
+
readonly stack: NetworkStack;
|
|
1361
|
+
private stopped;
|
|
1362
|
+
private externalNetworkRpc?;
|
|
1363
|
+
start(doJoin?: boolean): Promise<void>;
|
|
1364
|
+
inspect(node: PeerDescriptor$1, streamPartId: StreamPartID): Promise<boolean>;
|
|
1365
|
+
broadcast(msg: StreamMessage, streamPartDeliveryOptions?: StreamPartDeliveryOptions): Promise<void>;
|
|
1366
|
+
join(streamPartId: StreamPartID, neighborRequirement?: {
|
|
1367
|
+
minCount: number;
|
|
1368
|
+
timeout: number;
|
|
1369
|
+
}, streamPartDeliveryOptions?: StreamPartDeliveryOptions): Promise<void>;
|
|
1370
|
+
setProxies(streamPartId: StreamPartID, nodes: PeerDescriptor$1[], userId: UserID, direction?: ProxyDirection, connectionCount?: number): Promise<void>;
|
|
1371
|
+
isProxiedStreamPart(streamPartId: StreamPartID): boolean;
|
|
1372
|
+
addMessageListener(listener: (msg: StreamMessage) => void): void;
|
|
1373
|
+
setStreamPartEntryPoints(streamPartId: StreamPartID, contactPeerDescriptors: PeerDescriptor$1[]): void;
|
|
1374
|
+
removeMessageListener(listener: (msg: StreamMessage) => void): void;
|
|
1375
|
+
leave(streamPartId: StreamPartID): Promise<void>;
|
|
1376
|
+
getNeighbors(streamPartId: StreamPartID): readonly DhtAddress[];
|
|
1377
|
+
hasStreamPart(streamPartId: StreamPartID): boolean;
|
|
1378
|
+
stop(): Promise<void>;
|
|
1379
|
+
getPeerDescriptor(): PeerDescriptor$1;
|
|
1380
|
+
getMetricsContext(): MetricsContext;
|
|
1381
|
+
getNodeId(): DhtAddress;
|
|
1382
|
+
getOptions(): NetworkOptions;
|
|
1383
|
+
getStreamParts(): StreamPartID[];
|
|
1384
|
+
fetchNodeInfo(node: PeerDescriptor$1): Promise<NodeInfo>;
|
|
1385
|
+
getDiagnosticInfo(): Record<string, unknown>;
|
|
1386
|
+
registerExternalNetworkRpcMethod<RequestClass extends IMessageType<RequestType>, ResponseClass extends IMessageType<ResponseType>, RequestType extends object, ResponseType extends object>(request: RequestClass, response: ResponseClass, name: string, fn: (req: RequestType, context: ServerCallContext) => Promise<ResponseType>): void;
|
|
1387
|
+
createExternalRpcClient<T extends ExternalRpcClient>(clientClass: ExternalRpcClientClass<T>): ProtoRpcClient<T>;
|
|
1388
|
+
}
|
|
1389
|
+
|
|
1390
|
+
export { AsymmetricEncryptionType, ContentType, ControlLayerInfo, EncryptedGroupKey, EncryptionType, GroupKeyRequest, GroupKeyResponse, MessageID, MessageRef, NetworkNode, NetworkStack, ProxyDirection, SignatureType, StreamMessage, createNetworkNode, streamPartIdToDataKey };
|
|
1391
|
+
export type { ContentDeliveryLayerNeighborInfo, ContentDeliveryManagerOptions, ExternalRpcClient, ExternalRpcClientClass, NetworkOptions, NodeInfo, StreamPartDeliveryOptions, StreamPartitionInfo };
|