Skip to content
This repository has been archived by the owner on Jul 21, 2023. It is now read-only.

chore: update deps #217

Merged
merged 8 commits into from
Apr 28, 2021
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .aegir.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module.exports = {
bundlesize: { maxSize: '170kB' }
bundlesize: { maxSize: '190kB' }
}

30 changes: 14 additions & 16 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,11 @@
"main": "src/index.js",
"scripts": {
"lint": "aegir lint",
"build": "npm run build:proto && npm run build:proto-types && aegir build",
vasco-santos marked this conversation as resolved.
Show resolved Hide resolved
"build:proto": "pbjs -t static-module -w commonjs --force-number --no-verify --no-delimited --no-create --no-beautify --no-defaults --lint eslint-disable -o src/message/dht.js ./src/message/dht.proto",
"build:proto-types": "pbts -o src/message/dht.d.ts src/message/dht.js",
"test": "aegir test -t node",
"test:node": "aegir test -t node",
"prepare": "aegir build --no-bundle",
"docs": "aegir docs",
"release": "aegir release --docs -t node",
"release-minor": "aegir release --type minor --docs -t node",
Expand All @@ -17,9 +19,6 @@
"coverage-publish": "aegir-coverage publish",
"sim": "node test/simulation/index.js"
},
"pre-push": [
"lint"
],
"files": [
"src",
"dist"
Expand All @@ -36,8 +35,7 @@
"url": "https://github.com/libp2p/js-libp2p-kad-dht/issues"
},
"engines": {
"node": ">=12.0.0",
"npm": ">=6.0.0"
"node": ">=14.0.0"
},
"eslintConfig": {
"extends": "ipfs"
Expand All @@ -51,15 +49,15 @@
"err-code": "^3.0.0",
"hashlru": "^2.3.0",
"heap": "~0.2.6",
"interface-datastore": "^3.0.4",
"interface-datastore": "^4.0.0",
"it-first": "^1.0.4",
"it-length-prefixed": "^3.1.0",
"it-length-prefixed": "^5.0.2",
"it-pipe": "^1.1.0",
"k-bucket": "^5.0.0",
"libp2p-crypto": "^0.19.0",
"libp2p-interfaces": "^0.8.2",
"libp2p-interfaces": "^0.10.0",
"libp2p-record": "^0.10.0",
"multiaddr": "^8.1.2",
"multiaddr": "^9.0.0",
"multihashing-async": "^2.1.0",
"p-filter": "^2.1.0",
"p-map": "^4.0.0",
Expand All @@ -68,31 +66,31 @@
"p-times": "^3.0.0",
"peer-id": "^0.14.2",
"promise-to-callback": "^1.0.0",
"protons": "^2.0.0",
"protobufjs": "^6.10.2",
"streaming-iterables": "^5.0.4",
"uint8arrays": "^2.0.5",
"uint8arrays": "^2.1.4",
"varint": "^6.0.0",
"xor-distance": "^2.0.0"
},
"devDependencies": {
"@types/debug": "^4.1.5",
"aegir": "^30.3.0",
"async-iterator-all": "^1.0.0",
"chai": "^4.2.0",
"chai": "^4.3.0",
"chai-checkmark": "^1.0.1",
"datastore-level": "^4.0.0",
"datastore-level": "^5.0.0",
"delay": "^5.0.0",
"dirty-chai": "^2.0.1",
"it-pair": "^1.0.0",
"libp2p": "^0.30.7",
"libp2p": "^0.31.0-rc.0",
"lodash": "^4.17.11",
"lodash.random": "^3.2.0",
"lodash.range": "^3.2.0",
"p-defer": "^3.0.0",
"p-each-series": "^2.1.0",
"p-map-series": "^2.1.0",
"p-retry": "^4.2.0",
"sinon": "^9.0.0"
"sinon": "^10.0.0"
},
"contributors": [
"Vasco Santos <vasco.santos@moxy.studio>",
Expand Down
2 changes: 1 addition & 1 deletion src/content-routing/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const utils = require('../utils')
/**
* @typedef {import('cids')} CID
* @typedef {import('peer-id')} PeerId
* @typedef {import('multiaddr')} Multiaddr
* @typedef {import('multiaddr').Multiaddr} Multiaddr
*/

/**
Expand Down
2 changes: 1 addition & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ const Record = libp2pRecord.Record
* @typedef {import('libp2p/src/dialer')} Dialer
* @typedef {import('libp2p/src/registrar')} Registrar
* @typedef {import('cids')} CID
* @typedef {import('multiaddr')} Multiaddr
* @typedef {import('multiaddr').Multiaddr} Multiaddr
* @typedef {object} PeerData
* @property {PeerId} id
* @property {Multiaddr[]} multiaddrs
Expand Down
264 changes: 264 additions & 0 deletions src/message/dht.d.ts
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 };
}
}
Loading