@helia/json 3.0.0 → 3.0.1
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 +15 -0
- package/dist/src/index.d.ts +4 -3
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js.map +1 -1
- package/package.json +7 -7
- package/src/index.ts +4 -3
package/README.md
CHANGED
|
@@ -15,6 +15,21 @@
|
|
|
15
15
|
|
|
16
16
|
# About
|
|
17
17
|
|
|
18
|
+
<!--
|
|
19
|
+
|
|
20
|
+
!IMPORTANT!
|
|
21
|
+
|
|
22
|
+
Everything in this README between "# About" and "# Install" is automatically
|
|
23
|
+
generated and will be overwritten the next time the doc generator is run.
|
|
24
|
+
|
|
25
|
+
To make changes to this section, please update the @packageDocumentation section
|
|
26
|
+
of src/index.js or src/index.ts
|
|
27
|
+
|
|
28
|
+
To experiment with formatting, please run "npm run docs" from the root of this
|
|
29
|
+
repo and examine the changes made.
|
|
30
|
+
|
|
31
|
+
-->
|
|
32
|
+
|
|
18
33
|
`@helia/json` makes working with JSON in Helia simple & straightforward.
|
|
19
34
|
|
|
20
35
|
See the JSON interface for all available operations.
|
package/dist/src/index.d.ts
CHANGED
|
@@ -23,13 +23,14 @@
|
|
|
23
23
|
* ```
|
|
24
24
|
*/
|
|
25
25
|
import { CID } from 'multiformats/cid';
|
|
26
|
-
import type {
|
|
26
|
+
import type { GetBlockProgressEvents, PutBlockProgressEvents } from '@helia/interface/blocks';
|
|
27
27
|
import type { AbortOptions } from '@libp2p/interfaces';
|
|
28
|
+
import type { Blockstore } from 'interface-blockstore';
|
|
28
29
|
import type { BlockCodec } from 'multiformats/codecs/interface';
|
|
29
30
|
import type { MultihashHasher } from 'multiformats/hashes/interface';
|
|
30
31
|
import type { ProgressOptions } from 'progress-events';
|
|
31
32
|
export interface JSONComponents {
|
|
32
|
-
blockstore:
|
|
33
|
+
blockstore: Blockstore;
|
|
33
34
|
}
|
|
34
35
|
export interface AddOptions extends AbortOptions, ProgressOptions<PutBlockProgressEvents> {
|
|
35
36
|
hasher: MultihashHasher;
|
|
@@ -83,6 +84,6 @@ export interface JSON {
|
|
|
83
84
|
* Create a {@link JSON} instance for use with {@link https://github.com/ipfs/helia Helia}
|
|
84
85
|
*/
|
|
85
86
|
export declare function json(helia: {
|
|
86
|
-
blockstore:
|
|
87
|
+
blockstore: Blockstore;
|
|
87
88
|
}): JSON;
|
|
88
89
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/src/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAEH,OAAO,EAAE,GAAG,EAAE,MAAM,kBAAkB,CAAA;AAGtC,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAEH,OAAO,EAAE,GAAG,EAAE,MAAM,kBAAkB,CAAA;AAGtC,OAAO,KAAK,EAAE,sBAAsB,EAAE,sBAAsB,EAAE,MAAM,yBAAyB,CAAA;AAC7F,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAA;AACtD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAA;AACtD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAA;AAC/D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAA;AACpE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAA;AAEtD,MAAM,WAAW,cAAc;IAC7B,UAAU,EAAE,UAAU,CAAA;CACvB;AAED,MAAM,WAAW,UAAW,SAAQ,YAAY,EAAE,eAAe,CAAC,sBAAsB,CAAC;IACvF,MAAM,EAAE,eAAe,CAAA;CACxB;AAED,MAAM,WAAW,UAAW,SAAQ,YAAY,EAAE,eAAe,CAAC,sBAAsB,CAAC;IACvF,KAAK,EAAE,UAAU,CAAC,GAAG,EAAE,OAAO,CAAC,CAAA;CAChC;AAED;;;GAGG;AACH,MAAM,WAAW,IAAI;IACnB;;;;;;;;;;;;;;;OAeG;IACH,GAAG,CAAC,GAAG,EAAE,OAAO,EAAE,OAAO,CAAC,EAAE,OAAO,CAAC,UAAU,CAAC,GAAG,OAAO,CAAC,GAAG,CAAC,CAAA;IAE9D;;;;;;;;;;;;;;;;;OAiBG;IACH,GAAG,CAAC,CAAC,EAAE,GAAG,EAAE,GAAG,EAAE,OAAO,CAAC,EAAE,OAAO,CAAC,UAAU,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CAAA;CAC5D;AA0BD;;GAEG;AACH,wBAAgB,IAAI,CAAE,KAAK,EAAE;IAAE,UAAU,EAAE,UAAU,CAAA;CAAE,GAAG,IAAI,CAE7D"}
|
package/dist/src/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAEH,OAAO,EAAE,GAAG,EAAE,MAAM,kBAAkB,CAAA;AACtC,OAAO,KAAK,SAAS,MAAM,0BAA0B,CAAA;AACrD,OAAO,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAA;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAEH,OAAO,EAAE,GAAG,EAAE,MAAM,kBAAkB,CAAA;AACtC,OAAO,KAAK,SAAS,MAAM,0BAA0B,CAAA;AACrD,OAAO,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAA;AAgEjD,MAAM,WAAW;IACE,UAAU,CAAgB;IAE3C,YAAa,UAA0B;QACrC,IAAI,CAAC,UAAU,GAAG,UAAU,CAAA;IAC9B,CAAC;IAED,KAAK,CAAC,GAAG,CAAE,GAAQ,EAAE,UAA+B,EAAE;QACpD,MAAM,GAAG,GAAG,SAAS,CAAC,MAAM,CAAC,GAAG,CAAC,CAAA;QACjC,MAAM,IAAI,GAAG,MAAM,CAAC,OAAO,CAAC,MAAM,IAAI,MAAM,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAA;QACzD,MAAM,GAAG,GAAG,GAAG,CAAC,QAAQ,CAAC,SAAS,CAAC,IAAI,EAAE,IAAI,CAAC,CAAA;QAE9C,MAAM,IAAI,CAAC,UAAU,CAAC,UAAU,CAAC,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,OAAO,CAAC,CAAA;QAEvD,OAAO,GAAG,CAAA;IACZ,CAAC;IAED,KAAK,CAAC,GAAG,CAAM,GAAQ,EAAE,UAA+B,EAAE;QACxD,MAAM,GAAG,GAAG,MAAM,IAAI,CAAC,UAAU,CAAC,UAAU,CAAC,GAAG,CAAC,GAAG,EAAE,OAAO,CAAC,CAAA;QAE9D,OAAO,SAAS,CAAC,MAAM,CAAC,GAAG,CAAC,CAAA;IAC9B,CAAC;CACF;AAED;;GAEG;AACH,MAAM,UAAU,IAAI,CAAE,KAAiC;IACrD,OAAO,IAAI,WAAW,CAAC,KAAK,CAAC,CAAA;AAC/B,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@helia/json",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.1",
|
|
4
4
|
"description": "Add/get IPLD blocks containing json with your Helia node",
|
|
5
5
|
"license": "Apache-2.0 OR MIT",
|
|
6
6
|
"homepage": "https://github.com/ipfs/helia/tree/main/packages/json#readme",
|
|
@@ -139,14 +139,14 @@
|
|
|
139
139
|
"release": "aegir release"
|
|
140
140
|
},
|
|
141
141
|
"dependencies": {
|
|
142
|
-
"@helia/interface": "^4.0.
|
|
143
|
-
"@libp2p/interfaces": "^3.3.
|
|
144
|
-
"
|
|
142
|
+
"@helia/interface": "^4.0.1",
|
|
143
|
+
"@libp2p/interfaces": "^3.3.2",
|
|
144
|
+
"interface-blockstore": "^5.2.10",
|
|
145
|
+
"multiformats": "^13.1.0",
|
|
145
146
|
"progress-events": "^1.0.0"
|
|
146
147
|
},
|
|
147
148
|
"devDependencies": {
|
|
148
|
-
"aegir": "^42.
|
|
149
|
-
"blockstore-core": "^4.
|
|
150
|
-
"interface-blockstore": "^5.2.9"
|
|
149
|
+
"aegir": "^42.2.5",
|
|
150
|
+
"blockstore-core": "^4.4.0"
|
|
151
151
|
}
|
|
152
152
|
}
|
package/src/index.ts
CHANGED
|
@@ -26,14 +26,15 @@
|
|
|
26
26
|
import { CID } from 'multiformats/cid'
|
|
27
27
|
import * as jsonCodec from 'multiformats/codecs/json'
|
|
28
28
|
import { sha256 } from 'multiformats/hashes/sha2'
|
|
29
|
-
import type {
|
|
29
|
+
import type { GetBlockProgressEvents, PutBlockProgressEvents } from '@helia/interface/blocks'
|
|
30
30
|
import type { AbortOptions } from '@libp2p/interfaces'
|
|
31
|
+
import type { Blockstore } from 'interface-blockstore'
|
|
31
32
|
import type { BlockCodec } from 'multiformats/codecs/interface'
|
|
32
33
|
import type { MultihashHasher } from 'multiformats/hashes/interface'
|
|
33
34
|
import type { ProgressOptions } from 'progress-events'
|
|
34
35
|
|
|
35
36
|
export interface JSONComponents {
|
|
36
|
-
blockstore:
|
|
37
|
+
blockstore: Blockstore
|
|
37
38
|
}
|
|
38
39
|
|
|
39
40
|
export interface AddOptions extends AbortOptions, ProgressOptions<PutBlockProgressEvents> {
|
|
@@ -115,6 +116,6 @@ class DefaultJSON implements JSON {
|
|
|
115
116
|
/**
|
|
116
117
|
* Create a {@link JSON} instance for use with {@link https://github.com/ipfs/helia Helia}
|
|
117
118
|
*/
|
|
118
|
-
export function json (helia: { blockstore:
|
|
119
|
+
export function json (helia: { blockstore: Blockstore }): JSON {
|
|
119
120
|
return new DefaultJSON(helia)
|
|
120
121
|
}
|