@fireproof/vendor 1.0.3 → 1.1.0-dev
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/package.json +4 -97
- package/src/@web3-storage/pail/dist/src/batch/index.d.ts +1 -53
- package/src/@web3-storage/pail/dist/src/batch/index.d.ts.map +1 -1
- package/src/@web3-storage/pail/dist/src/batch/shard.d.ts +1 -1
- package/src/@web3-storage/pail/dist/src/batch/shard.d.ts.map +1 -1
- package/src/@web3-storage/pail/dist/src/block.d.ts +2 -2
- package/src/@web3-storage/pail/dist/src/block.d.ts.map +1 -1
- package/src/@web3-storage/pail/dist/src/clock/index.d.ts +2 -2
- package/src/@web3-storage/pail/dist/src/clock/index.d.ts.map +1 -1
- package/src/@web3-storage/pail/dist/src/crdt/batch/index.d.ts.map +1 -1
- package/src/@web3-storage/pail/dist/src/crdt/index.d.ts +2 -2
- package/src/@web3-storage/pail/dist/src/crdt/index.d.ts.map +1 -1
- package/src/@web3-storage/pail/dist/src/diff.d.ts +3 -3
- package/src/@web3-storage/pail/dist/src/diff.d.ts.map +1 -1
- package/src/@web3-storage/pail/dist/src/index.d.ts +1 -1
- package/src/@web3-storage/pail/dist/src/index.d.ts.map +1 -1
- package/src/@web3-storage/pail/dist/src/merge.d.ts.map +1 -1
- package/src/@web3-storage/pail/dist/src/shard.d.ts +4 -4
- package/src/@web3-storage/pail/dist/src/shard.d.ts.map +1 -1
- package/src/@web3-storage/pail/dist/tsconfig.tsbuildinfo +1 -1
- package/src/@web3-storage/pail/src/api.ts +1 -1
- package/src/@web3-storage/pail/src/clock/index.js +1 -1
- package/src/@web3-storage/pail/src/shard.js +1 -1
- package/src/@ipld/car/LICENSE +0 -4
- package/src/@ipld/car/README.md +0 -1132
- package/src/@ipld/car/dist/index.min.js +0 -5
- package/src/@ipld/car/dist/src/api.d.ts +0 -72
- package/src/@ipld/car/dist/src/api.d.ts.map +0 -1
- package/src/@ipld/car/dist/src/buffer-decoder.d.ts +0 -67
- package/src/@ipld/car/dist/src/buffer-decoder.d.ts.map +0 -1
- package/src/@ipld/car/dist/src/buffer-reader-browser.d.ts +0 -116
- package/src/@ipld/car/dist/src/buffer-reader-browser.d.ts.map +0 -1
- package/src/@ipld/car/dist/src/buffer-reader.d.ts +0 -31
- package/src/@ipld/car/dist/src/buffer-reader.d.ts.map +0 -1
- package/src/@ipld/car/dist/src/buffer-writer.d.ts +0 -86
- package/src/@ipld/car/dist/src/buffer-writer.d.ts.map +0 -1
- package/src/@ipld/car/dist/src/coding.d.ts +0 -49
- package/src/@ipld/car/dist/src/coding.d.ts.map +0 -1
- package/src/@ipld/car/dist/src/decoder-common.d.ts +0 -43
- package/src/@ipld/car/dist/src/decoder-common.d.ts.map +0 -1
- package/src/@ipld/car/dist/src/decoder.d.ts +0 -87
- package/src/@ipld/car/dist/src/decoder.d.ts.map +0 -1
- package/src/@ipld/car/dist/src/encoder.d.ts +0 -17
- package/src/@ipld/car/dist/src/encoder.d.ts.map +0 -1
- package/src/@ipld/car/dist/src/header-validator.d.ts +0 -5
- package/src/@ipld/car/dist/src/header-validator.d.ts.map +0 -1
- package/src/@ipld/car/dist/src/index-browser.d.ts +0 -10
- package/src/@ipld/car/dist/src/index-browser.d.ts.map +0 -1
- package/src/@ipld/car/dist/src/index.d.ts +0 -11
- package/src/@ipld/car/dist/src/index.d.ts.map +0 -1
- package/src/@ipld/car/dist/src/indexed-reader-browser.d.ts +0 -5
- package/src/@ipld/car/dist/src/indexed-reader-browser.d.ts.map +0 -1
- package/src/@ipld/car/dist/src/indexed-reader.d.ts +0 -152
- package/src/@ipld/car/dist/src/indexed-reader.d.ts.map +0 -1
- package/src/@ipld/car/dist/src/indexer.d.ts +0 -95
- package/src/@ipld/car/dist/src/indexer.d.ts.map +0 -1
- package/src/@ipld/car/dist/src/iterator-channel.d.ts +0 -7
- package/src/@ipld/car/dist/src/iterator-channel.d.ts.map +0 -1
- package/src/@ipld/car/dist/src/iterator.d.ts +0 -174
- package/src/@ipld/car/dist/src/iterator.d.ts.map +0 -1
- package/src/@ipld/car/dist/src/reader-browser.d.ts +0 -151
- package/src/@ipld/car/dist/src/reader-browser.d.ts.map +0 -1
- package/src/@ipld/car/dist/src/reader.d.ts +0 -35
- package/src/@ipld/car/dist/src/reader.d.ts.map +0 -1
- package/src/@ipld/car/dist/src/writer-browser.d.ts +0 -155
- package/src/@ipld/car/dist/src/writer-browser.d.ts.map +0 -1
- package/src/@ipld/car/dist/src/writer.d.ts +0 -45
- package/src/@ipld/car/dist/src/writer.d.ts.map +0 -1
- package/src/@ipld/car/src/api.ts +0 -90
- package/src/@ipld/car/src/buffer-decoder.js +0 -213
- package/src/@ipld/car/src/buffer-reader-browser.js +0 -144
- package/src/@ipld/car/src/buffer-reader.js +0 -51
- package/src/@ipld/car/src/buffer-writer.js +0 -286
- package/src/@ipld/car/src/coding.ts +0 -68
- package/src/@ipld/car/src/decoder-common.js +0 -82
- package/src/@ipld/car/src/decoder.js +0 -347
- package/src/@ipld/car/src/encoder.js +0 -76
- package/src/@ipld/car/src/header-validator.js +0 -214
- package/src/@ipld/car/src/header.ipldsch +0 -18
- package/src/@ipld/car/src/index-browser.js +0 -18
- package/src/@ipld/car/src/index.js +0 -21
- package/src/@ipld/car/src/indexed-reader-browser.js +0 -7
- package/src/@ipld/car/src/indexed-reader.js +0 -211
- package/src/@ipld/car/src/indexer.js +0 -130
- package/src/@ipld/car/src/iterator-channel.js +0 -91
- package/src/@ipld/car/src/iterator.js +0 -267
- package/src/@ipld/car/src/reader-browser.js +0 -194
- package/src/@ipld/car/src/reader.js +0 -73
- package/src/@ipld/car/src/writer-browser.js +0 -250
- package/src/@ipld/car/src/writer.js +0 -84
- package/src/@ipld/dag-cbor/LICENSE +0 -4
- package/src/@ipld/dag-cbor/README.md +0 -80
- package/src/@ipld/dag-cbor/dist/index.min.js +0 -3
- package/src/@ipld/dag-cbor/dist/src/index.d.ts +0 -67
- package/src/@ipld/dag-cbor/dist/src/index.d.ts.map +0 -1
- package/src/@ipld/dag-cbor/src/index.js +0 -147
- package/src/@ipld/dag-json/LICENSE +0 -4
- package/src/@ipld/dag-json/README.md +0 -58
- package/src/@ipld/dag-json/dist/index.min.js +0 -3
- package/src/@ipld/dag-json/dist/src/index.d.ts +0 -12
- package/src/@ipld/dag-json/dist/src/index.d.ts.map +0 -1
- package/src/@ipld/dag-json/src/index.js +0 -291
- package/src/cborg/.github/dependabot.yml +0 -16
- package/src/cborg/.github/workflows/test-and-release.yml +0 -52
- package/src/cborg/CHANGELOG.md +0 -513
- package/src/cborg/LICENSE +0 -13
- package/src/cborg/README.md +0 -515
- package/src/cborg/bench/bench.js +0 -117
- package/src/cborg/bench/json.js +0 -124
- package/src/cborg/bench/package.json +0 -8
- package/src/cborg/cborg/bin.js +0 -189
- package/src/cborg/cborg/common.js +0 -28
- package/src/cborg/cborg/decode.js +0 -211
- package/src/cborg/cborg/diagnostic.js +0 -158
- package/src/cborg/cborg/diagnostic_test.js +0 -117
- package/src/cborg/cborg/encode.js +0 -466
- package/src/cborg/cborg/index.js +0 -33
- package/src/cborg/cborg/is.js +0 -106
- package/src/cborg/cborg/length.js +0 -62
- package/src/cborg/example-bytestrings.js +0 -180
- package/src/cborg/example-json.js +0 -6
- package/src/cborg/example.js +0 -5
- package/src/cborg/interface.ts +0 -59
- package/src/cborg/json/decode.js +0 -462
- package/src/cborg/json/encode.js +0 -302
- package/src/cborg/json/json.js +0 -4
- package/src/cborg/taglib.js +0 -75
- package/src/cborg/test/appendix_a.js +0 -647
- package/src/cborg/test/common.js +0 -18
- package/src/cborg/test/node-test-bin.js +0 -402
- package/src/cborg/test/noop-bin-test.js +0 -3
- package/src/cborg/test/test-0uint.js +0 -103
- package/src/cborg/test/test-1negint.js +0 -96
- package/src/cborg/test/test-2bytes.js +0 -198
- package/src/cborg/test/test-3string.js +0 -136
- package/src/cborg/test/test-4array.js +0 -93
- package/src/cborg/test/test-5map.js +0 -284
- package/src/cborg/test/test-6tag.js +0 -84
- package/src/cborg/test/test-7float.js +0 -131
- package/src/cborg/test/test-bl.js +0 -37
- package/src/cborg/test/test-cbor-vectors.js +0 -107
- package/src/cborg/test/test-decode-errors.js +0 -65
- package/src/cborg/test/test-fuzz.js +0 -42
- package/src/cborg/test/test-json.js +0 -219
- package/src/cborg/test/test-length.js +0 -65
- package/src/cborg/test/test-partial.js +0 -111
- package/src/cborg/tsconfig.json +0 -48
- package/src/cborg/types/cborg/decode.d.ts +0 -43
- package/src/cborg/types/cborg/decode.d.ts.map +0 -1
- package/src/cborg/types/cborg/encode.d.ts +0 -51
- package/src/cborg/types/cborg/encode.d.ts.map +0 -1
- package/src/cborg/types/cborg/index.d.ts +0 -26
- package/src/cborg/types/cborg/index.d.ts.map +0 -1
- package/src/cborg/types/cborg/is.d.ts +0 -6
- package/src/cborg/types/cborg/is.d.ts.map +0 -1
- package/src/cborg/types/example.d.ts +0 -2
- package/src/cborg/types/example.d.ts.map +0 -1
- package/src/cborg/types/interface.d.ts +0 -49
- package/src/cborg/types/interface.d.ts.map +0 -1
- package/src/cborg/types/json/decode.d.ts +0 -67
- package/src/cborg/types/json/decode.d.ts.map +0 -1
- package/src/cborg/types/json/encode.d.ts +0 -11
- package/src/cborg/types/json/encode.d.ts.map +0 -1
- package/src/cborg/types/json/json.d.ts +0 -6
- package/src/cborg/types/json/json.d.ts.map +0 -1
- package/src/cborg/types/taglib.d.ts +0 -18
- package/src/cborg/types/taglib.d.ts.map +0 -1
- package/src/cborg/types/tsconfig.tsbuildinfo +0 -1
- package/src/cborg/types/utils/0uint.d.ts +0 -102
- package/src/cborg/types/utils/0uint.d.ts.map +0 -1
- package/src/cborg/types/utils/1negint.d.ts +0 -59
- package/src/cborg/types/utils/1negint.d.ts.map +0 -1
- package/src/cborg/types/utils/2bytes.d.ts +0 -69
- package/src/cborg/types/utils/2bytes.d.ts.map +0 -1
- package/src/cborg/types/utils/3string.d.ts +0 -46
- package/src/cborg/types/utils/3string.d.ts.map +0 -1
- package/src/cborg/types/utils/4array.d.ts +0 -66
- package/src/cborg/types/utils/4array.d.ts.map +0 -1
- package/src/cborg/types/utils/5map.d.ts +0 -66
- package/src/cborg/types/utils/5map.d.ts.map +0 -1
- package/src/cborg/types/utils/6tag.d.ts +0 -62
- package/src/cborg/types/utils/6tag.d.ts.map +0 -1
- package/src/cborg/types/utils/7float.d.ts +0 -60
- package/src/cborg/types/utils/7float.d.ts.map +0 -1
- package/src/cborg/types/utils/bl.d.ts +0 -26
- package/src/cborg/types/utils/bl.d.ts.map +0 -1
- package/src/cborg/types/utils/byte-utils.d.ts +0 -53
- package/src/cborg/types/utils/byte-utils.d.ts.map +0 -1
- package/src/cborg/types/utils/common.d.ts +0 -8
- package/src/cborg/types/utils/common.d.ts.map +0 -1
- package/src/cborg/types/utils/index.d.ts +0 -13
- package/src/cborg/types/utils/index.d.ts.map +0 -1
- package/src/cborg/types/utils/jump.d.ts +0 -16
- package/src/cborg/types/utils/jump.d.ts.map +0 -1
- package/src/cborg/types/utils/token.d.ts +0 -59
- package/src/cborg/types/utils/token.d.ts.map +0 -1
- package/src/cborg/utils/0uint.js +0 -229
- package/src/cborg/utils/1negint.js +0 -111
- package/src/cborg/utils/2bytes.js +0 -135
- package/src/cborg/utils/3string.js +0 -90
- package/src/cborg/utils/4array.js +0 -114
- package/src/cborg/utils/5map.js +0 -113
- package/src/cborg/utils/6tag.js +0 -81
- package/src/cborg/utils/7float.js +0 -310
- package/src/cborg/utils/bl.js +0 -124
- package/src/cborg/utils/byte-utils.js +0 -417
- package/src/cborg/utils/common.js +0 -11
- package/src/cborg/utils/index.js +0 -12
- package/src/cborg/utils/jump.js +0 -222
- package/src/cborg/utils/token.js +0 -76
- package/src/ipfs-unixfs-exporter/LICENSE +0 -4
- package/src/ipfs-unixfs-exporter/README.md +0 -105
- package/src/ipfs-unixfs-exporter/dist/index.min.js +0 -3
- package/src/ipfs-unixfs-exporter/dist/src/errors.d.ts +0 -57
- package/src/ipfs-unixfs-exporter/dist/src/errors.d.ts.map +0 -1
- package/src/ipfs-unixfs-exporter/dist/src/errors.js +0 -73
- package/src/ipfs-unixfs-exporter/dist/src/errors.js.map +0 -1
- package/src/ipfs-unixfs-exporter/dist/src/index.d.ts +0 -355
- package/src/ipfs-unixfs-exporter/dist/src/index.d.ts.map +0 -1
- package/src/ipfs-unixfs-exporter/dist/src/index.js +0 -197
- package/src/ipfs-unixfs-exporter/dist/src/index.js.map +0 -1
- package/src/ipfs-unixfs-exporter/dist/src/resolvers/dag-cbor.d.ts +0 -4
- package/src/ipfs-unixfs-exporter/dist/src/resolvers/dag-cbor.d.ts.map +0 -1
- package/src/ipfs-unixfs-exporter/dist/src/resolvers/dag-cbor.js +0 -9
- package/src/ipfs-unixfs-exporter/dist/src/resolvers/dag-cbor.js.map +0 -1
- package/src/ipfs-unixfs-exporter/dist/src/resolvers/dag-json.d.ts +0 -4
- package/src/ipfs-unixfs-exporter/dist/src/resolvers/dag-json.d.ts.map +0 -1
- package/src/ipfs-unixfs-exporter/dist/src/resolvers/dag-json.js +0 -9
- package/src/ipfs-unixfs-exporter/dist/src/resolvers/dag-json.js.map +0 -1
- package/src/ipfs-unixfs-exporter/dist/src/resolvers/identity.d.ts +0 -4
- package/src/ipfs-unixfs-exporter/dist/src/resolvers/identity.d.ts.map +0 -1
- package/src/ipfs-unixfs-exporter/dist/src/resolvers/identity.js +0 -38
- package/src/ipfs-unixfs-exporter/dist/src/resolvers/identity.js.map +0 -1
- package/src/ipfs-unixfs-exporter/dist/src/resolvers/index.d.ts +0 -4
- package/src/ipfs-unixfs-exporter/dist/src/resolvers/index.d.ts.map +0 -1
- package/src/ipfs-unixfs-exporter/dist/src/resolvers/index.js +0 -30
- package/src/ipfs-unixfs-exporter/dist/src/resolvers/index.js.map +0 -1
- package/src/ipfs-unixfs-exporter/dist/src/resolvers/json.d.ts +0 -4
- package/src/ipfs-unixfs-exporter/dist/src/resolvers/json.d.ts.map +0 -1
- package/src/ipfs-unixfs-exporter/dist/src/resolvers/json.js +0 -9
- package/src/ipfs-unixfs-exporter/dist/src/resolvers/json.js.map +0 -1
- package/src/ipfs-unixfs-exporter/dist/src/resolvers/raw.d.ts +0 -4
- package/src/ipfs-unixfs-exporter/dist/src/resolvers/raw.d.ts.map +0 -1
- package/src/ipfs-unixfs-exporter/dist/src/resolvers/raw.js +0 -37
- package/src/ipfs-unixfs-exporter/dist/src/resolvers/raw.js.map +0 -1
- package/src/ipfs-unixfs-exporter/dist/src/resolvers/unixfs-v1/content/directory.d.ts +0 -4
- package/src/ipfs-unixfs-exporter/dist/src/resolvers/unixfs-v1/content/directory.d.ts.map +0 -1
- package/src/ipfs-unixfs-exporter/dist/src/resolvers/unixfs-v1/content/directory.js +0 -29
- package/src/ipfs-unixfs-exporter/dist/src/resolvers/unixfs-v1/content/directory.js.map +0 -1
- package/src/ipfs-unixfs-exporter/dist/src/resolvers/unixfs-v1/content/file.d.ts +0 -4
- package/src/ipfs-unixfs-exporter/dist/src/resolvers/unixfs-v1/content/file.d.ts.map +0 -1
- package/src/ipfs-unixfs-exporter/dist/src/resolvers/unixfs-v1/content/file.js +0 -153
- package/src/ipfs-unixfs-exporter/dist/src/resolvers/unixfs-v1/content/file.js.map +0 -1
- package/src/ipfs-unixfs-exporter/dist/src/resolvers/unixfs-v1/content/hamt-sharded-directory.d.ts +0 -4
- package/src/ipfs-unixfs-exporter/dist/src/resolvers/unixfs-v1/content/hamt-sharded-directory.d.ts.map +0 -1
- package/src/ipfs-unixfs-exporter/dist/src/resolvers/unixfs-v1/content/hamt-sharded-directory.js +0 -59
- package/src/ipfs-unixfs-exporter/dist/src/resolvers/unixfs-v1/content/hamt-sharded-directory.js.map +0 -1
- package/src/ipfs-unixfs-exporter/dist/src/resolvers/unixfs-v1/content/raw.d.ts +0 -4
- package/src/ipfs-unixfs-exporter/dist/src/resolvers/unixfs-v1/content/raw.d.ts.map +0 -1
- package/src/ipfs-unixfs-exporter/dist/src/resolvers/unixfs-v1/content/raw.js +0 -25
- package/src/ipfs-unixfs-exporter/dist/src/resolvers/unixfs-v1/content/raw.js.map +0 -1
- package/src/ipfs-unixfs-exporter/dist/src/resolvers/unixfs-v1/index.d.ts +0 -4
- package/src/ipfs-unixfs-exporter/dist/src/resolvers/unixfs-v1/index.d.ts.map +0 -1
- package/src/ipfs-unixfs-exporter/dist/src/resolvers/unixfs-v1/index.js +0 -104
- package/src/ipfs-unixfs-exporter/dist/src/resolvers/unixfs-v1/index.js.map +0 -1
- package/src/ipfs-unixfs-exporter/dist/src/utils/extract-data-from-block.d.ts +0 -3
- package/src/ipfs-unixfs-exporter/dist/src/utils/extract-data-from-block.d.ts.map +0 -1
- package/src/ipfs-unixfs-exporter/dist/src/utils/extract-data-from-block.js +0 -20
- package/src/ipfs-unixfs-exporter/dist/src/utils/extract-data-from-block.js.map +0 -1
- package/src/ipfs-unixfs-exporter/dist/src/utils/find-cid-in-shard.d.ts +0 -6
- package/src/ipfs-unixfs-exporter/dist/src/utils/find-cid-in-shard.d.ts.map +0 -1
- package/src/ipfs-unixfs-exporter/dist/src/utils/find-cid-in-shard.js +0 -116
- package/src/ipfs-unixfs-exporter/dist/src/utils/find-cid-in-shard.js.map +0 -1
- package/src/ipfs-unixfs-exporter/dist/src/utils/resolve-object-path.d.ts +0 -4
- package/src/ipfs-unixfs-exporter/dist/src/utils/resolve-object-path.d.ts.map +0 -1
- package/src/ipfs-unixfs-exporter/dist/src/utils/resolve-object-path.js +0 -57
- package/src/ipfs-unixfs-exporter/dist/src/utils/resolve-object-path.js.map +0 -1
- package/src/ipfs-unixfs-exporter/dist/src/utils/validate-offset-and-length.d.ts +0 -6
- package/src/ipfs-unixfs-exporter/dist/src/utils/validate-offset-and-length.d.ts.map +0 -1
- package/src/ipfs-unixfs-exporter/dist/src/utils/validate-offset-and-length.js +0 -30
- package/src/ipfs-unixfs-exporter/dist/src/utils/validate-offset-and-length.js.map +0 -1
- package/src/ipfs-unixfs-exporter/dist/typedoc-urls.json +0 -58
- package/src/ipfs-unixfs-exporter/src/errors.ts +0 -87
- package/src/ipfs-unixfs-exporter/src/index.ts +0 -498
- package/src/ipfs-unixfs-exporter/src/resolvers/dag-cbor.ts +0 -12
- package/src/ipfs-unixfs-exporter/src/resolvers/dag-json.ts +0 -12
- package/src/ipfs-unixfs-exporter/src/resolvers/identity.ts +0 -49
- package/src/ipfs-unixfs-exporter/src/resolvers/index.ts +0 -35
- package/src/ipfs-unixfs-exporter/src/resolvers/json.ts +0 -12
- package/src/ipfs-unixfs-exporter/src/resolvers/raw.ts +0 -49
- package/src/ipfs-unixfs-exporter/src/resolvers/unixfs-v1/content/directory.ts +0 -39
- package/src/ipfs-unixfs-exporter/src/resolvers/unixfs-v1/content/file.ts +0 -198
- package/src/ipfs-unixfs-exporter/src/resolvers/unixfs-v1/content/hamt-sharded-directory.ts +0 -76
- package/src/ipfs-unixfs-exporter/src/resolvers/unixfs-v1/content/raw.ts +0 -37
- package/src/ipfs-unixfs-exporter/src/resolvers/unixfs-v1/index.ts +0 -121
- package/src/ipfs-unixfs-exporter/src/utils/extract-data-from-block.ts +0 -24
- package/src/ipfs-unixfs-exporter/src/utils/find-cid-in-shard.ts +0 -149
- package/src/ipfs-unixfs-exporter/src/utils/resolve-object-path.ts +0 -62
- package/src/ipfs-unixfs-exporter/src/utils/validate-offset-and-length.ts +0 -38
|
@@ -1,87 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @typedef {import('./api').Block} Block
|
|
3
|
-
* @typedef {import('./api').BlockHeader} BlockHeader
|
|
4
|
-
* @typedef {import('./api').BlockIndex} BlockIndex
|
|
5
|
-
* @typedef {import('./coding').BytesReader} BytesReader
|
|
6
|
-
* @typedef {import('./coding').CarHeader} CarHeader
|
|
7
|
-
* @typedef {import('./coding').CarV2Header} CarV2Header
|
|
8
|
-
* @typedef {import('./coding').CarV2FixedHeader} CarV2FixedHeader
|
|
9
|
-
* @typedef {import('./coding').CarDecoder} CarDecoder
|
|
10
|
-
*/
|
|
11
|
-
/**
|
|
12
|
-
* Reads header data from a `BytesReader`. The header may either be in the form
|
|
13
|
-
* of a `CarHeader` or `CarV2Header` depending on the CAR being read.
|
|
14
|
-
*
|
|
15
|
-
* @name async decoder.readHeader(reader)
|
|
16
|
-
* @param {BytesReader} reader
|
|
17
|
-
* @param {number} [strictVersion]
|
|
18
|
-
* @returns {Promise<CarHeader|CarV2Header>}
|
|
19
|
-
*/
|
|
20
|
-
export function readHeader(reader: BytesReader, strictVersion?: number | undefined): Promise<CarHeader | CarV2Header>;
|
|
21
|
-
/**
|
|
22
|
-
* Reads the leading data of an individual block from CAR data from a
|
|
23
|
-
* `BytesReader`. Returns a `BlockHeader` object which contains
|
|
24
|
-
* `{ cid, length, blockLength }` which can be used to either index the block
|
|
25
|
-
* or read the block binary data.
|
|
26
|
-
*
|
|
27
|
-
* @name async decoder.readBlockHead(reader)
|
|
28
|
-
* @param {BytesReader} reader
|
|
29
|
-
* @returns {Promise<BlockHeader>}
|
|
30
|
-
*/
|
|
31
|
-
export function readBlockHead(reader: BytesReader): Promise<BlockHeader>;
|
|
32
|
-
/**
|
|
33
|
-
* Creates a `CarDecoder` from a `BytesReader`. The `CarDecoder` is as async
|
|
34
|
-
* interface that will consume the bytes from the `BytesReader` to yield a
|
|
35
|
-
* `header()` and either `blocks()` or `blocksIndex()` data.
|
|
36
|
-
*
|
|
37
|
-
* @name decoder.createDecoder(reader)
|
|
38
|
-
* @param {BytesReader} reader
|
|
39
|
-
* @returns {CarDecoder}
|
|
40
|
-
*/
|
|
41
|
-
export function createDecoder(reader: BytesReader): CarDecoder;
|
|
42
|
-
/**
|
|
43
|
-
* Creates a `BytesReader` from a `Uint8Array`.
|
|
44
|
-
*
|
|
45
|
-
* @name decoder.bytesReader(bytes)
|
|
46
|
-
* @param {Uint8Array} bytes
|
|
47
|
-
* @returns {BytesReader}
|
|
48
|
-
*/
|
|
49
|
-
export function bytesReader(bytes: Uint8Array): BytesReader;
|
|
50
|
-
/**
|
|
51
|
-
* @ignore
|
|
52
|
-
* reusable reader for streams and files, we just need a way to read an
|
|
53
|
-
* additional chunk (of some undetermined size) and a way to close the
|
|
54
|
-
* reader when finished
|
|
55
|
-
* @param {() => Promise<Uint8Array|null>} readChunk
|
|
56
|
-
* @returns {BytesReader}
|
|
57
|
-
*/
|
|
58
|
-
export function chunkReader(readChunk: () => Promise<Uint8Array | null>): BytesReader;
|
|
59
|
-
/**
|
|
60
|
-
* Creates a `BytesReader` from an `AsyncIterable<Uint8Array>`, which allows for
|
|
61
|
-
* consumption of CAR data from a streaming source.
|
|
62
|
-
*
|
|
63
|
-
* @name decoder.asyncIterableReader(asyncIterable)
|
|
64
|
-
* @param {AsyncIterable<Uint8Array>} asyncIterable
|
|
65
|
-
* @returns {BytesReader}
|
|
66
|
-
*/
|
|
67
|
-
export function asyncIterableReader(asyncIterable: AsyncIterable<Uint8Array>): BytesReader;
|
|
68
|
-
/**
|
|
69
|
-
* Wraps a `BytesReader` in a limiting `BytesReader` which limits maximum read
|
|
70
|
-
* to `byteLimit` bytes. It _does not_ update `pos` of the original
|
|
71
|
-
* `BytesReader`.
|
|
72
|
-
*
|
|
73
|
-
* @name decoder.limitReader(reader, byteLimit)
|
|
74
|
-
* @param {BytesReader} reader
|
|
75
|
-
* @param {number} byteLimit
|
|
76
|
-
* @returns {BytesReader}
|
|
77
|
-
*/
|
|
78
|
-
export function limitReader(reader: BytesReader, byteLimit: number): BytesReader;
|
|
79
|
-
export type Block = import('./api').Block;
|
|
80
|
-
export type BlockHeader = import('./api').BlockHeader;
|
|
81
|
-
export type BlockIndex = import('./api').BlockIndex;
|
|
82
|
-
export type BytesReader = import('./coding').BytesReader;
|
|
83
|
-
export type CarHeader = import('./coding').CarHeader;
|
|
84
|
-
export type CarV2Header = import('./coding').CarV2Header;
|
|
85
|
-
export type CarV2FixedHeader = import('./coding').CarV2FixedHeader;
|
|
86
|
-
export type CarDecoder = import('./coding').CarDecoder;
|
|
87
|
-
//# sourceMappingURL=decoder.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"decoder.d.ts","sourceRoot":"","sources":["../../src/decoder.js"],"names":[],"mappings":"AAMA;;;;;;;;;GASG;AAEH;;;;;;;;GAQG;AACH,mCAJW,WAAW,uCAET,QAAQ,SAAS,GAAC,WAAW,CAAC,CA8B1C;AAyBD;;;;;;;;;GASG;AACH,sCAHW,WAAW,GACT,QAAQ,WAAW,CAAC,CAehC;AAwBD;;;;;;;;GAQG;AACH,sCAHW,WAAW,GACT,UAAU,CA6BtB;AAED;;;;;;GAMG;AACH,mCAHW,UAAU,GACR,WAAW,CA+BvB;AAED;;;;;;;GAOG;AACH,uCAHW,MAAM,QAAQ,UAAU,GAAC,IAAI,CAAC,GAC5B,WAAW,CAuEvB;AAED;;;;;;;GAOG;AACH,mDAHW,cAAc,UAAU,CAAC,GACvB,WAAW,CAcvB;AAED;;;;;;;;;GASG;AACH,oCAJW,WAAW,aACX,MAAM,GACJ,WAAW,CAmCvB;oBAnVY,OAAO,OAAO,EAAE,KAAK;0BACrB,OAAO,OAAO,EAAE,WAAW;yBAC3B,OAAO,OAAO,EAAE,UAAU;0BAC1B,OAAO,UAAU,EAAE,WAAW;wBAC9B,OAAO,UAAU,EAAE,SAAS;0BAC5B,OAAO,UAAU,EAAE,WAAW;+BAC9B,OAAO,UAAU,EAAE,gBAAgB;yBACnC,OAAO,UAAU,EAAE,UAAU"}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Create a header from an array of roots.
|
|
3
|
-
*
|
|
4
|
-
* @param {CID[]} roots
|
|
5
|
-
* @returns {Uint8Array}
|
|
6
|
-
*/
|
|
7
|
-
export function createHeader(roots: CID[]): Uint8Array;
|
|
8
|
-
export type CID = import('multiformats').CID;
|
|
9
|
-
export type Block = import('./api').Block;
|
|
10
|
-
export type CarEncoder = import('./coding').CarEncoder;
|
|
11
|
-
export type IteratorChannel_Writer = import('./coding').IteratorChannel_Writer<Uint8Array>;
|
|
12
|
-
/**
|
|
13
|
-
* @param {IteratorChannel_Writer} writer
|
|
14
|
-
* @returns {CarEncoder}
|
|
15
|
-
*/
|
|
16
|
-
export function createEncoder(writer: import("./coding").IteratorChannel_Writer<Uint8Array>): CarEncoder;
|
|
17
|
-
//# sourceMappingURL=encoder.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"encoder.d.ts","sourceRoot":"","sources":["../../src/encoder.js"],"names":[],"mappings":"AAYA;;;;;GAKG;AACH,oCAHW,GAAG,EAAE,GACH,UAAU,CAStB;kBArBY,OAAO,cAAc,EAAE,GAAG;oBAC1B,OAAO,OAAO,EAAE,KAAK;yBACrB,OAAO,UAAU,EAAE,UAAU;qCAC7B,OAAO,UAAU,EAAE,sBAAsB,CAAC,UAAU,CAAC;AAoBlE;;;GAGG;AACH,8FAFa,UAAU,CA4CtB"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"header-validator.d.ts","sourceRoot":"","sources":["../../src/header-validator.js"],"names":[],"mappings":";IAkC4B,gCAAwB;IAwFxB,yCAAwB"}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { CarReader } from './reader-browser.js';
|
|
2
|
-
import { CarIndexer } from './indexer.js';
|
|
3
|
-
import { CarBlockIterator } from './iterator.js';
|
|
4
|
-
import { CarCIDIterator } from './iterator.js';
|
|
5
|
-
import { CarWriter } from './writer-browser.js';
|
|
6
|
-
import { CarIndexedReader } from './indexed-reader-browser.js';
|
|
7
|
-
import { CarBufferReader } from './buffer-reader.js';
|
|
8
|
-
import * as CarBufferWriter from './buffer-writer.js';
|
|
9
|
-
export { CarReader, CarIndexer, CarBlockIterator, CarCIDIterator, CarWriter, CarIndexedReader, CarBufferReader, CarBufferWriter };
|
|
10
|
-
//# sourceMappingURL=index-browser.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index-browser.d.ts","sourceRoot":"","sources":["../../src/index-browser.js"],"names":[],"mappings":"0BAK0B,qBAAqB;2BAFpB,cAAc;iCACQ,eAAe;+BAAf,eAAe;0BAEtC,qBAAqB;iCAJd,6BAA6B;gCAF9B,oBAAoB;iCACnB,oBAAoB"}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
export const contentType: "application/vnd.ipld.car";
|
|
2
|
-
import { CarReader } from './reader.js';
|
|
3
|
-
import { CarBufferReader } from './buffer-reader.js';
|
|
4
|
-
import { CarIndexer } from './indexer.js';
|
|
5
|
-
import { CarBlockIterator } from './iterator.js';
|
|
6
|
-
import { CarCIDIterator } from './iterator.js';
|
|
7
|
-
import { CarWriter } from './writer.js';
|
|
8
|
-
import { CarIndexedReader } from './indexed-reader.js';
|
|
9
|
-
import * as CarBufferWriter from './buffer-writer.js';
|
|
10
|
-
export { CarReader, CarBufferReader, CarIndexer, CarBlockIterator, CarCIDIterator, CarWriter, CarIndexedReader, CarBufferWriter };
|
|
11
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.js"],"names":[],"mappings":"AASA,qDAAqD;0BAJ3B,aAAa;gCALP,oBAAoB;2BAGzB,cAAc;iCACQ,eAAe;+BAAf,eAAe;0BAEtC,aAAa;iCAJN,qBAAqB;iCADrB,oBAAoB"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"indexed-reader-browser.d.ts","sourceRoot":"","sources":["../../src/indexed-reader-browser.js"],"names":[],"mappings":"AAAA;IACE,iCAEC;CACF;AAED,6BAA6B"}
|
|
@@ -1,152 +0,0 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
|
-
/**
|
|
3
|
-
* @typedef {import('fs').promises.FileHandle} FileHandle
|
|
4
|
-
* @typedef {import('./api').Block} Block
|
|
5
|
-
* @typedef {import('./api').BlockIndex} BlockIndex
|
|
6
|
-
* @typedef {import('./api').CarReader} CarReaderIface
|
|
7
|
-
* @typedef {import('./reader-browser').CarReader} CarReader
|
|
8
|
-
* @typedef {{ blockLength:number, blockOffset:number }} RawLocation
|
|
9
|
-
*/
|
|
10
|
-
/**
|
|
11
|
-
* A form of {@link CarReader} that pre-indexes a CAR archive from a file and
|
|
12
|
-
* provides random access to blocks within the file using the index data. This
|
|
13
|
-
* function is **only available in Node.js** and not a browser environment.
|
|
14
|
-
*
|
|
15
|
-
* For large CAR files, using this form of `CarReader` can be singificantly more
|
|
16
|
-
* efficient in terms of memory. The index consists of a list of `CID`s and
|
|
17
|
-
* their location within the archive (see {@link CarIndexer}). For large numbers
|
|
18
|
-
* of blocks, this index can also occupy a significant amount of memory. In some
|
|
19
|
-
* cases it may be necessary to expand the memory capacity of a Node.js instance
|
|
20
|
-
* to allow this index to fit. (e.g. by running with
|
|
21
|
-
* `NODE_OPTIONS="--max-old-space-size=16384"`).
|
|
22
|
-
*
|
|
23
|
-
* As an `CarIndexedReader` instance maintains an open file descriptor for its
|
|
24
|
-
* CAR file, an additional {@link CarReader#close} method is attached. This
|
|
25
|
-
* _must_ be called to have full clean-up of resources after use.
|
|
26
|
-
*
|
|
27
|
-
* Load this class with either
|
|
28
|
-
* `import { CarIndexedReader } from '@ipld/car/indexed-reader'`
|
|
29
|
-
* (`const { CarIndexedReader } = require('@ipld/car/indexed-reader')`). Or
|
|
30
|
-
* `import { CarIndexedReader } from '@ipld/car'`
|
|
31
|
-
* (`const { CarIndexedReader } = require('@ipld/car')`). The former will likely
|
|
32
|
-
* result in smaller bundle sizes where this is important.
|
|
33
|
-
*
|
|
34
|
-
* @name CarIndexedReader
|
|
35
|
-
* @class
|
|
36
|
-
* @implements {CarReaderIface}
|
|
37
|
-
* @extends {CarReader}
|
|
38
|
-
* @property {number} version The version number of the CAR referenced by this
|
|
39
|
-
* reader (should be `1`).
|
|
40
|
-
*/
|
|
41
|
-
export class CarIndexedReader implements CarReaderIface {
|
|
42
|
-
/**
|
|
43
|
-
* Instantiate an {@link CarIndexedReader} from a file with the provided
|
|
44
|
-
* `path`. The CAR file is first indexed with a full path that collects `CID`s
|
|
45
|
-
* and block locations. This index is maintained in memory. Subsequent reads
|
|
46
|
-
* operate on a read-only file descriptor, fetching the block from its in-file
|
|
47
|
-
* location.
|
|
48
|
-
*
|
|
49
|
-
* For large archives, the initial indexing may take some time. The returned
|
|
50
|
-
* `Promise` will resolve only after this is complete.
|
|
51
|
-
*
|
|
52
|
-
* @async
|
|
53
|
-
* @static
|
|
54
|
-
* @memberof CarIndexedReader
|
|
55
|
-
* @param {string} path
|
|
56
|
-
* @returns {Promise<CarIndexedReader>}
|
|
57
|
-
*/
|
|
58
|
-
static fromFile(path: string): Promise<CarIndexedReader>;
|
|
59
|
-
/**
|
|
60
|
-
* @param {number} version
|
|
61
|
-
* @param {string} path
|
|
62
|
-
* @param {CID[]} roots
|
|
63
|
-
* @param {Map<string, RawLocation>} index
|
|
64
|
-
* @param {string[]} order
|
|
65
|
-
*/
|
|
66
|
-
constructor(version: number, path: string, roots: CID[], index: Map<string, RawLocation>, order: string[]);
|
|
67
|
-
_version: number;
|
|
68
|
-
_path: string;
|
|
69
|
-
_roots: CID<any, number, number, import("multiformats/cid").Version>[];
|
|
70
|
-
_index: Map<string, RawLocation>;
|
|
71
|
-
_order: string[];
|
|
72
|
-
_fd: fs.promises.FileHandle | null;
|
|
73
|
-
get version(): number;
|
|
74
|
-
/**
|
|
75
|
-
* See {@link CarReader#getRoots}
|
|
76
|
-
*
|
|
77
|
-
* @function
|
|
78
|
-
* @memberof CarIndexedReader
|
|
79
|
-
* @instance
|
|
80
|
-
* @async
|
|
81
|
-
* @returns {Promise<CID[]>}
|
|
82
|
-
*/
|
|
83
|
-
getRoots(): Promise<CID[]>;
|
|
84
|
-
/**
|
|
85
|
-
* See {@link CarReader#has}
|
|
86
|
-
*
|
|
87
|
-
* @function
|
|
88
|
-
* @memberof CarIndexedReader
|
|
89
|
-
* @instance
|
|
90
|
-
* @async
|
|
91
|
-
* @param {CID} key
|
|
92
|
-
* @returns {Promise<boolean>}
|
|
93
|
-
*/
|
|
94
|
-
has(key: CID): Promise<boolean>;
|
|
95
|
-
/**
|
|
96
|
-
* See {@link CarReader#get}
|
|
97
|
-
*
|
|
98
|
-
* @function
|
|
99
|
-
* @memberof CarIndexedReader
|
|
100
|
-
* @instance
|
|
101
|
-
* @async
|
|
102
|
-
* @param {CID} key
|
|
103
|
-
* @returns {Promise<Block | undefined>}
|
|
104
|
-
*/
|
|
105
|
-
get(key: CID): Promise<Block | undefined>;
|
|
106
|
-
/**
|
|
107
|
-
* See {@link CarReader#blocks}
|
|
108
|
-
*
|
|
109
|
-
* @function
|
|
110
|
-
* @memberof CarIndexedReader
|
|
111
|
-
* @instance
|
|
112
|
-
* @async
|
|
113
|
-
* @generator
|
|
114
|
-
* @returns {AsyncGenerator<Block>}
|
|
115
|
-
*/
|
|
116
|
-
blocks(): AsyncGenerator<Block>;
|
|
117
|
-
/**
|
|
118
|
-
* See {@link CarReader#cids}
|
|
119
|
-
*
|
|
120
|
-
* @function
|
|
121
|
-
* @memberof CarIndexedReader
|
|
122
|
-
* @instance
|
|
123
|
-
* @async
|
|
124
|
-
* @generator
|
|
125
|
-
* @returns {AsyncGenerator<CID>}
|
|
126
|
-
*/
|
|
127
|
-
cids(): AsyncGenerator<CID>;
|
|
128
|
-
/**
|
|
129
|
-
* Close the underlying file descriptor maintained by this `CarIndexedReader`.
|
|
130
|
-
* This must be called for proper resource clean-up to occur.
|
|
131
|
-
*
|
|
132
|
-
* @function
|
|
133
|
-
* @memberof CarIndexedReader
|
|
134
|
-
* @instance
|
|
135
|
-
* @async
|
|
136
|
-
* @returns {Promise<void>}
|
|
137
|
-
*/
|
|
138
|
-
close(): Promise<void>;
|
|
139
|
-
}
|
|
140
|
-
export const __browser: false;
|
|
141
|
-
export type FileHandle = import('fs').promises.FileHandle;
|
|
142
|
-
export type Block = import('./api').Block;
|
|
143
|
-
export type BlockIndex = import('./api').BlockIndex;
|
|
144
|
-
export type CarReaderIface = import('./api').CarReader;
|
|
145
|
-
export type CarReader = import('./reader-browser').CarReader;
|
|
146
|
-
export type RawLocation = {
|
|
147
|
-
blockLength: number;
|
|
148
|
-
blockOffset: number;
|
|
149
|
-
};
|
|
150
|
-
import { CID } from 'multiformats/cid';
|
|
151
|
-
import fs from 'fs';
|
|
152
|
-
//# sourceMappingURL=indexed-reader.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"indexed-reader.d.ts","sourceRoot":"","sources":["../../src/indexed-reader.js"],"names":[],"mappings":";AAMA;;;;;;;GAOG;AAEH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH;IAiIE;;;;;;;;;;;;;;;OAeG;IACH,sBAHW,MAAM,GACJ,QAAQ,gBAAgB,CAAC,CAkBrC;IAhKD;;;;;;OAMG;IACH,qBANW,MAAM,QACN,MAAM,SACN,GAAG,EAAE,SACL,IAAI,MAAM,EAAE,WAAW,CAAC,SACxB,MAAM,EAAE,EASlB;IANC,iBAAuB;IACvB,cAAiB;IACjB,uEAAmB;IACnB,iCAAmB;IACnB,iBAAmB;IACnB,mCAAe;IAGjB,sBAEC;IAED;;;;;;;;OAQG;IACH,YAFa,QAAQ,GAAG,EAAE,CAAC,CAI1B;IAED;;;;;;;;;OASG;IACH,SAHW,GAAG,GACD,QAAQ,OAAO,CAAC,CAI5B;IAED;;;;;;;;;OASG;IACH,SAHW,GAAG,GACD,QAAQ,KAAK,GAAG,SAAS,CAAC,CAkBtC;IAED;;;;;;;;;OASG;IACH,UAFa,eAAe,KAAK,CAAC,CAWjC;IAED;;;;;;;;;OASG;IACH,QAFa,eAAe,GAAG,CAAC,CAM/B;IAED;;;;;;;;;OASG;IACH,SAFa,QAAQ,IAAI,CAAC,CAMzB;CAmCF;AAED,8BAA8B;yBA3MjB,OAAO,IAAI,EAAE,QAAQ,CAAC,UAAU;oBAChC,OAAO,OAAO,EAAE,KAAK;yBACrB,OAAO,OAAO,EAAE,UAAU;6BAC1B,OAAO,OAAO,EAAE,SAAS;wBACzB,OAAO,kBAAkB,EAAE,SAAS;0BACpC;IAAE,WAAW,EAAC,MAAM,CAAC;IAAC,WAAW,EAAC,MAAM,CAAA;CAAE;oBAVnC,kBAAkB;eAFvB,IAAI"}
|
|
@@ -1,95 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @typedef {import('multiformats').CID} CID
|
|
3
|
-
* @typedef {import('./api').Block} Block
|
|
4
|
-
* @typedef {import('./api').RootsReader} RootsReader
|
|
5
|
-
* @typedef {import('./api').BlockIndex} BlockIndex
|
|
6
|
-
* @typedef {import('./coding').BytesReader} BytesReader
|
|
7
|
-
*/
|
|
8
|
-
/**
|
|
9
|
-
* Provides an iterator over all of the `Block`s in a CAR, returning their CIDs
|
|
10
|
-
* and byte-location information. Implements an `AsyncIterable<BlockIndex>`.
|
|
11
|
-
* Where a `BlockIndex` is a
|
|
12
|
-
* `{ cid:CID, length:number, offset:number, blockLength:number, blockOffset:number }`.
|
|
13
|
-
*
|
|
14
|
-
* As an implementer of `AsyncIterable`, this class can be used directly in a
|
|
15
|
-
* `for await (const blockIndex of iterator) {}` loop. Where the `iterator` is
|
|
16
|
-
* constructed using {@link CarIndexer.fromBytes} or
|
|
17
|
-
* {@link CarIndexer.fromIterable}.
|
|
18
|
-
*
|
|
19
|
-
* An iteration can only be performce _once_ per instantiation.
|
|
20
|
-
*
|
|
21
|
-
* `CarIndexer` also implements the `RootsReader` interface and provides
|
|
22
|
-
* the {@link CarIndexer.getRoots `getRoots()`} method.
|
|
23
|
-
*
|
|
24
|
-
* Load this class with either
|
|
25
|
-
* `import { CarIndexer } from '@ipld/car/indexer'`
|
|
26
|
-
* (`const { CarIndexer } = require('@ipld/car/indexer')`). Or
|
|
27
|
-
* `import { CarIndexer } from '@ipld/car'`
|
|
28
|
-
* (`const { CarIndexer } = require('@ipld/car')`). The former will likely
|
|
29
|
-
* result in smaller bundle sizes where this is important.
|
|
30
|
-
*
|
|
31
|
-
* @name CarIndexer
|
|
32
|
-
* @class
|
|
33
|
-
* @implements {RootsReader}
|
|
34
|
-
* @implements {AsyncIterable<BlockIndex>}
|
|
35
|
-
* @property {number} version The version number of the CAR referenced by this
|
|
36
|
-
* reader (should be `1`).
|
|
37
|
-
*/
|
|
38
|
-
export class CarIndexer implements RootsReader, AsyncIterable<BlockIndex> {
|
|
39
|
-
/**
|
|
40
|
-
* Instantiate a {@link CarIndexer} from a `Uint8Array` blob. Only the header
|
|
41
|
-
* is decoded initially, the remainder is processed and emitted via the
|
|
42
|
-
* iterator as it is consumed.
|
|
43
|
-
*
|
|
44
|
-
* @async
|
|
45
|
-
* @static
|
|
46
|
-
* @memberof CarIndexer
|
|
47
|
-
* @param {Uint8Array} bytes
|
|
48
|
-
* @returns {Promise<CarIndexer>}
|
|
49
|
-
*/
|
|
50
|
-
static fromBytes(bytes: Uint8Array): Promise<CarIndexer>;
|
|
51
|
-
/**
|
|
52
|
-
* Instantiate a {@link CarIndexer} from a `AsyncIterable<Uint8Array>`,
|
|
53
|
-
* such as a [modern Node.js stream](https://nodejs.org/api/stream.html#stream_streams_compatibility_with_async_generators_and_async_iterators).
|
|
54
|
-
* is decoded initially, the remainder is processed and emitted via the
|
|
55
|
-
* iterator as it is consumed.
|
|
56
|
-
*
|
|
57
|
-
* @async
|
|
58
|
-
* @static
|
|
59
|
-
* @memberof CarIndexer
|
|
60
|
-
* @param {AsyncIterable<Uint8Array>} asyncIterable
|
|
61
|
-
* @returns {Promise<CarIndexer>}
|
|
62
|
-
*/
|
|
63
|
-
static fromIterable(asyncIterable: AsyncIterable<Uint8Array>): Promise<CarIndexer>;
|
|
64
|
-
/**
|
|
65
|
-
* @param {number} version
|
|
66
|
-
* @param {CID[]} roots
|
|
67
|
-
* @param {AsyncGenerator<BlockIndex>} iterator
|
|
68
|
-
*/
|
|
69
|
-
constructor(version: number, roots: CID[], iterator: AsyncGenerator<BlockIndex>);
|
|
70
|
-
_version: number;
|
|
71
|
-
_roots: import("multiformats").CID<any, number, number, import("multiformats").Version>[];
|
|
72
|
-
_iterator: AsyncGenerator<import("./api").BlockIndex, any, any>;
|
|
73
|
-
get version(): number;
|
|
74
|
-
/**
|
|
75
|
-
* Get the list of roots defined by the CAR referenced by this indexer. May be
|
|
76
|
-
* zero or more `CID`s.
|
|
77
|
-
*
|
|
78
|
-
* @function
|
|
79
|
-
* @memberof CarIndexer
|
|
80
|
-
* @instance
|
|
81
|
-
* @async
|
|
82
|
-
* @returns {Promise<CID[]>}
|
|
83
|
-
*/
|
|
84
|
-
getRoots(): Promise<CID[]>;
|
|
85
|
-
/**
|
|
86
|
-
* @returns {AsyncIterator<BlockIndex>}
|
|
87
|
-
*/
|
|
88
|
-
[Symbol.asyncIterator](): AsyncIterator<BlockIndex>;
|
|
89
|
-
}
|
|
90
|
-
export type CID = import('multiformats').CID;
|
|
91
|
-
export type Block = import('./api').Block;
|
|
92
|
-
export type RootsReader = import('./api').RootsReader;
|
|
93
|
-
export type BlockIndex = import('./api').BlockIndex;
|
|
94
|
-
export type BytesReader = import('./coding').BytesReader;
|
|
95
|
-
//# sourceMappingURL=indexer.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"indexer.d.ts","sourceRoot":"","sources":["../../src/indexer.js"],"names":[],"mappings":"AAMA;;;;;;GAMG;AAEH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,8DAJ8B,UAAU;IAyCtC;;;;;;;;;;OAUG;IACH,wBAHW,UAAU,GACR,QAAQ,UAAU,CAAC,CAO/B;IAED;;;;;;;;;;;OAWG;IACH,mCAHW,cAAc,UAAU,CAAC,GACvB,QAAQ,UAAU,CAAC,CAO/B;IAvED;;;;OAIG;IACH,qBAJW,MAAM,SACN,GAAG,EAAE,YACL,eAAe,UAAU,CAAC,EAMpC;IAHC,iBAAuB;IACvB,0FAAmB;IACnB,gEAAyB;IAG3B,sBAEC;IAED;;;;;;;;;OASG;IACH,YAFa,QAAQ,GAAG,EAAE,CAAC,CAI1B;IAED;;OAEG;IACH,0BAFa,cAAc,UAAU,CAAC,CAIrC;CAsCF;kBA9GY,OAAO,cAAc,EAAE,GAAG;oBAC1B,OAAO,OAAO,EAAE,KAAK;0BACrB,OAAO,OAAO,EAAE,WAAW;yBAC3B,OAAO,OAAO,EAAE,UAAU;0BAC1B,OAAO,UAAU,EAAE,WAAW"}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @template {any} T
|
|
3
|
-
* @returns {IteratorChannel<T>}
|
|
4
|
-
*/
|
|
5
|
-
export function create<T extends unknown>(): import("./coding").IteratorChannel<T>;
|
|
6
|
-
export type IteratorChannel<T extends unknown> = import('./coding').IteratorChannel<T>;
|
|
7
|
-
//# sourceMappingURL=iterator-channel.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"iterator-channel.d.ts","sourceRoot":"","sources":["../../src/iterator-channel.js"],"names":[],"mappings":"AAOA;;;GAGG;AACH,mFA+EC;iDAxFY,OAAO,UAAU,EAAE,eAAe,CAAC,CAAC,CAAC"}
|
|
@@ -1,174 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @typedef {import('multiformats').CID} CID
|
|
3
|
-
* @typedef {import('./api').Block} Block
|
|
4
|
-
* @typedef {import('./api').RootsReader} RootsReader
|
|
5
|
-
* @typedef {import('./coding').BytesReader} BytesReader
|
|
6
|
-
*/
|
|
7
|
-
/**
|
|
8
|
-
* @class
|
|
9
|
-
* @implements {RootsReader}
|
|
10
|
-
* @property {number} version The version number of the CAR referenced by this reader (should be `1`).
|
|
11
|
-
*/
|
|
12
|
-
export class CarIteratorBase implements RootsReader {
|
|
13
|
-
/**
|
|
14
|
-
* @param {number} version
|
|
15
|
-
* @param {CID[]} roots
|
|
16
|
-
* @param {AsyncIterable<Block>|void} iterable
|
|
17
|
-
*/
|
|
18
|
-
constructor(version: number, roots: CID[], iterable: AsyncIterable<Block> | void);
|
|
19
|
-
_version: number;
|
|
20
|
-
_roots: import("multiformats").CID<any, number, number, import("multiformats").Version>[];
|
|
21
|
-
_iterable: void | AsyncIterable<import("./api").Block>;
|
|
22
|
-
_decoded: boolean;
|
|
23
|
-
get version(): number;
|
|
24
|
-
/**
|
|
25
|
-
* @returns {Promise<CID[]>}
|
|
26
|
-
*/
|
|
27
|
-
getRoots(): Promise<CID[]>;
|
|
28
|
-
}
|
|
29
|
-
/**
|
|
30
|
-
* Provides an iterator over all of the `Block`s in a CAR. Implements a
|
|
31
|
-
* `BlockIterator` interface, or `AsyncIterable<Block>`. Where a `Block` is
|
|
32
|
-
* a `{ cid:CID, bytes:Uint8Array }` pair.
|
|
33
|
-
*
|
|
34
|
-
* As an implementer of `AsyncIterable`, this class can be used directly in a
|
|
35
|
-
* `for await (const block of iterator) {}` loop. Where the `iterator` is
|
|
36
|
-
* constructed using {@link CarBlockiterator.fromBytes} or
|
|
37
|
-
* {@link CarBlockiterator.fromIterable}.
|
|
38
|
-
*
|
|
39
|
-
* An iteration can only be performce _once_ per instantiation.
|
|
40
|
-
*
|
|
41
|
-
* `CarBlockIterator` also implements the `RootsReader` interface and provides
|
|
42
|
-
* the {@link CarBlockiterator.getRoots `getRoots()`} method.
|
|
43
|
-
*
|
|
44
|
-
* Load this class with either
|
|
45
|
-
* `import { CarBlockIterator } from '@ipld/car/iterator'`
|
|
46
|
-
* (`const { CarBlockIterator } = require('@ipld/car/iterator')`). Or
|
|
47
|
-
* `import { CarBlockIterator } from '@ipld/car'`
|
|
48
|
-
* (`const { CarBlockIterator } = require('@ipld/car')`).
|
|
49
|
-
*
|
|
50
|
-
* @name CarBlockIterator
|
|
51
|
-
* @class
|
|
52
|
-
* @implements {RootsReader}
|
|
53
|
-
* @implements {AsyncIterable<Block>}
|
|
54
|
-
* @property {number} version The version number of the CAR referenced by this
|
|
55
|
-
* iterator (should be `1`).
|
|
56
|
-
*/
|
|
57
|
-
export class CarBlockIterator extends CarIteratorBase implements RootsReader, AsyncIterable<Block> {
|
|
58
|
-
/**
|
|
59
|
-
* Instantiate a {@link CarBlockIterator} from a `Uint8Array` blob. Rather
|
|
60
|
-
* than decoding the entire byte array prior to returning the iterator, as in
|
|
61
|
-
* {@link CarReader.fromBytes}, only the header is decoded and the remainder
|
|
62
|
-
* of the CAR is parsed as the `Block`s as yielded.
|
|
63
|
-
*
|
|
64
|
-
* @async
|
|
65
|
-
* @static
|
|
66
|
-
* @memberof CarBlockIterator
|
|
67
|
-
* @param {Uint8Array} bytes
|
|
68
|
-
* @returns {Promise<CarBlockIterator>}
|
|
69
|
-
*/
|
|
70
|
-
static fromBytes(bytes: Uint8Array): Promise<CarBlockIterator>;
|
|
71
|
-
/**
|
|
72
|
-
* Instantiate a {@link CarBlockIterator} from a `AsyncIterable<Uint8Array>`,
|
|
73
|
-
* such as a [modern Node.js stream](https://nodejs.org/api/stream.html#stream_streams_compatibility_with_async_generators_and_async_iterators).
|
|
74
|
-
* Rather than decoding the entire byte array prior to returning the iterator,
|
|
75
|
-
* as in {@link CarReader.fromIterable}, only the header is decoded and the
|
|
76
|
-
* remainder of the CAR is parsed as the `Block`s as yielded.
|
|
77
|
-
*
|
|
78
|
-
* @async
|
|
79
|
-
* @static
|
|
80
|
-
* @param {AsyncIterable<Uint8Array>} asyncIterable
|
|
81
|
-
* @returns {Promise<CarBlockIterator>}
|
|
82
|
-
*/
|
|
83
|
-
static fromIterable(asyncIterable: AsyncIterable<Uint8Array>): Promise<CarBlockIterator>;
|
|
84
|
-
/**
|
|
85
|
-
* Get the list of roots defined by the CAR referenced by this iterator. May be
|
|
86
|
-
* zero or more `CID`s.
|
|
87
|
-
*
|
|
88
|
-
* @function getRoots
|
|
89
|
-
* @memberof CarBlockIterator
|
|
90
|
-
* @instance
|
|
91
|
-
* @async
|
|
92
|
-
* @returns {Promise<CID[]>}
|
|
93
|
-
*/
|
|
94
|
-
/**
|
|
95
|
-
* @returns {AsyncIterator<Block>}
|
|
96
|
-
*/
|
|
97
|
-
[Symbol.asyncIterator](): AsyncIterator<Block>;
|
|
98
|
-
}
|
|
99
|
-
/**
|
|
100
|
-
* Provides an iterator over all of the `CID`s in a CAR. Implements a
|
|
101
|
-
* `CIDIterator` interface, or `AsyncIterable<CID>`. Similar to
|
|
102
|
-
* {@link CarBlockIterator} but only yields the CIDs in the CAR.
|
|
103
|
-
*
|
|
104
|
-
* As an implementer of `AsyncIterable`, this class can be used directly in a
|
|
105
|
-
* `for await (const cid of iterator) {}` loop. Where the `iterator` is
|
|
106
|
-
* constructed using {@link CarCIDiterator.fromBytes} or
|
|
107
|
-
* {@link CarCIDiterator.fromIterable}.
|
|
108
|
-
*
|
|
109
|
-
* An iteration can only be performce _once_ per instantiation.
|
|
110
|
-
*
|
|
111
|
-
* `CarCIDIterator` also implements the `RootsReader` interface and provides
|
|
112
|
-
* the {@link CarCIDiterator.getRoots `getRoots()`} method.
|
|
113
|
-
*
|
|
114
|
-
* Load this class with either
|
|
115
|
-
* `import { CarCIDIterator } from '@ipld/car/iterator'`
|
|
116
|
-
* (`const { CarCIDIterator } = require('@ipld/car/iterator')`). Or
|
|
117
|
-
* `import { CarCIDIterator } from '@ipld/car'`
|
|
118
|
-
* (`const { CarCIDIterator } = require('@ipld/car')`).
|
|
119
|
-
*
|
|
120
|
-
* @name CarCIDIterator
|
|
121
|
-
* @class
|
|
122
|
-
* @implements {RootsReader}
|
|
123
|
-
* @implements {AsyncIterable<CID>}
|
|
124
|
-
* @property {number} version The version number of the CAR referenced by this
|
|
125
|
-
* iterator (should be `1`).
|
|
126
|
-
*/
|
|
127
|
-
export class CarCIDIterator extends CarIteratorBase implements RootsReader, AsyncIterable<CID> {
|
|
128
|
-
/**
|
|
129
|
-
* Instantiate a {@link CarCIDIterator} from a `Uint8Array` blob. Rather
|
|
130
|
-
* than decoding the entire byte array prior to returning the iterator, as in
|
|
131
|
-
* {@link CarReader.fromBytes}, only the header is decoded and the remainder
|
|
132
|
-
* of the CAR is parsed as the `CID`s as yielded.
|
|
133
|
-
*
|
|
134
|
-
* @async
|
|
135
|
-
* @static
|
|
136
|
-
* @memberof CarCIDIterator
|
|
137
|
-
* @param {Uint8Array} bytes
|
|
138
|
-
* @returns {Promise<CarCIDIterator>}
|
|
139
|
-
*/
|
|
140
|
-
static fromBytes(bytes: Uint8Array): Promise<CarCIDIterator>;
|
|
141
|
-
/**
|
|
142
|
-
* Instantiate a {@link CarCIDIterator} from a `AsyncIterable<Uint8Array>`,
|
|
143
|
-
* such as a [modern Node.js stream](https://nodejs.org/api/stream.html#stream_streams_compatibility_with_async_generators_and_async_iterators).
|
|
144
|
-
* Rather than decoding the entire byte array prior to returning the iterator,
|
|
145
|
-
* as in {@link CarReader.fromIterable}, only the header is decoded and the
|
|
146
|
-
* remainder of the CAR is parsed as the `CID`s as yielded.
|
|
147
|
-
*
|
|
148
|
-
* @async
|
|
149
|
-
* @static
|
|
150
|
-
* @memberof CarCIDIterator
|
|
151
|
-
* @param {AsyncIterable<Uint8Array>} asyncIterable
|
|
152
|
-
* @returns {Promise<CarCIDIterator>}
|
|
153
|
-
*/
|
|
154
|
-
static fromIterable(asyncIterable: AsyncIterable<Uint8Array>): Promise<CarCIDIterator>;
|
|
155
|
-
/**
|
|
156
|
-
* Get the list of roots defined by the CAR referenced by this iterator. May be
|
|
157
|
-
* zero or more `CID`s.
|
|
158
|
-
*
|
|
159
|
-
* @function getRoots
|
|
160
|
-
* @memberof CarCIDIterator
|
|
161
|
-
* @instance
|
|
162
|
-
* @async
|
|
163
|
-
* @returns {Promise<CID[]>}
|
|
164
|
-
*/
|
|
165
|
-
/**
|
|
166
|
-
* @returns {AsyncIterator<CID>}
|
|
167
|
-
*/
|
|
168
|
-
[Symbol.asyncIterator](): AsyncIterator<CID>;
|
|
169
|
-
}
|
|
170
|
-
export type CID = import('multiformats').CID;
|
|
171
|
-
export type Block = import('./api').Block;
|
|
172
|
-
export type RootsReader = import('./api').RootsReader;
|
|
173
|
-
export type BytesReader = import('./coding').BytesReader;
|
|
174
|
-
//# sourceMappingURL=iterator.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"iterator.d.ts","sourceRoot":"","sources":["../../src/iterator.js"],"names":[],"mappings":"AAMA;;;;;GAKG;AAEH;;;;GAIG;AACH;IACE;;;;OAIG;IACH,qBAJW,MAAM,SACN,GAAG,EAAE,YACL,cAAc,KAAK,CAAC,GAAC,IAAI,EAOnC;IAJC,iBAAuB;IACvB,0FAAmB;IACnB,uDAAyB;IACzB,kBAAqB;IAGvB,sBAEC;IAED;;OAEG;IACH,YAFa,QAAQ,GAAG,EAAE,CAAC,CAI1B;CACF;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,4FAJ8B,KAAK;IAgCjC;;;;;;;;;;;OAWG;IACH,wBAHW,UAAU,GACR,QAAQ,gBAAgB,CAAC,CAKrC;IAED;;;;;;;;;;;OAWG;IACH,mCAHW,cAAc,UAAU,CAAC,GACvB,QAAQ,gBAAgB,CAAC,CAKrC;IA1DD;;;;;;;;;OASG;IAEH;;OAEG;IACH,0BAFa,cAAc,KAAK,CAAC,CAYhC;CAmCF;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,0FAJ8B,GAAG;IAyC/B;;;;;;;;;;;OAWG;IACH,wBAHW,UAAU,GACR,QAAQ,cAAc,CAAC,CAKnC;IAED;;;;;;;;;;;;OAYG;IACH,mCAHW,cAAc,UAAU,CAAC,GACvB,QAAQ,cAAc,CAAC,CAKnC;IApED;;;;;;;;;OASG;IAEH;;OAEG;IACH,0BAFa,cAAc,GAAG,CAAC,CAqB9B;CAoCF;kBAlOY,OAAO,cAAc,EAAE,GAAG;oBAC1B,OAAO,OAAO,EAAE,KAAK;0BACrB,OAAO,OAAO,EAAE,WAAW;0BAC3B,OAAO,UAAU,EAAE,WAAW"}
|