@libp2p/record 1.0.5 → 2.0.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/README.md CHANGED
@@ -1,17 +1,27 @@
1
- # js-libp2p-record
1
+ # @libp2p/record <!-- omit in toc -->
2
2
 
3
- [![](https://img.shields.io/badge/made%20by-Protocol%20Labs-blue.svg?style=flat-square)](http://ipn.io)
4
- [![](https://img.shields.io/badge/project-libp2p-blue.svg?style=flat-square)](http://libp2p.io/)
5
- [![](https://img.shields.io/badge/freenode-%23libp2p-blue.svg?style=flat-square)](http://webchat.freenode.net/?channels=%23libp2p)
6
- [![Discourse posts](https://img.shields.io/discourse/https/discuss.libp2p.io/posts.svg)](https://discuss.libp2p.io)
7
- [![standard-readme compliant](https://img.shields.io/badge/standard--readme-OK-green.svg?style=flat-square)](https://github.com/RichardLitt/standard-readme)
8
- [![Coverage Status](https://coveralls.io/repos/github/libp2p/js-libp2p-record/badge.svg?branch=master)](https://coveralls.io/github/libp2p/js-libp2p-record?branch=master)
9
- [![Build Status](https://github.com/libp2p/js-libp2p-record/actions/workflows/js-test-and-release.yml/badge.svg?branch=main)](https://github.com/libp2p/js-libp2p-record/actions/workflows/js-test-and-release.yml)
10
- [![Dependency Status](https://david-dm.org/libp2p/js-libp2p-record.svg?style=flat-square)](https://david-dm.org/libp2p/js-libp2p-record) [![js-standard-style](https://img.shields.io/badge/code%20style-standard-brightgreen.svg?style=flat-square)](https://github.com/feross/standard)
11
- ![](https://img.shields.io/badge/npm-%3E%3D3.0.0-orange.svg?style=flat-square)
12
- ![](https://img.shields.io/badge/Node.js-%3E%3D6.0.0-orange.svg?style=flat-square)
3
+ [![libp2p.io](https://img.shields.io/badge/project-libp2p-yellow.svg?style=flat-square)](http://libp2p.io/)
4
+ [![IRC](https://img.shields.io/badge/freenode-%23libp2p-yellow.svg?style=flat-square)](http://webchat.freenode.net/?channels=%23libp2p)
5
+ [![Discuss](https://img.shields.io/discourse/https/discuss.libp2p.io/posts.svg?style=flat-square)](https://discuss.libp2p.io)
6
+ [![codecov](https://img.shields.io/codecov/c/github/libp2p/js-libp2p-record.svg?style=flat-square)](https://codecov.io/gh/libp2p/js-libp2p-record)
7
+ [![CI](https://img.shields.io/github/workflow/status/libp2p/js-libp2p-interfaces/test%20&%20maybe%20release/master?style=flat-square)](https://github.com/libp2p/js-libp2p-record/actions/workflows/js-test-and-release.yml)
13
8
 
14
- > JavaScript implementation of libp2p record.
9
+ > libp2p record implementation
10
+
11
+ ## Table of contents <!-- omit in toc -->
12
+
13
+ - [Install](#install)
14
+ - [Description](#description)
15
+ - [Usage](#usage)
16
+ - [Contribute](#contribute)
17
+ - [License](#license)
18
+ - [Contribution](#contribution)
19
+
20
+ ## Install
21
+
22
+ ```console
23
+ $ npm i @libp2p/record
24
+ ```
15
25
 
16
26
  ## Description
17
27
 
@@ -19,22 +29,22 @@ Implementation of [go-libp2p-record](https://github.com/libp2p/go-libp2p-record)
19
29
 
20
30
  ## Usage
21
31
 
22
- See https://libp2p.github.io/js-libp2p-record/
32
+ See <https://libp2p.github.io/js-libp2p-record/>
23
33
 
24
34
  ## Contribute
25
35
 
26
36
  The libp2p implementation in JavaScript is a work in progress. As such, there are a few things you can do right now to help out:
27
37
 
28
- - Go through the modules and **check out existing issues**. This is especially useful for modules in active development. Some knowledge of IPFS/libp2p may be required, as well as the infrastructure behind it - for instance, you may need to read up on p2p and more complex operations like muxing to be able to help technically.
29
- - **Perform code reviews**. More eyes will help a) speed the project along b) ensure quality and c) reduce possible future bugs.
38
+ - Go through the modules and **check out existing issues**. This is especially useful for modules in active development. Some knowledge of IPFS/libp2p may be required, as well as the infrastructure behind it - for instance, you may need to read up on p2p and more complex operations like muxing to be able to help technically.
39
+ - **Perform code reviews**. More eyes will help a) speed the project along b) ensure quality and c) reduce possible future bugs.
30
40
 
31
41
  ## License
32
42
 
33
43
  Licensed under either of
34
44
 
35
- * Apache 2.0, ([LICENSE-APACHE](LICENSE-APACHE) / http://www.apache.org/licenses/LICENSE-2.0)
36
- * MIT ([LICENSE-MIT](LICENSE-MIT) / http://opensource.org/licenses/MIT)
45
+ - Apache 2.0, ([LICENSE-APACHE](LICENSE-APACHE) / <http://www.apache.org/licenses/LICENSE-2.0>)
46
+ - MIT ([LICENSE-MIT](LICENSE-MIT) / <http://opensource.org/licenses/MIT>)
37
47
 
38
- ### Contribution
48
+ ## Contribution
39
49
 
40
50
  Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.
@@ -1,4 +1,4 @@
1
- import type { Selectors } from '@libp2p/interfaces/dht';
1
+ import type { Selectors } from '@libp2p/interface-dht';
2
2
  /**
3
3
  * Select the best record out of the given records
4
4
  */
@@ -1 +1 @@
1
- {"version":3,"file":"selectors.d.ts","sourceRoot":"","sources":["../../src/selectors.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAA;AAEvD;;GAEG;AACH,wBAAgB,UAAU,CAAE,SAAS,EAAE,SAAS,EAAE,CAAC,EAAE,UAAU,EAAE,OAAO,EAAE,UAAU,EAAE,UA6BrF;AAWD,eAAO,MAAM,SAAS,EAAE,SAEvB,CAAA"}
1
+ {"version":3,"file":"selectors.d.ts","sourceRoot":"","sources":["../../src/selectors.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAA;AAEtD;;GAEG;AACH,wBAAgB,UAAU,CAAE,SAAS,EAAE,SAAS,EAAE,CAAC,EAAE,UAAU,EAAE,OAAO,EAAE,UAAU,EAAE,UA6BrF;AAWD,eAAO,MAAM,SAAS,EAAE,SAEvB,CAAA"}
@@ -1,5 +1,5 @@
1
1
  import type { Libp2pRecord } from './index.js';
2
- import type { Validators } from '@libp2p/interfaces/dht';
2
+ import type { Validators } from '@libp2p/interface-dht';
3
3
  /**
4
4
  * Checks a record and ensures it is still valid.
5
5
  * It runs the needed validators.
@@ -1 +1 @@
1
- {"version":3,"file":"validators.d.ts","sourceRoot":"","sources":["../../src/validators.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAA;AAC9C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAA;AAIxD;;;;GAIG;AACH,wBAAgB,YAAY,CAAE,UAAU,EAAE,UAAU,EAAE,MAAM,EAAE,YAAY,6BAmBzE;AAmCD,eAAO,MAAM,UAAU,EAAE,UAExB,CAAA"}
1
+ {"version":3,"file":"validators.d.ts","sourceRoot":"","sources":["../../src/validators.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAA;AAC9C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAA;AAIvD;;;;GAIG;AACH,wBAAgB,YAAY,CAAE,UAAU,EAAE,UAAU,EAAE,MAAM,EAAE,YAAY,6BAmBzE;AAmCD,eAAO,MAAM,UAAU,EAAE,UAExB,CAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@libp2p/record",
3
- "version": "1.0.5",
3
+ "version": "2.0.0",
4
4
  "description": "libp2p record implementation",
5
5
  "author": "Friedel Ziegelmayer <dignifiedquire@gmail.com>",
6
6
  "license": "Apache-2.0 OR MIT",
@@ -45,12 +45,15 @@
45
45
  ],
46
46
  "exports": {
47
47
  ".": {
48
+ "types": "./src/index.d.ts",
48
49
  "import": "./dist/src/index.js"
49
50
  },
50
51
  "./selectors": {
52
+ "types": "./dist/src/selectors.d.ts",
51
53
  "import": "./dist/src/selectors.js"
52
54
  },
53
55
  "./validators": {
56
+ "types": "./dist/src/validators.d.ts",
54
57
  "import": "./dist/src/validators.js"
55
58
  }
56
59
  },
@@ -159,7 +162,7 @@
159
162
  "release": "aegir release"
160
163
  },
161
164
  "dependencies": {
162
- "@libp2p/interfaces": "^2.0.2",
165
+ "@libp2p/interface-dht": "^1.0.0",
163
166
  "err-code": "^3.0.1",
164
167
  "multiformats": "^9.4.5",
165
168
  "protons-runtime": "^1.0.2",
package/src/selectors.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import errCode from 'err-code'
2
2
  import { toString as uint8ArrayToString } from 'uint8arrays/to-string'
3
- import type { Selectors } from '@libp2p/interfaces/dht'
3
+ import type { Selectors } from '@libp2p/interface-dht'
4
4
 
5
5
  /**
6
6
  * Select the best record out of the given records
package/src/validators.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import errCode from 'err-code'
2
2
  import { toString as uint8ArrayToString } from 'uint8arrays/to-string'
3
3
  import type { Libp2pRecord } from './index.js'
4
- import type { Validators } from '@libp2p/interfaces/dht'
4
+ import type { Validators } from '@libp2p/interface-dht'
5
5
  import { sha256 } from 'multiformats/hashes/sha2'
6
6
  import { equals as uint8ArrayEquals } from 'uint8arrays/equals'
7
7