This repository has been archived by the owner on Jul 21, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 60
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c1f6b70
commit da8ce0c
Showing
15 changed files
with
1,146 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
module.exports = { | ||
bundlesize: { maxSize: '170kB' } | ||
bundlesize: { maxSize: '190kB' } | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,264 @@ | ||
import * as $protobuf from "protobufjs"; | ||
/** Properties of a Record. */ | ||
export interface IRecord { | ||
|
||
/** Record key */ | ||
key?: (Uint8Array|null); | ||
|
||
/** Record value */ | ||
value?: (Uint8Array|null); | ||
|
||
/** Record author */ | ||
author?: (Uint8Array|null); | ||
|
||
/** Record signature */ | ||
signature?: (Uint8Array|null); | ||
|
||
/** Record timeReceived */ | ||
timeReceived?: (string|null); | ||
} | ||
|
||
/** Represents a Record. */ | ||
export class Record implements IRecord { | ||
|
||
/** | ||
* Constructs a new Record. | ||
* @param [p] Properties to set | ||
*/ | ||
constructor(p?: IRecord); | ||
|
||
/** Record key. */ | ||
public key: Uint8Array; | ||
|
||
/** Record value. */ | ||
public value: Uint8Array; | ||
|
||
/** Record author. */ | ||
public author: Uint8Array; | ||
|
||
/** Record signature. */ | ||
public signature: Uint8Array; | ||
|
||
/** Record timeReceived. */ | ||
public timeReceived: string; | ||
|
||
/** | ||
* Encodes the specified Record message. Does not implicitly {@link Record.verify|verify} messages. | ||
* @param m Record message or plain object to encode | ||
* @param [w] Writer to encode to | ||
* @returns Writer | ||
*/ | ||
public static encode(m: IRecord, w?: $protobuf.Writer): $protobuf.Writer; | ||
|
||
/** | ||
* Decodes a Record message from the specified reader or buffer. | ||
* @param r Reader or buffer to decode from | ||
* @param [l] Message length if known beforehand | ||
* @returns Record | ||
* @throws {Error} If the payload is not a reader or valid buffer | ||
* @throws {$protobuf.util.ProtocolError} If required fields are missing | ||
*/ | ||
public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): Record; | ||
|
||
/** | ||
* Creates a Record message from a plain object. Also converts values to their respective internal types. | ||
* @param d Plain object | ||
* @returns Record | ||
*/ | ||
public static fromObject(d: { [k: string]: any }): Record; | ||
|
||
/** | ||
* Creates a plain object from a Record message. Also converts values to other types if specified. | ||
* @param m Record | ||
* @param [o] Conversion options | ||
* @returns Plain object | ||
*/ | ||
public static toObject(m: Record, o?: $protobuf.IConversionOptions): { [k: string]: any }; | ||
|
||
/** | ||
* Converts this Record to JSON. | ||
* @returns JSON object | ||
*/ | ||
public toJSON(): { [k: string]: any }; | ||
} | ||
|
||
/** Properties of a Message. */ | ||
export interface IMessage { | ||
|
||
/** Message type */ | ||
type?: (Message.MessageType|null); | ||
|
||
/** Message clusterLevelRaw */ | ||
clusterLevelRaw?: (number|null); | ||
|
||
/** Message key */ | ||
key?: (Uint8Array|null); | ||
|
||
/** Message record */ | ||
record?: (Uint8Array|null); | ||
|
||
/** Message closerPeers */ | ||
closerPeers?: (Message.IPeer[]|null); | ||
|
||
/** Message providerPeers */ | ||
providerPeers?: (Message.IPeer[]|null); | ||
} | ||
|
||
/** Represents a Message. */ | ||
export class Message implements IMessage { | ||
|
||
/** | ||
* Constructs a new Message. | ||
* @param [p] Properties to set | ||
*/ | ||
constructor(p?: IMessage); | ||
|
||
/** Message type. */ | ||
public type: Message.MessageType; | ||
|
||
/** Message clusterLevelRaw. */ | ||
public clusterLevelRaw: number; | ||
|
||
/** Message key. */ | ||
public key: Uint8Array; | ||
|
||
/** Message record. */ | ||
public record: Uint8Array; | ||
|
||
/** Message closerPeers. */ | ||
public closerPeers: Message.IPeer[]; | ||
|
||
/** Message providerPeers. */ | ||
public providerPeers: Message.IPeer[]; | ||
|
||
/** | ||
* Encodes the specified Message message. Does not implicitly {@link Message.verify|verify} messages. | ||
* @param m Message message or plain object to encode | ||
* @param [w] Writer to encode to | ||
* @returns Writer | ||
*/ | ||
public static encode(m: IMessage, w?: $protobuf.Writer): $protobuf.Writer; | ||
|
||
/** | ||
* Decodes a Message message from the specified reader or buffer. | ||
* @param r Reader or buffer to decode from | ||
* @param [l] Message length if known beforehand | ||
* @returns Message | ||
* @throws {Error} If the payload is not a reader or valid buffer | ||
* @throws {$protobuf.util.ProtocolError} If required fields are missing | ||
*/ | ||
public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): Message; | ||
|
||
/** | ||
* Creates a Message message from a plain object. Also converts values to their respective internal types. | ||
* @param d Plain object | ||
* @returns Message | ||
*/ | ||
public static fromObject(d: { [k: string]: any }): Message; | ||
|
||
/** | ||
* Creates a plain object from a Message message. Also converts values to other types if specified. | ||
* @param m Message | ||
* @param [o] Conversion options | ||
* @returns Plain object | ||
*/ | ||
public static toObject(m: Message, o?: $protobuf.IConversionOptions): { [k: string]: any }; | ||
|
||
/** | ||
* Converts this Message to JSON. | ||
* @returns JSON object | ||
*/ | ||
public toJSON(): { [k: string]: any }; | ||
} | ||
|
||
export namespace Message { | ||
|
||
/** MessageType enum. */ | ||
enum MessageType { | ||
PUT_VALUE = 0, | ||
GET_VALUE = 1, | ||
ADD_PROVIDER = 2, | ||
GET_PROVIDERS = 3, | ||
FIND_NODE = 4, | ||
PING = 5 | ||
} | ||
|
||
/** ConnectionType enum. */ | ||
enum ConnectionType { | ||
NOT_CONNECTED = 0, | ||
CONNECTED = 1, | ||
CAN_CONNECT = 2, | ||
CANNOT_CONNECT = 3 | ||
} | ||
|
||
/** Properties of a Peer. */ | ||
interface IPeer { | ||
|
||
/** Peer id */ | ||
id?: (Uint8Array|null); | ||
|
||
/** Peer addrs */ | ||
addrs?: (Uint8Array[]|null); | ||
|
||
/** Peer connection */ | ||
connection?: (Message.ConnectionType|null); | ||
} | ||
|
||
/** Represents a Peer. */ | ||
class Peer implements IPeer { | ||
|
||
/** | ||
* Constructs a new Peer. | ||
* @param [p] Properties to set | ||
*/ | ||
constructor(p?: Message.IPeer); | ||
|
||
/** Peer id. */ | ||
public id: Uint8Array; | ||
|
||
/** Peer addrs. */ | ||
public addrs: Uint8Array[]; | ||
|
||
/** Peer connection. */ | ||
public connection: Message.ConnectionType; | ||
|
||
/** | ||
* Encodes the specified Peer message. Does not implicitly {@link Message.Peer.verify|verify} messages. | ||
* @param m Peer message or plain object to encode | ||
* @param [w] Writer to encode to | ||
* @returns Writer | ||
*/ | ||
public static encode(m: Message.IPeer, w?: $protobuf.Writer): $protobuf.Writer; | ||
|
||
/** | ||
* Decodes a Peer message from the specified reader or buffer. | ||
* @param r Reader or buffer to decode from | ||
* @param [l] Message length if known beforehand | ||
* @returns Peer | ||
* @throws {Error} If the payload is not a reader or valid buffer | ||
* @throws {$protobuf.util.ProtocolError} If required fields are missing | ||
*/ | ||
public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): Message.Peer; | ||
|
||
/** | ||
* Creates a Peer message from a plain object. Also converts values to their respective internal types. | ||
* @param d Plain object | ||
* @returns Peer | ||
*/ | ||
public static fromObject(d: { [k: string]: any }): Message.Peer; | ||
|
||
/** | ||
* Creates a plain object from a Peer message. Also converts values to other types if specified. | ||
* @param m Peer | ||
* @param [o] Conversion options | ||
* @returns Plain object | ||
*/ | ||
public static toObject(m: Message.Peer, o?: $protobuf.IConversionOptions): { [k: string]: any }; | ||
|
||
/** | ||
* Converts this Peer to JSON. | ||
* @returns JSON object | ||
*/ | ||
public toJSON(): { [k: string]: any }; | ||
} | ||
} |
Oops, something went wrong.