@fireproof/vendor 2.0.1 → 3.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.
Files changed (59) hide show
  1. package/package.json +6 -59
  2. package/src/p-limit/index.d.ts +81 -0
  3. package/src/p-limit/index.js +104 -0
  4. package/src/p-limit/license +9 -0
  5. package/src/p-limit/readme.md +129 -0
  6. package/src/@web3-storage/pail/LICENSE.md +0 -232
  7. package/src/@web3-storage/pail/README.md +0 -84
  8. package/src/@web3-storage/pail/cli.js +0 -218
  9. package/src/@web3-storage/pail/dist/src/api.d.ts +0 -59
  10. package/src/@web3-storage/pail/dist/src/api.d.ts.map +0 -1
  11. package/src/@web3-storage/pail/dist/src/batch/api.d.ts +0 -31
  12. package/src/@web3-storage/pail/dist/src/batch/api.d.ts.map +0 -1
  13. package/src/@web3-storage/pail/dist/src/batch/index.d.ts +0 -23
  14. package/src/@web3-storage/pail/dist/src/batch/index.d.ts.map +0 -1
  15. package/src/@web3-storage/pail/dist/src/batch/shard.d.ts +0 -3
  16. package/src/@web3-storage/pail/dist/src/batch/shard.d.ts.map +0 -1
  17. package/src/@web3-storage/pail/dist/src/block.d.ts +0 -35
  18. package/src/@web3-storage/pail/dist/src/block.d.ts.map +0 -1
  19. package/src/@web3-storage/pail/dist/src/clock/api.d.ts +0 -10
  20. package/src/@web3-storage/pail/dist/src/clock/api.d.ts.map +0 -1
  21. package/src/@web3-storage/pail/dist/src/clock/index.d.ts +0 -48
  22. package/src/@web3-storage/pail/dist/src/clock/index.d.ts.map +0 -1
  23. package/src/@web3-storage/pail/dist/src/crdt/api.d.ts +0 -26
  24. package/src/@web3-storage/pail/dist/src/crdt/api.d.ts.map +0 -1
  25. package/src/@web3-storage/pail/dist/src/crdt/batch/api.d.ts +0 -11
  26. package/src/@web3-storage/pail/dist/src/crdt/batch/api.d.ts.map +0 -1
  27. package/src/@web3-storage/pail/dist/src/crdt/batch/index.d.ts +0 -5
  28. package/src/@web3-storage/pail/dist/src/crdt/batch/index.d.ts.map +0 -1
  29. package/src/@web3-storage/pail/dist/src/crdt/index.d.ts +0 -9
  30. package/src/@web3-storage/pail/dist/src/crdt/index.d.ts.map +0 -1
  31. package/src/@web3-storage/pail/dist/src/diff.d.ts +0 -13
  32. package/src/@web3-storage/pail/dist/src/diff.d.ts.map +0 -1
  33. package/src/@web3-storage/pail/dist/src/index.d.ts +0 -10
  34. package/src/@web3-storage/pail/dist/src/index.d.ts.map +0 -1
  35. package/src/@web3-storage/pail/dist/src/merge.d.ts +0 -5
  36. package/src/@web3-storage/pail/dist/src/merge.d.ts.map +0 -1
  37. package/src/@web3-storage/pail/dist/src/shard.d.ts +0 -43
  38. package/src/@web3-storage/pail/dist/src/shard.d.ts.map +0 -1
  39. package/src/@web3-storage/pail/dist/tsconfig.tsbuildinfo +0 -1
  40. package/src/@web3-storage/pail/src/api.js +0 -1
  41. package/src/@web3-storage/pail/src/api.ts +0 -90
  42. package/src/@web3-storage/pail/src/batch/api.js +0 -1
  43. package/src/@web3-storage/pail/src/batch/api.ts +0 -59
  44. package/src/@web3-storage/pail/src/batch/index.js +0 -258
  45. package/src/@web3-storage/pail/src/batch/shard.js +0 -13
  46. package/src/@web3-storage/pail/src/block.js +0 -75
  47. package/src/@web3-storage/pail/src/clock/api.js +0 -1
  48. package/src/@web3-storage/pail/src/clock/api.ts +0 -12
  49. package/src/@web3-storage/pail/src/clock/index.js +0 -182
  50. package/src/@web3-storage/pail/src/crdt/api.js +0 -1
  51. package/src/@web3-storage/pail/src/crdt/api.ts +0 -33
  52. package/src/@web3-storage/pail/src/crdt/batch/api.js +0 -1
  53. package/src/@web3-storage/pail/src/crdt/batch/api.ts +0 -30
  54. package/src/@web3-storage/pail/src/crdt/batch/index.js +0 -155
  55. package/src/@web3-storage/pail/src/crdt/index.js +0 -354
  56. package/src/@web3-storage/pail/src/diff.js +0 -151
  57. package/src/@web3-storage/pail/src/index.js +0 -406
  58. package/src/@web3-storage/pail/src/merge.js +0 -43
  59. package/src/@web3-storage/pail/src/shard.js +0 -180
@@ -1,10 +0,0 @@
1
- export function put(blocks: API.BlockFetcher, root: API.ShardLink, key: string, value: API.UnknownLink): Promise<{
2
- root: API.ShardLink;
3
- } & API.ShardDiff>;
4
- export function get(blocks: API.BlockFetcher, root: API.ShardLink, key: string): Promise<API.UnknownLink | undefined>;
5
- export function del(blocks: API.BlockFetcher, root: API.ShardLink, key: string): Promise<{
6
- root: API.ShardLink;
7
- } & API.ShardDiff>;
8
- export function entries(blocks: API.BlockFetcher, root: API.ShardLink, options?: API.EntriesOptions): AsyncIterableIterator<API.ShardValueEntry>;
9
- import * as API from './api.js';
10
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.js"],"names":[],"mappings":"AAeO,4BANI,GAAG,CAAC,YAAY,QAChB,GAAG,CAAC,SAAS,OACb,MAAM,SACN,GAAG,CAAC,WAAW,GACb,OAAO,CAAC;IAAE,IAAI,EAAE,GAAG,CAAC,SAAS,CAAA;CAAE,GAAG,GAAG,CAAC,SAAS,CAAC,CAkI5D;AAWM,4BALI,GAAG,CAAC,YAAY,QAChB,GAAG,CAAC,SAAS,OACb,MAAM,GACJ,OAAO,CAAC,GAAG,CAAC,WAAW,GAAG,SAAS,CAAC,CAWhD;AAWM,4BALI,GAAG,CAAC,YAAY,QAChB,GAAG,CAAC,SAAS,OACb,MAAM,GACJ,OAAO,CAAC;IAAE,IAAI,EAAE,GAAG,CAAC,SAAS,CAAA;CAAE,GAAG,GAAG,CAAC,SAAS,CAAC,CAoE5D;AAgEM,gCALI,GAAG,CAAC,YAAY,QAChB,GAAG,CAAC,SAAS,YACb,GAAG,CAAC,cAAc,GAChB,qBAAqB,CAAC,GAAG,CAAC,eAAe,CAAC,CA4EtD;qBAzXoB,UAAU"}
@@ -1,5 +0,0 @@
1
- export function merge(blocks: API.BlockFetcher, base: API.ShardLink, targets: API.ShardLink[]): Promise<{
2
- root: API.ShardLink;
3
- } & API.ShardDiff>;
4
- import * as API from './api.js';
5
- //# sourceMappingURL=merge.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"merge.d.ts","sourceRoot":"","sources":["../../src/merge.js"],"names":[],"mappings":"AAWO,8BALI,GAAG,CAAC,YAAY,QAChB,GAAG,CAAC,SAAS,WACb,GAAG,CAAC,SAAS,EAAE,GACb,OAAO,CAAC;IAAE,IAAI,EAAE,GAAG,CAAC,SAAS,CAAA;CAAE,GAAG,GAAG,CAAC,SAAS,CAAC,CAiC5D;qBAzCoB,UAAU"}
@@ -1,43 +0,0 @@
1
- export const KeyCharsASCII: "ascii";
2
- export const MaxKeySize: 4096;
3
- /**
4
- * @extends {Block<API.Shard, typeof dagCBOR.code, typeof sha256.code, 1>}
5
- * @implements {API.ShardBlockView}
6
- */
7
- export class ShardBlock extends Block<API.Shard, 113, 18, 1> implements API.ShardBlockView {
8
- /** @param {API.ShardOptions} [options] */
9
- static create(options?: API.ShardOptions): Promise<API.ShardBlockView>;
10
- /**
11
- * @param {object} config
12
- * @param {API.ShardLink} config.cid
13
- * @param {API.Shard} config.value
14
- * @param {Uint8Array} config.bytes
15
- */
16
- constructor({ cid, value, bytes }: {
17
- cid: API.ShardLink;
18
- value: API.Shard;
19
- bytes: Uint8Array;
20
- });
21
- }
22
- export function create(options?: API.ShardOptions): API.Shard;
23
- export function configure(options?: API.ShardOptions): API.ShardConfig;
24
- export function withEntries(entries: API.ShardEntry[], options?: API.ShardOptions): API.Shard;
25
- export function encodeBlock(value: API.Shard): Promise<API.ShardBlockView>;
26
- export function decodeBlock(bytes: Uint8Array): Promise<API.ShardBlockView>;
27
- export function isShard(value: any): value is API.Shard;
28
- export function isShardLink(value: any): value is API.ShardLink;
29
- export class ShardFetcher {
30
- /** @param {API.BlockFetcher} blocks */
31
- constructor(blocks: API.BlockFetcher);
32
- _blocks: API.BlockFetcher;
33
- /**
34
- * @param {API.ShardLink} link
35
- * @returns {Promise<API.ShardBlockView>}
36
- */
37
- get(link: API.ShardLink): Promise<API.ShardBlockView>;
38
- }
39
- export function putEntry(target: API.ShardEntry[], newEntry: API.ShardEntry): API.ShardEntry[];
40
- export function isPrintableASCII(s: string): boolean;
41
- import * as API from './api.js';
42
- import { Block } from 'multiformats/block';
43
- //# sourceMappingURL=shard.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"shard.d.ts","sourceRoot":"","sources":["../../src/shard.js"],"names":[],"mappings":"AAOA,4BAA6B,OAAO,CAAA;AACpC,yBAA0B,IAAI,CAAA;AAE9B;;;GAGG;AACH,wEAFgB,GAAG,CAAC,cAAc;IAchC,0CAA0C;IAC1C,wBADY,GAAG,CAAC,YAAY,+BAG3B;IAdD;;;;;OAKG;IACH,mCAJG;QAA8B,GAAG,EAAzB,GAAG,CAAC,SAAS;QACK,KAAK,EAAvB,GAAG,CAAC,KAAK;QACU,KAAK,EAAxB,UAAU;KACpB,EAIA;CAMF;AAMM,iCAHI,GAAG,CAAC,YAAY,GACd,GAAG,CAAC,KAAK,CAEqD;AAMpE,oCAHI,GAAG,CAAC,YAAY,GACd,GAAG,CAAC,WAAW,CAO1B;AAOK,qCAJI,GAAG,CAAC,UAAU,EAAE,YAChB,GAAG,CAAC,YAAY,GACd,GAAG,CAAC,KAAK,CAE4D;AAS3E,mCAHI,GAAG,CAAC,KAAK,GACP,OAAO,CAAC,GAAG,CAAC,cAAc,CAAC,CAOvC;AAMM,mCAHI,UAAU,GACR,OAAO,CAAC,GAAG,CAAC,cAAc,CAAC,CAQvC;AAMM,+BAHI,GAAG,GACD,KAAK,IAAI,GAAG,CAAC,KAAK,CASG;AAM3B,mCAHI,GAAG,GACD,KAAK,IAAI,GAAG,CAAC,SAAS,CAIN;AAE7B;IACE,uCAAuC;IACvC,oBADY,GAAG,CAAC,YAAY,EAG3B;IADC,0BAAqB;IAGvB;;;OAGG;IACH,UAHW,GAAG,CAAC,SAAS,GACX,OAAO,CAAC,GAAG,CAAC,cAAc,CAAC,CAMvC;CACF;AAOM,iCAJI,GAAG,CAAC,UAAU,EAAE,YAChB,GAAG,CAAC,UAAU,GACZ,GAAG,CAAC,UAAU,EAAE,CAqD5B;AAGM,oCADK,MAAM,WAC2C;qBA9KxC,UAAU;sBAJO,oBAAoB"}
@@ -1 +0,0 @@
1
- {"fileNames":["../node_modules/.pnpm/typescript@5.7.3/node_modules/typescript/lib/lib.es5.d.ts","../node_modules/.pnpm/typescript@5.7.3/node_modules/typescript/lib/lib.es2015.d.ts","../node_modules/.pnpm/typescript@5.7.3/node_modules/typescript/lib/lib.es2016.d.ts","../node_modules/.pnpm/typescript@5.7.3/node_modules/typescript/lib/lib.es2017.d.ts","../node_modules/.pnpm/typescript@5.7.3/node_modules/typescript/lib/lib.es2018.d.ts","../node_modules/.pnpm/typescript@5.7.3/node_modules/typescript/lib/lib.es2019.d.ts","../node_modules/.pnpm/typescript@5.7.3/node_modules/typescript/lib/lib.es2020.d.ts","../node_modules/.pnpm/typescript@5.7.3/node_modules/typescript/lib/lib.es2021.d.ts","../node_modules/.pnpm/typescript@5.7.3/node_modules/typescript/lib/lib.es2022.d.ts","../node_modules/.pnpm/typescript@5.7.3/node_modules/typescript/lib/lib.dom.d.ts","../node_modules/.pnpm/typescript@5.7.3/node_modules/typescript/lib/lib.dom.iterable.d.ts","../node_modules/.pnpm/typescript@5.7.3/node_modules/typescript/lib/lib.dom.asynciterable.d.ts","../node_modules/.pnpm/typescript@5.7.3/node_modules/typescript/lib/lib.webworker.importscripts.d.ts","../node_modules/.pnpm/typescript@5.7.3/node_modules/typescript/lib/lib.scripthost.d.ts","../node_modules/.pnpm/typescript@5.7.3/node_modules/typescript/lib/lib.es2015.core.d.ts","../node_modules/.pnpm/typescript@5.7.3/node_modules/typescript/lib/lib.es2015.collection.d.ts","../node_modules/.pnpm/typescript@5.7.3/node_modules/typescript/lib/lib.es2015.generator.d.ts","../node_modules/.pnpm/typescript@5.7.3/node_modules/typescript/lib/lib.es2015.iterable.d.ts","../node_modules/.pnpm/typescript@5.7.3/node_modules/typescript/lib/lib.es2015.promise.d.ts","../node_modules/.pnpm/typescript@5.7.3/node_modules/typescript/lib/lib.es2015.proxy.d.ts","../node_modules/.pnpm/typescript@5.7.3/node_modules/typescript/lib/lib.es2015.reflect.d.ts","../node_modules/.pnpm/typescript@5.7.3/node_modules/typescript/lib/lib.es2015.symbol.d.ts","../node_modules/.pnpm/typescript@5.7.3/node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts","../node_modules/.pnpm/typescript@5.7.3/node_modules/typescript/lib/lib.es2016.array.include.d.ts","../node_modules/.pnpm/typescript@5.7.3/node_modules/typescript/lib/lib.es2016.intl.d.ts","../node_modules/.pnpm/typescript@5.7.3/node_modules/typescript/lib/lib.es2017.arraybuffer.d.ts","../node_modules/.pnpm/typescript@5.7.3/node_modules/typescript/lib/lib.es2017.date.d.ts","../node_modules/.pnpm/typescript@5.7.3/node_modules/typescript/lib/lib.es2017.object.d.ts","../node_modules/.pnpm/typescript@5.7.3/node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts","../node_modules/.pnpm/typescript@5.7.3/node_modules/typescript/lib/lib.es2017.string.d.ts","../node_modules/.pnpm/typescript@5.7.3/node_modules/typescript/lib/lib.es2017.intl.d.ts","../node_modules/.pnpm/typescript@5.7.3/node_modules/typescript/lib/lib.es2017.typedarrays.d.ts","../node_modules/.pnpm/typescript@5.7.3/node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts","../node_modules/.pnpm/typescript@5.7.3/node_modules/typescript/lib/lib.es2018.asynciterable.d.ts","../node_modules/.pnpm/typescript@5.7.3/node_modules/typescript/lib/lib.es2018.intl.d.ts","../node_modules/.pnpm/typescript@5.7.3/node_modules/typescript/lib/lib.es2018.promise.d.ts","../node_modules/.pnpm/typescript@5.7.3/node_modules/typescript/lib/lib.es2018.regexp.d.ts","../node_modules/.pnpm/typescript@5.7.3/node_modules/typescript/lib/lib.es2019.array.d.ts","../node_modules/.pnpm/typescript@5.7.3/node_modules/typescript/lib/lib.es2019.object.d.ts","../node_modules/.pnpm/typescript@5.7.3/node_modules/typescript/lib/lib.es2019.string.d.ts","../node_modules/.pnpm/typescript@5.7.3/node_modules/typescript/lib/lib.es2019.symbol.d.ts","../node_modules/.pnpm/typescript@5.7.3/node_modules/typescript/lib/lib.es2019.intl.d.ts","../node_modules/.pnpm/typescript@5.7.3/node_modules/typescript/lib/lib.es2020.bigint.d.ts","../node_modules/.pnpm/typescript@5.7.3/node_modules/typescript/lib/lib.es2020.date.d.ts","../node_modules/.pnpm/typescript@5.7.3/node_modules/typescript/lib/lib.es2020.promise.d.ts","../node_modules/.pnpm/typescript@5.7.3/node_modules/typescript/lib/lib.es2020.sharedmemory.d.ts","../node_modules/.pnpm/typescript@5.7.3/node_modules/typescript/lib/lib.es2020.string.d.ts","../node_modules/.pnpm/typescript@5.7.3/node_modules/typescript/lib/lib.es2020.symbol.wellknown.d.ts","../node_modules/.pnpm/typescript@5.7.3/node_modules/typescript/lib/lib.es2020.intl.d.ts","../node_modules/.pnpm/typescript@5.7.3/node_modules/typescript/lib/lib.es2020.number.d.ts","../node_modules/.pnpm/typescript@5.7.3/node_modules/typescript/lib/lib.es2021.promise.d.ts","../node_modules/.pnpm/typescript@5.7.3/node_modules/typescript/lib/lib.es2021.string.d.ts","../node_modules/.pnpm/typescript@5.7.3/node_modules/typescript/lib/lib.es2021.weakref.d.ts","../node_modules/.pnpm/typescript@5.7.3/node_modules/typescript/lib/lib.es2021.intl.d.ts","../node_modules/.pnpm/typescript@5.7.3/node_modules/typescript/lib/lib.es2022.array.d.ts","../node_modules/.pnpm/typescript@5.7.3/node_modules/typescript/lib/lib.es2022.error.d.ts","../node_modules/.pnpm/typescript@5.7.3/node_modules/typescript/lib/lib.es2022.intl.d.ts","../node_modules/.pnpm/typescript@5.7.3/node_modules/typescript/lib/lib.es2022.object.d.ts","../node_modules/.pnpm/typescript@5.7.3/node_modules/typescript/lib/lib.es2022.string.d.ts","../node_modules/.pnpm/typescript@5.7.3/node_modules/typescript/lib/lib.es2022.regexp.d.ts","../node_modules/.pnpm/typescript@5.7.3/node_modules/typescript/lib/lib.decorators.d.ts","../node_modules/.pnpm/typescript@5.7.3/node_modules/typescript/lib/lib.decorators.legacy.d.ts","../node_modules/.pnpm/typescript@5.7.3/node_modules/typescript/lib/lib.es2022.full.d.ts","../node_modules/.pnpm/multiformats@13.3.1/node_modules/multiformats/dist/src/bytes.d.ts","../node_modules/.pnpm/multiformats@13.3.1/node_modules/multiformats/dist/src/bases/interface.d.ts","../node_modules/.pnpm/multiformats@13.3.1/node_modules/multiformats/dist/src/block/interface.d.ts","../node_modules/.pnpm/multiformats@13.3.1/node_modules/multiformats/dist/src/hashes/interface.d.ts","../node_modules/.pnpm/multiformats@13.3.1/node_modules/multiformats/dist/src/link/interface.d.ts","../node_modules/.pnpm/multiformats@13.3.1/node_modules/multiformats/dist/src/cid.d.ts","../node_modules/.pnpm/multiformats@13.3.1/node_modules/multiformats/dist/src/hashes/digest.d.ts","../node_modules/.pnpm/multiformats@13.3.1/node_modules/multiformats/dist/src/hashes/hasher.d.ts","../node_modules/.pnpm/multiformats@13.3.1/node_modules/multiformats/dist/src/varint.d.ts","../node_modules/.pnpm/multiformats@13.3.1/node_modules/multiformats/dist/src/codecs/interface.d.ts","../node_modules/.pnpm/multiformats@13.3.1/node_modules/multiformats/dist/src/interface.d.ts","../node_modules/.pnpm/multiformats@13.3.1/node_modules/multiformats/dist/src/index.d.ts","../node_modules/.pnpm/multiformats@13.3.1/node_modules/multiformats/dist/src/hashes/sha2.d.ts","../node_modules/.pnpm/cborg@4.0.7/node_modules/cborg/types/lib/token.d.ts","../node_modules/.pnpm/cborg@4.0.7/node_modules/cborg/types/lib/bl.d.ts","../node_modules/.pnpm/cborg@4.0.7/node_modules/cborg/types/interface.d.ts","../node_modules/.pnpm/cborg@4.0.7/node_modules/cborg/types/lib/decode.d.ts","../node_modules/.pnpm/cborg@4.0.7/node_modules/cborg/types/lib/encode.d.ts","../node_modules/.pnpm/cborg@4.0.7/node_modules/cborg/types/cborg.d.ts","../node_modules/.pnpm/@ipld+dag-cbor@9.2.2/node_modules/@ipld/dag-cbor/dist/src/index.d.ts","../src/api.ts","../node_modules/.pnpm/multiformats@13.3.1/node_modules/multiformats/dist/src/link.d.ts","../src/block.js","../node_modules/.pnpm/multiformats@13.3.1/node_modules/multiformats/dist/src/block.d.ts","../src/shard.js","../src/diff.js","../src/index.js","../src/merge.js","../src/batch/api.ts","../src/batch/shard.js","../src/batch/index.js","../src/clock/api.ts","../src/clock/index.js","../src/crdt/api.ts","../src/crdt/index.js","../src/crdt/batch/api.ts","../src/crdt/batch/index.js","../../../../../node_modules/.pnpm/ast-types@0.14.2/node_modules/ast-types/types.d.ts","../../../../../node_modules/.pnpm/ast-types@0.14.2/node_modules/ast-types/gen/namedTypes.d.ts","../../../../../node_modules/.pnpm/ast-types@0.14.2/node_modules/ast-types/gen/kinds.d.ts","../../../../../node_modules/.pnpm/ast-types@0.14.2/node_modules/ast-types/gen/builders.d.ts","../../../../../node_modules/.pnpm/ast-types@0.14.2/node_modules/ast-types/lib/types.d.ts","../../../../../node_modules/.pnpm/ast-types@0.14.2/node_modules/ast-types/lib/path.d.ts","../../../../../node_modules/.pnpm/ast-types@0.14.2/node_modules/ast-types/lib/scope.d.ts","../../../../../node_modules/.pnpm/ast-types@0.14.2/node_modules/ast-types/lib/node-path.d.ts","../../../../../node_modules/.pnpm/ast-types@0.14.2/node_modules/ast-types/lib/path-visitor.d.ts","../../../../../node_modules/.pnpm/ast-types@0.14.2/node_modules/ast-types/gen/visitor.d.ts","../../../../../node_modules/.pnpm/ast-types@0.14.2/node_modules/ast-types/main.d.ts","../../../../../node_modules/.pnpm/recast@0.20.5/node_modules/recast/lib/options.d.ts","../../../../../node_modules/.pnpm/recast@0.20.5/node_modules/recast/lib/parser.d.ts","../../../../../node_modules/.pnpm/recast@0.20.5/node_modules/recast/lib/printer.d.ts","../../../../../node_modules/.pnpm/recast@0.20.5/node_modules/recast/main.d.ts","../../../../../node_modules/.pnpm/@types+jscodeshift@0.12.0/node_modules/@types/jscodeshift/src/collections/JSXElement.d.ts","../../../../../node_modules/.pnpm/@types+jscodeshift@0.12.0/node_modules/@types/jscodeshift/src/collections/Node.d.ts","../../../../../node_modules/.pnpm/@types+jscodeshift@0.12.0/node_modules/@types/jscodeshift/src/collections/VariableDeclarator.d.ts","../../../../../node_modules/.pnpm/@types+jscodeshift@0.12.0/node_modules/@types/jscodeshift/src/Collection.d.ts","../../../../../node_modules/.pnpm/@types+jscodeshift@0.12.0/node_modules/@types/jscodeshift/src/template.d.ts","../../../../../node_modules/.pnpm/@types+jscodeshift@0.12.0/node_modules/@types/jscodeshift/src/core.d.ts","../../../../../node_modules/.pnpm/@types+jscodeshift@0.12.0/node_modules/@types/jscodeshift/index.d.ts"],"fileIdsList":[[69,73,79,82],[77,79,80,81],[77,78],[77,79],[79],[74,75],[68,69],[68],[66],[67],[67,70],[71],[64,69,70,71,72,74],[65,66,67,68,73],[65,66,67],[75,76,83],[84],[88,92,93],[88,92],[75,84,85],[75,84],[75,76,83,87,95],[84,95],[92,97],[86,88,94,96,98,99],[86,88,90,94,96,97],[84,88],[84,89,90],[76,83,84,85,87],[121],[105,108,115,116,117,118],[108,111,119],[105,108,111,119],[105,108,111,115,116,118,119,120],[102,103],[102],[101,103,105],[102,108,109],[101,105,106,107],[101,105,108,110],[101,105],[101],[101,102,104],[101,102,104,105,106,108,109,110],[112],[111,112,113,114]],"fileInfos":[{"version":"e41c290ef7dd7dab3493e6cbe5909e0148edf4a8dad0271be08edec368a0f7b9","affectsGlobalScope":true,"impliedFormat":1},{"version":"45b7ab580deca34ae9729e97c13cfd999df04416a79116c3bfb483804f85ded4","impliedFormat":1},{"version":"3facaf05f0c5fc569c5649dd359892c98a85557e3e0c847964caeb67076f4d75","impliedFormat":1},{"version":"e44bb8bbac7f10ecc786703fe0a6a4b952189f908707980ba8f3c8975a760962","impliedFormat":1},{"version":"5e1c4c362065a6b95ff952c0eab010f04dcd2c3494e813b493ecfd4fcb9fc0d8","impliedFormat":1},{"version":"68d73b4a11549f9c0b7d352d10e91e5dca8faa3322bfb77b661839c42b1ddec7","impliedFormat":1},{"version":"5efce4fc3c29ea84e8928f97adec086e3dc876365e0982cc8479a07954a3efd4","impliedFormat":1},{"version":"feecb1be483ed332fad555aff858affd90a48ab19ba7272ee084704eb7167569","impliedFormat":1},{"version":"ee7bad0c15b58988daa84371e0b89d313b762ab83cb5b31b8a2d1162e8eb41c2","impliedFormat":1},{"version":"4fd3f3422b2d2a3dfd5cdd0f387b3a8ec45f006c6ea896a4cb41264c2100bb2c","affectsGlobalScope":true,"impliedFormat":1},{"version":"69e65d976bf166ce4a9e6f6c18f94d2424bf116e90837ace179610dbccad9b42","affectsGlobalScope":true,"impliedFormat":1},{"version":"d7a3c8b952931daebdfc7a2897c53c0a1c73624593fa070e46bd537e64dcd20a","affectsGlobalScope":true,"impliedFormat":1},{"version":"80e18897e5884b6723488d4f5652167e7bb5024f946743134ecc4aa4ee731f89","affectsGlobalScope":true,"impliedFormat":1},{"version":"cd034f499c6cdca722b60c04b5b1b78e058487a7085a8e0d6fb50809947ee573","affectsGlobalScope":true,"impliedFormat":1},{"version":"c57796738e7f83dbc4b8e65132f11a377649c00dd3eee333f672b8f0a6bea671","affectsGlobalScope":true,"impliedFormat":1},{"version":"dc2df20b1bcdc8c2d34af4926e2c3ab15ffe1160a63e58b7e09833f616efff44","affectsGlobalScope":true,"impliedFormat":1},{"version":"515d0b7b9bea2e31ea4ec968e9edd2c39d3eebf4a2d5cbd04e88639819ae3b71","affectsGlobalScope":true,"impliedFormat":1},{"version":"62bb211266ee48b2d0edf0d8d1b191f0c24fc379a82bd4c1692a082c540bc6b1","affectsGlobalScope":true,"impliedFormat":1},{"version":"0dc1e7ceda9b8b9b455c3a2d67b0412feab00bd2f66656cd8850e8831b08b537","affectsGlobalScope":true,"impliedFormat":1},{"version":"ce691fb9e5c64efb9547083e4a34091bcbe5bdb41027e310ebba8f7d96a98671","affectsGlobalScope":true,"impliedFormat":1},{"version":"8d697a2a929a5fcb38b7a65594020fcef05ec1630804a33748829c5ff53640d0","affectsGlobalScope":true,"impliedFormat":1},{"version":"4ff2a353abf8a80ee399af572debb8faab2d33ad38c4b4474cff7f26e7653b8d","affectsGlobalScope":true,"impliedFormat":1},{"version":"936e80ad36a2ee83fc3caf008e7c4c5afe45b3cf3d5c24408f039c1d47bdc1df","affectsGlobalScope":true,"impliedFormat":1},{"version":"d15bea3d62cbbdb9797079416b8ac375ae99162a7fba5de2c6c505446486ac0a","affectsGlobalScope":true,"impliedFormat":1},{"version":"68d18b664c9d32a7336a70235958b8997ebc1c3b8505f4f1ae2b7e7753b87618","affectsGlobalScope":true,"impliedFormat":1},{"version":"eb3d66c8327153d8fa7dd03f9c58d351107fe824c79e9b56b462935176cdf12a","affectsGlobalScope":true,"impliedFormat":1},{"version":"38f0219c9e23c915ef9790ab1d680440d95419ad264816fa15009a8851e79119","affectsGlobalScope":true,"impliedFormat":1},{"version":"69ab18c3b76cd9b1be3d188eaf8bba06112ebbe2f47f6c322b5105a6fbc45a2e","affectsGlobalScope":true,"impliedFormat":1},{"version":"fef8cfad2e2dc5f5b3d97a6f4f2e92848eb1b88e897bb7318cef0e2820bceaab","affectsGlobalScope":true,"impliedFormat":1},{"version":"2f11ff796926e0832f9ae148008138ad583bd181899ab7dd768a2666700b1893","affectsGlobalScope":true,"impliedFormat":1},{"version":"4de680d5bb41c17f7f68e0419412ca23c98d5749dcaaea1896172f06435891fc","affectsGlobalScope":true,"impliedFormat":1},{"version":"954296b30da6d508a104a3a0b5d96b76495c709785c1d11610908e63481ee667","affectsGlobalScope":true,"impliedFormat":1},{"version":"ac9538681b19688c8eae65811b329d3744af679e0bdfa5d842d0e32524c73e1c","affectsGlobalScope":true,"impliedFormat":1},{"version":"0a969edff4bd52585473d24995c5ef223f6652d6ef46193309b3921d65dd4376","affectsGlobalScope":true,"impliedFormat":1},{"version":"9e9fbd7030c440b33d021da145d3232984c8bb7916f277e8ffd3dc2e3eae2bdb","affectsGlobalScope":true,"impliedFormat":1},{"version":"811ec78f7fefcabbda4bfa93b3eb67d9ae166ef95f9bff989d964061cbf81a0c","affectsGlobalScope":true,"impliedFormat":1},{"version":"717937616a17072082152a2ef351cb51f98802fb4b2fdabd32399843875974ca","affectsGlobalScope":true,"impliedFormat":1},{"version":"d7e7d9b7b50e5f22c915b525acc5a49a7a6584cf8f62d0569e557c5cfc4b2ac2","affectsGlobalScope":true,"impliedFormat":1},{"version":"71c37f4c9543f31dfced6c7840e068c5a5aacb7b89111a4364b1d5276b852557","affectsGlobalScope":true,"impliedFormat":1},{"version":"576711e016cf4f1804676043e6a0a5414252560eb57de9faceee34d79798c850","affectsGlobalScope":true,"impliedFormat":1},{"version":"89c1b1281ba7b8a96efc676b11b264de7a8374c5ea1e6617f11880a13fc56dc6","affectsGlobalScope":true,"impliedFormat":1},{"version":"74f7fa2d027d5b33eb0471c8e82a6c87216223181ec31247c357a3e8e2fddc5b","affectsGlobalScope":true,"impliedFormat":1},{"version":"f1e2a172204962276504466a6393426d2ca9c54894b1ad0a6c9dad867a65f876","affectsGlobalScope":true,"impliedFormat":1},{"version":"063600664504610fe3e99b717a1223f8b1900087fab0b4cad1496a114744f8df","affectsGlobalScope":true,"impliedFormat":1},{"version":"934019d7e3c81950f9a8426d093458b65d5aff2c7c1511233c0fd5b941e608ab","affectsGlobalScope":true,"impliedFormat":1},{"version":"52ada8e0b6e0482b728070b7639ee42e83a9b1c22d205992756fe020fd9f4a47","affectsGlobalScope":true,"impliedFormat":1},{"version":"3bdefe1bfd4d6dee0e26f928f93ccc128f1b64d5d501ff4a8cf3c6371200e5e6","affectsGlobalScope":true,"impliedFormat":1},{"version":"59fb2c069260b4ba00b5643b907ef5d5341b167e7d1dbf58dfd895658bda2867","affectsGlobalScope":true,"impliedFormat":1},{"version":"639e512c0dfc3fad96a84caad71b8834d66329a1f28dc95e3946c9b58176c73a","affectsGlobalScope":true,"impliedFormat":1},{"version":"368af93f74c9c932edd84c58883e736c9e3d53cec1fe24c0b0ff451f529ceab1","affectsGlobalScope":true,"impliedFormat":1},{"version":"af3dd424cf267428f30ccfc376f47a2c0114546b55c44d8c0f1d57d841e28d74","affectsGlobalScope":true,"impliedFormat":1},{"version":"995c005ab91a498455ea8dfb63aa9f83fa2ea793c3d8aa344be4a1678d06d399","affectsGlobalScope":true,"impliedFormat":1},{"version":"959d36cddf5e7d572a65045b876f2956c973a586da58e5d26cde519184fd9b8a","affectsGlobalScope":true,"impliedFormat":1},{"version":"965f36eae237dd74e6cca203a43e9ca801ce38824ead814728a2807b1910117d","affectsGlobalScope":true,"impliedFormat":1},{"version":"3925a6c820dcb1a06506c90b1577db1fdbf7705d65b62b99dce4be75c637e26b","affectsGlobalScope":true,"impliedFormat":1},{"version":"0a3d63ef2b853447ec4f749d3f368ce642264246e02911fcb1590d8c161b8005","affectsGlobalScope":true,"impliedFormat":1},{"version":"b5ce7a470bc3628408429040c4e3a53a27755022a32fd05e2cb694e7015386c7","affectsGlobalScope":true,"impliedFormat":1},{"version":"8444af78980e3b20b49324f4a16ba35024fef3ee069a0eb67616ea6ca821c47a","affectsGlobalScope":true,"impliedFormat":1},{"version":"3287d9d085fbd618c3971944b65b4be57859f5415f495b33a6adc994edd2f004","affectsGlobalScope":true,"impliedFormat":1},{"version":"b4b67b1a91182421f5df999988c690f14d813b9850b40acd06ed44691f6727ad","affectsGlobalScope":true,"impliedFormat":1},{"version":"8e7f8264d0fb4c5339605a15daadb037bf238c10b654bb3eee14208f860a32ea","affectsGlobalScope":true,"impliedFormat":1},{"version":"782dec38049b92d4e85c1585fbea5474a219c6984a35b004963b00beb1aab538","affectsGlobalScope":true,"impliedFormat":1},{"version":"3cbad9a1ba4453443026ed38e4b8be018abb26565fa7c944376463ad9df07c41","impliedFormat":1},{"version":"929fc31f7523aaa1d19735b77e637af06e58d76007648ec088ecfbec1521cbfe","impliedFormat":99},{"version":"4a3605bef1a5ef29fd5a1696dd95b0b4e2259e2d07a4d88fac79f3a9765c44a2","impliedFormat":99},{"version":"370079895f1acdd4bb5194a403c85bf60cfbb2654bced9430a6c7210e7246be8","impliedFormat":99},{"version":"90240231e730deed31569f6c686766a538e4a024bbc33ea1738fe924f477ba61","impliedFormat":99},{"version":"552223520e823223ee13c5764e9b69b1819c985818a8bcda435d8d1dbd909bee","impliedFormat":99},{"version":"49b7c3ddd683c09aa437dd92681699387441f522524b14d2331ce494a9bf2f27","impliedFormat":99},{"version":"3d0e04c8ca3f41da5f3d689500d9c4aeb54a1c59764d66d58f0e579b9af720e5","impliedFormat":99},{"version":"a6eb23f2a83113ce0ab7203bfda2be0888720f8d694a20abaef83b9f62832061","impliedFormat":99},{"version":"363dca5004ac5a3d9c2bba12812b97a64461911762f0b8f9320a8856ec53bcad","impliedFormat":99},{"version":"1447d46bff9e7c5c77da14515a7456ea5e919ce6e28f5e6746edf99818e4be47","impliedFormat":99},{"version":"557b8c7481296f4b7ed362320f3bbb40bb87404edf880c81224f365a8d1e17f3","impliedFormat":99},{"version":"283ed3d075bf7d3e8793f63b2a52f475ed84d95b7b6351c5d5bcc6c49d4b845b","impliedFormat":99},{"version":"130e4655e30a6d7a8004566642e24bf3016b5e5a2e5dcd72c0a61b663f7df711","impliedFormat":99},{"version":"0e84a640a449bd767be2ebebf4acf7cac1b1f92e72941b30d370ca0c8f1a30b3","impliedFormat":99},{"version":"a32c2dd5736b27da05ddf1034df28c75e8db3ef26effe60df4bd608f5c7a03d8","impliedFormat":99},{"version":"f65fb2149519d5e7cdf1245e0d5e5c6369855d9f14cfd1da9a678750da3f3fe6","impliedFormat":99},{"version":"15f502c247a60ad85c2a87635e7b0a71701a7f6d75fecba0f541e2b28d66f6fd","impliedFormat":99},{"version":"730fedb3e76078f11d9a8a595c3f337dadfb1c687810999b02394e853b668c5a","impliedFormat":99},{"version":"babe35042b7448cb38bbc24c357a358c5e1e71d2692a818f21a8550340e41329","impliedFormat":99},{"version":"f559fb70d8e4823601376e26e0ade0d4e1c50a5f8c349affbd3590c8d3666866","impliedFormat":99},{"version":"3d12b7b8957e4bc533d51d9bb1838a19c5343923db0982be1114e0f2cac13ced","signature":"04589c0e60491c7735394092de3a2c6bd33a5c079d7e898855b1e5080a990819"},{"version":"a1e5af4d821aeeee056db8fa6ce613f957af652cdab1c1b8058803684bdb23df","impliedFormat":99},{"version":"3c60343b48438de7de857209f3272804f325705e05945d0b5c6b77d8c0b91271","signature":"f5f7ad262c1abeec98a9a74f6cac8c2544c883e2e5f294d5a6283883f9c295d6"},{"version":"36a2b2bca10a1e53acaaae2f85c2737447ab9d66ebb05aee53f9f7de251e3c93","impliedFormat":99},{"version":"da90eb2d7d795885d978a33a0d37fc875f4749c30ddf1b6ef4642d767b572828","signature":"a64e40b9fd4087b7ae2763416bc02ffdbbccb15f3e76151538e0a7b650bb697f"},{"version":"4efb0e55bdb87c1fc5ede5dceba6bbd330daee81c9acf55110f1d68fbea8e34c","signature":"b1088088614739978364c6ab4de3d58e26aef7fd6113f81b96d82a6224c86b3a"},{"version":"10d638b1e0877b6af4f6ac5d6d5a4749ca96bc4dab30b9632b9435c669b34fd0","signature":"cd633aec7dbec63e37281aafc3e12ac4f3c1c0337d173015e8ac81ed143a529f"},{"version":"229faf86cd68a721d11b73a0b398ee241a57172cb3eef98351fa6adc4ed96aec","signature":"6bfa5af024804ea22f15370d2feb92958199fd3827bc97bf0487d29fb488925f"},{"version":"ecdb20ce70028bfb135f2c6475d6500c92148473be5347e1c3c527413176d65d","signature":"0b43e07b80bc9186dad45a6fe6ca756ea04ba9514b28f1a178910a0c7d8712ad"},{"version":"d913e4e7f031f401daed294c2308e81384c22c81cc6e7510f4f513bbb4717c67","signature":"a544cca6c47cb8b6d575bb76e95bed5098d90b61d41c5b5c3c727533477306a4"},{"version":"340c655e4885b071b70ec4dbc2a4ca517e473017c96467ca96679b767007b545","signature":"c8427ac345e001d4a1c9b3ed1ad0c0db4b900406a2224f7e7a7b0e57c6d2a38a"},{"version":"634e303df54ddd9c2e20bce6784a7fef1ea06183d75161fbf57e3324d4d6f07e","signature":"de94446f7a45df1aa8cfbe6aba6041f18551e6cee0067f29ecbe8615baf45360"},{"version":"31e758d6640ef652be142972a0002fed5ff026c20a61c51266ac73463c34e4fb","signature":"b21031da01aa8da51e7e76069e790766fe129a9d3f0d2b1513d861f0c9756a7e"},{"version":"857a4ca072a3a8d8e9be87699f3e9e2cf35989c2541551256724ace7c2ea1979","signature":"ac8e46be3c88e8f148a521f4719e07e1be9078cf37ec1f12b519d6bc569d5f14"},{"version":"8bcfa3cca1e71f4ed6e02e022c76853939a4588400bf396a828e33d1407dbccb","signature":"863e1c8c2d1d22df115e62c4c56c49b918e4c25fda25b7c5ad5b1f24776d25e2"},{"version":"0e0efe474d811ce52d4f8a73b2ab588aab64c3b7ff9180d36cb59c43034a44d6","signature":"39eaa64d9ce59d3a874d8f8d738db4428f23f1983b0aa99e0fefdcaf6ec5f9ae"},{"version":"aa856deef38ee724cda58a8d4ee451125f95c35af9fafcb0050169a519a17032","signature":"c69bc379f337d1e362506c4b44d64004801262c7b4c6ee280a131c86eb1ced15"},{"version":"cc2dc362fc50995684e9f7e9b38ad9bdf19e74919294a694cbc05392352cad7d","impliedFormat":1},{"version":"abef3012ae70d98baa449664e9dda50c96fc68b0fd11a592d6590d85bb89cd10","impliedFormat":1},{"version":"456e83839c811cedebb65c8b05027120336b3bd6920259817d728ffc52d41e2f","impliedFormat":1},{"version":"ea79d9641e700b2b4a04a857ed1ef692c4caf988017fbabd64c4111f7c287673","impliedFormat":1},{"version":"0a90b9435b81f45b88c5fb8d30e85b77d3508eb0760dc40b9fb825fd29f92375","impliedFormat":1},{"version":"8cd7362102d928e21b291a013f80fc68a038d4506d26ea9948c676e3fa1110d9","impliedFormat":1},{"version":"90f6830fb380f4d2b69df018343ae80ce92991e85a0d7be8d214c643b39d1175","impliedFormat":1},{"version":"1bfe6db4f3dffacd1da82748cb8f0acec04e8a4d7bd36c09573d5d80a7dec28b","impliedFormat":1},{"version":"6a8d6deca8ec4250630fea4e5f23bd9bf0face98739ccd22e08a17173117155b","impliedFormat":1},{"version":"a1d51fd5a8f9c1c038799a43c038397ca3ed99ee73cc0b0aada897e7cc8aca91","impliedFormat":1},{"version":"6c9708ae545db5f8deb8ef774d412fd1b46adade794664d7c6cfd0a1f6dfd64f","impliedFormat":1},{"version":"9d14fcf0b69094271127c7b6acb36987be5d1bffa4eb948359549f040fb50349","impliedFormat":1},{"version":"e3a5287471fb08f053c06fd998632792aa5f022e45278f1e6dd55fb2fa9e7362","impliedFormat":1},{"version":"28a6c8eeb48e165920067b9193555649fc43c2a28c450f23f622e5eb043d9463","impliedFormat":1},{"version":"1147c3efa5a256bcd6a3d2cfaf764185b7120bf985f8412d9bae596a0348f77b","impliedFormat":1},{"version":"67aee88594abc44cd58820dea2ed1a9d373c1c2a59941234e4abe797464bc4da","impliedFormat":1},{"version":"2d940af7c1b73ae897c7d2a9706914d1af5fa4fdc0c5571e3495fd75986b597e","impliedFormat":1},{"version":"f8cb94e0dffd21068a952754ec67d01d35a15fa61bd3af951f949e9b8bde7976","impliedFormat":1},{"version":"65414b42714fc6fb8d4e6d625ccc4254959a1364d48dfdd256c6b0e3cfa33787","impliedFormat":1},{"version":"3c7ef314f6691dbba43cb1310a82d610ea648cc4498cd685c3e25442ea2d98a0","impliedFormat":1},{"version":"8f4e378c31f3c988cd5a48ac807ef111e37d9e3ea9cfff33d2bbb828c90b804b","impliedFormat":1},{"version":"c97f00f075490014bb4aaf97814fecfec1ca8f7befcf06d4ff0a0b995e46ce57","impliedFormat":1}],"root":[84,86,[88,100]],"options":{"allowJs":true,"checkJs":true,"composite":true,"declarationMap":true,"emitDeclarationOnly":true,"esModuleInterop":true,"module":7,"outDir":"./","skipLibCheck":true,"strict":true,"target":9},"referencedMap":[[83,1],[82,2],[79,3],[80,4],[81,5],[87,6],[66,7],[69,8],[73,9],[70,10],[71,11],[76,12],[75,13],[74,14],[85,7],[68,15],[84,16],[92,17],[94,18],[93,19],[86,20],[95,21],[96,22],[97,23],[99,24],[100,25],[98,26],[89,27],[90,27],[91,28],[88,29],[122,30],[119,31],[116,32],[117,33],[118,32],[121,34],[120,30],[104,35],[103,36],[102,37],[110,38],[108,39],[109,40],[106,41],[107,42],[105,43],[111,44],[112,42],[113,45],[115,46]],"latestChangedDtsFile":"./src/crdt/batch/index.d.ts","version":"5.7.3"}
@@ -1 +0,0 @@
1
- export {}
@@ -1,90 +0,0 @@
1
- import { Link, UnknownLink, BlockView, Block, Version } from 'multiformats'
2
- import { sha256 } from 'multiformats/hashes/sha2'
3
- import * as dagCBOR from '@ipld/dag-cbor'
4
-
5
- export { Link, UnknownLink, BlockView, Block, Version }
6
-
7
- export type ShardEntryValueValue = UnknownLink
8
-
9
- export type ShardEntryLinkValue = [ShardLink]
10
-
11
- export type ShardEntryLinkAndValueValue = [ShardLink, UnknownLink]
12
-
13
- export type ShardValueEntry = [key: string, value: ShardEntryValueValue]
14
-
15
- export type ShardLinkEntry = [key: string, value: ShardEntryLinkValue | ShardEntryLinkAndValueValue]
16
-
17
- /** Single key/value entry within a shard. */
18
- export type ShardEntry = [key: string, value: ShardEntryValueValue | ShardEntryLinkValue | ShardEntryLinkAndValueValue]
19
-
20
- export interface Shard extends ShardConfig {
21
- entries: ShardEntry[]
22
- }
23
-
24
- export type ShardLink = Link<Shard, typeof dagCBOR.code, typeof sha256.code, 1>
25
-
26
- export interface ShardBlockView extends BlockView<Shard, typeof dagCBOR.code, typeof sha256.code, 1> {}
27
-
28
- export interface ShardDiff {
29
- additions: ShardBlockView[]
30
- removals: ShardBlockView[]
31
- }
32
-
33
- export interface BlockFetcher {
34
- get<T = unknown, C extends number = number, A extends number = number, V extends Version = 1> (link: Link<T, C, A, V>):
35
- Promise<Block<T, C, A, V> | undefined>
36
- }
37
-
38
- export interface ShardConfig {
39
- /** Shard compatibility version. */
40
- version: number
41
- /**
42
- * Characters allowed in keys, referring to a known character set.
43
- * e.g. "ascii" refers to the printable ASCII characters in the code range 32-126.
44
- */
45
- keyChars: string
46
- /** Max key size in bytes - default 4096 bytes. */
47
- maxKeySize: number
48
- /** The key prefix from the root to this shard. */
49
- prefix: string
50
- }
51
-
52
- export type ShardOptions = Partial<ShardConfig>
53
-
54
- export interface KeyPrefixOption {
55
- /** Filter results to entries with keys prefixed with this string. */
56
- prefix: string
57
- }
58
-
59
- export type KeyRangeOption =
60
- | KeyLowerBoundRangeOption
61
- | KeyUpperBoundRangeOption
62
- | (KeyLowerBoundRangeOption & KeyUpperBoundRangeOption)
63
-
64
- export type KeyLowerBoundRangeOption =
65
- | KeyLowerBoundRangeExclusiveOption
66
- | KeyLowerBoundRangeInclusiveOption
67
-
68
- export interface KeyLowerBoundRangeExclusiveOption {
69
- gt: string
70
- }
71
-
72
- export interface KeyLowerBoundRangeInclusiveOption {
73
- gte: string
74
- }
75
-
76
- export type KeyUpperBoundRangeOption =
77
- | KeyUpperBoundRangeExclusiveOption
78
- | KeyUpperBoundRangeInclusiveOption
79
-
80
- export interface KeyUpperBoundRangeExclusiveOption {
81
- lt: string
82
- }
83
-
84
- export interface KeyUpperBoundRangeInclusiveOption {
85
- lte: string
86
- }
87
-
88
- export type EntriesOptions =
89
- | KeyPrefixOption
90
- | KeyRangeOption
@@ -1 +0,0 @@
1
- export {}
@@ -1,59 +0,0 @@
1
- import {
2
- UnknownLink,
3
- ShardLink,
4
- ShardDiff,
5
- ShardEntry,
6
- ShardEntryValueValue,
7
- ShardEntryLinkValue,
8
- ShardEntryLinkAndValueValue,
9
- ShardConfig,
10
- ShardOptions,
11
- ShardBlockView,
12
- BlockFetcher
13
- } from '../api.js'
14
-
15
- export {
16
- UnknownLink,
17
- ShardLink,
18
- ShardDiff,
19
- ShardEntry,
20
- ShardEntryValueValue,
21
- ShardEntryLinkValue,
22
- ShardEntryLinkAndValueValue,
23
- ShardConfig,
24
- ShardOptions,
25
- ShardBlockView,
26
- BlockFetcher
27
- }
28
-
29
- export interface BatcherShard extends ShardConfig {
30
- base?: ShardBlockView
31
- entries: BatcherShardEntry[]
32
- }
33
-
34
- export interface BatcherShardInit extends ShardOptions {
35
- base?: ShardBlockView
36
- entries?: BatcherShardEntry[]
37
- }
38
-
39
- export type BatcherShardEntry = [
40
- key: string,
41
- value: ShardEntryValueValue | ShardEntryLinkValue | ShardEntryLinkAndValueValue | ShardEntryShardValue | ShardEntryShardAndValueValue
42
- ]
43
-
44
- export type ShardEntryShardValue = [BatcherShard]
45
-
46
- export type ShardEntryShardAndValueValue = [BatcherShard, UnknownLink]
47
-
48
- export interface Batcher {
49
- /**
50
- * Put a value (a CID) for the given key. If the key exists it's value is
51
- * overwritten.
52
- */
53
- put (key: string, value: UnknownLink): Promise<void>
54
- /**
55
- * Encode all altered shards in the batch and return the new root CID and
56
- * difference blocks.
57
- */
58
- commit (): Promise<{ root: ShardLink } & ShardDiff>
59
- }
@@ -1,258 +0,0 @@
1
- // eslint-disable-next-line no-unused-vars
2
- import * as API from './api.js'
3
- import { ShardFetcher, isPrintableASCII } from '../shard.js'
4
- import * as Shard from '../shard.js'
5
- import * as BatcherShard from './shard.js'
6
-
7
- /** @implements {API.Batcher} */
8
- class Batcher {
9
- #committed = false
10
-
11
- /**
12
- * @param {object} init
13
- * @param {API.BlockFetcher} init.blocks Block storage.
14
- * @param {API.BatcherShardEntry[]} init.entries The entries in this shard.
15
- * @param {string} init.prefix Key prefix.
16
- * @param {number} init.version Shard compatibility version.
17
- * @param {string} init.keyChars Characters allowed in keys, referring to a known character set.
18
- * @param {number} init.maxKeySize Max key size in bytes.
19
- * @param {API.ShardBlockView} init.base Original shard this batcher is based on.
20
- */
21
- constructor ({ blocks, entries, prefix, version, keyChars, maxKeySize, base }) {
22
- this.blocks = blocks
23
- this.prefix = prefix
24
- this.entries = [...entries]
25
- this.base = base
26
- this.version = version
27
- this.keyChars = keyChars
28
- this.maxKeySize = maxKeySize
29
- }
30
-
31
- /**
32
- * @param {string} key The key of the value to put.
33
- * @param {API.UnknownLink} value The value to put.
34
- * @returns {Promise<void>}
35
- */
36
- async put (key, value) {
37
- if (this.#committed) throw new BatchCommittedError()
38
- return put(this.blocks, this, key, value)
39
- }
40
-
41
- async commit () {
42
- if (this.#committed) throw new BatchCommittedError()
43
- this.#committed = true
44
- return commit(this)
45
- }
46
-
47
- /**
48
- * @param {object} init
49
- * @param {API.BlockFetcher} init.blocks Block storage.
50
- * @param {API.ShardLink} init.link CID of the shard block.
51
- */
52
- static async create ({ blocks, link }) {
53
- const shards = new ShardFetcher(blocks)
54
- const base = await shards.get(link)
55
- return new Batcher({ blocks, base, ...base.value })
56
- }
57
- }
58
-
59
- /**
60
- * @param {API.BlockFetcher} blocks
61
- * @param {API.BatcherShard} shard
62
- * @param {string} key The key of the value to put.
63
- * @param {API.UnknownLink} value The value to put.
64
- * @returns {Promise<void>}
65
- */
66
- export const put = async (blocks, shard, key, value) => {
67
- if (shard.keyChars !== Shard.KeyCharsASCII) {
68
- throw new Error(`unsupported key character set: ${shard.keyChars}`)
69
- }
70
- if (!isPrintableASCII(key)) {
71
- throw new Error('key contains non-ASCII characters')
72
- }
73
- // ensure utf8 encoded key is smaller than max
74
- if (new TextEncoder().encode(key).length > shard.maxKeySize) {
75
- throw new Error(`UTF-8 encoded key exceeds max size of ${shard.maxKeySize} bytes`)
76
- }
77
-
78
- const shards = new ShardFetcher(blocks)
79
- const dest = await traverse(shards, shard, key)
80
- if (dest.shard !== shard) {
81
- shard = dest.shard
82
- key = dest.key
83
- }
84
-
85
- /** @type {API.BatcherShardEntry} */
86
- let entry = [dest.key, value]
87
- let targetEntries = [...dest.shard.entries]
88
-
89
- for (const [i, e] of targetEntries.entries()) {
90
- const [k, v] = e
91
-
92
- // is this just a replace?
93
- if (k === dest.key) break
94
-
95
- // do we need to shard this entry?
96
- const shortest = k.length < dest.key.length ? k : dest.key
97
- const other = shortest === k ? dest.key : k
98
- let common = ''
99
- for (const char of shortest) {
100
- const next = common + char
101
- if (!other.startsWith(next)) break
102
- common = next
103
- }
104
- if (common.length) {
105
- /** @type {API.ShardEntry[]} */
106
- let entries = []
107
-
108
- // if the existing entry key or new key is equal to the common prefix,
109
- // then the existing value / new value needs to persist in the parent
110
- // shard. Otherwise they persist in this new shard.
111
- if (common !== dest.key) {
112
- entries = Shard.putEntry(entries, [dest.key.slice(common.length), value])
113
- }
114
- if (common !== k) {
115
- entries = Shard.putEntry(entries, asShardEntry([k.slice(common.length), v]))
116
- }
117
-
118
- let child = BatcherShard.create({
119
- ...Shard.configure(dest.shard),
120
- prefix: dest.shard.prefix + common,
121
- entries
122
- })
123
-
124
- // need to spread as access by index does not consider utf-16 surrogates
125
- const commonChars = [...common]
126
-
127
- // create parent shards for each character of the common prefix
128
- for (let i = commonChars.length - 1; i > 0; i--) {
129
- /** @type {API.ShardEntryShardValue | API.ShardEntryShardAndValueValue} */
130
- let parentValue
131
- // if the first iteration and the existing entry key is equal to the
132
- // common prefix, then existing value needs to persist in this parent
133
- if (i === commonChars.length - 1 && common === k) {
134
- if (Array.isArray(v)) throw new Error('found a shard link when expecting a value')
135
- parentValue = [child, v]
136
- } else if (i === commonChars.length - 1 && common === dest.key) {
137
- parentValue = [child, value]
138
- } else {
139
- parentValue = [child]
140
- }
141
- const parent = BatcherShard.create({
142
- ...Shard.configure(dest.shard),
143
- prefix: dest.shard.prefix + commonChars.slice(0, i).join(''),
144
- entries: [[commonChars[i], parentValue]]
145
- })
146
- child = parent
147
- }
148
-
149
- // remove the sharded entry
150
- targetEntries.splice(i, 1)
151
-
152
- // create the entry that will be added to target
153
- if (commonChars.length === 1 && common === k) {
154
- if (Array.isArray(v)) throw new Error('found a shard link when expecting a value')
155
- entry = [commonChars[0], [child, v]]
156
- } else if (commonChars.length === 1 && common === dest.key) {
157
- entry = [commonChars[0], [child, value]]
158
- } else {
159
- entry = [commonChars[0], [child]]
160
- }
161
- break
162
- }
163
- }
164
-
165
- shard.entries = Shard.putEntry(asShardEntries(targetEntries), asShardEntry(entry))
166
- }
167
-
168
- /**
169
- * Traverse from the passed shard through to the correct shard for the passed
170
- * key.
171
- *
172
- * @param {ShardFetcher} shards
173
- * @param {API.BatcherShard} shard
174
- * @param {string} key
175
- * @returns {Promise<{ shard: API.BatcherShard, key: string }>}
176
- */
177
- export const traverse = async (shards, shard, key) => {
178
- for (let i = 0; i < shard.entries.length; i++) {
179
- const [k, v] = shard.entries[i]
180
- if (key <= k) break
181
- if (key.startsWith(k) && Array.isArray(v)) {
182
- if (Shard.isShardLink(v[0])) {
183
- const blk = await shards.get(v[0])
184
- const batcher = BatcherShard.create({ base: blk, ...blk.value })
185
- shard.entries[i] = [k, v[1] == null ? [batcher] : [batcher, v[1]]]
186
- return traverse(shards, batcher, key.slice(k.length))
187
- }
188
- return traverse(shards, v[0], key.slice(k.length))
189
- }
190
- }
191
- return { shard, key }
192
- }
193
-
194
- /**
195
- * Encode all altered shards in the batch and return the new root CID and
196
- * difference blocks.
197
- *
198
- * @param {API.BatcherShard} shard
199
- */
200
- export const commit = async shard => {
201
- /** @type {API.ShardBlockView[]} */
202
- const additions = []
203
- /** @type {API.ShardBlockView[]} */
204
- const removals = []
205
-
206
- /** @type {API.ShardEntry[]} */
207
- const entries = []
208
- for (const entry of shard.entries) {
209
- if (Array.isArray(entry[1]) && !Shard.isShardLink(entry[1][0])) {
210
- const result = await commit(entry[1][0])
211
- entries.push([
212
- entry[0],
213
- entry[1][1] == null ? [result.root] : [result.root, entry[1][1]]
214
- ])
215
- additions.push(...result.additions)
216
- removals.push(...result.removals)
217
- } else {
218
- entries.push(asShardEntry(entry))
219
- }
220
- }
221
-
222
- const block = await Shard.encodeBlock(Shard.withEntries(entries, shard))
223
- additions.push(block)
224
-
225
- if (shard.base && shard.base.cid.toString() === block.cid.toString()) {
226
- return { root: block.cid, additions: [], removals: [] }
227
- }
228
-
229
- if (shard.base) removals.push(shard.base)
230
-
231
- return { root: block.cid, additions, removals }
232
- }
233
-
234
- /** @param {API.BatcherShardEntry[]} entries */
235
- const asShardEntries = entries => /** @type {API.ShardEntry[]} */ (entries)
236
-
237
- /** @param {API.BatcherShardEntry} entry */
238
- const asShardEntry = entry => /** @type {API.ShardEntry} */ (entry)
239
-
240
- /**
241
- * @param {API.BlockFetcher} blocks Bucket block storage.
242
- * @param {API.ShardLink} root CID of the root shard block.
243
- * @returns {Promise<API.Batcher>}
244
- */
245
- export const create = (blocks, root) => Batcher.create({ blocks, link: root })
246
-
247
- export class BatchCommittedError extends Error {
248
- /**
249
- * @param {string} [message]
250
- * @param {ErrorOptions} [options]
251
- */
252
- constructor (message, options) {
253
- super(message ?? 'batch already committed', options)
254
- this.code = BatchCommittedError.code
255
- }
256
-
257
- static code = 'ERR_BATCH_COMMITTED'
258
- }
@@ -1,13 +0,0 @@
1
- // eslint-disable-next-line no-unused-vars
2
- import * as API from './api.js'
3
- import { configure } from '../shard.js'
4
-
5
- /**
6
- * @param {API.BatcherShardInit} [init]
7
- * @returns {API.BatcherShard}
8
- */
9
- export const create = init => ({
10
- base: init?.base,
11
- entries: [...(init?.entries ?? [])],
12
- ...configure(init)
13
- })
@@ -1,75 +0,0 @@
1
- // eslint-disable-next-line no-unused-vars
2
- import * as API from './api.js'
3
- import { parse } from 'multiformats/link'
4
-
5
- /** @implements {API.BlockFetcher} */
6
- export class MemoryBlockstore {
7
- /** @type {Map<string, Uint8Array>} */
8
- #blocks = new Map()
9
-
10
- /**
11
- * @param {Array<import('multiformats').Block>} [blocks]
12
- */
13
- constructor (blocks) {
14
- if (blocks) {
15
- this.#blocks = new Map(blocks.map(b => [b.cid.toString(), b.bytes]))
16
- }
17
- }
18
-
19
- /** @type {API.BlockFetcher['get']} */
20
- async get (cid) {
21
- const bytes = this.#blocks.get(cid.toString())
22
- if (!bytes) return
23
- return { cid, bytes }
24
- }
25
-
26
- /**
27
- * @param {API.UnknownLink} cid
28
- * @param {Uint8Array} bytes
29
- */
30
- async put (cid, bytes) {
31
- this.#blocks.set(cid.toString(), bytes)
32
- }
33
-
34
- /**
35
- * @param {API.UnknownLink} cid
36
- * @param {Uint8Array} bytes
37
- */
38
- putSync (cid, bytes) {
39
- this.#blocks.set(cid.toString(), bytes)
40
- }
41
-
42
- /** @param {API.UnknownLink} cid */
43
- async delete (cid) {
44
- this.#blocks.delete(cid.toString())
45
- }
46
-
47
- /** @param {API.UnknownLink} cid */
48
- deleteSync (cid) {
49
- this.#blocks.delete(cid.toString())
50
- }
51
-
52
- * entries () {
53
- for (const [str, bytes] of this.#blocks) {
54
- yield { cid: parse(str), bytes }
55
- }
56
- }
57
- }
58
-
59
- export class MultiBlockFetcher {
60
- /** @type {API.BlockFetcher[]} */
61
- #fetchers
62
-
63
- /** @param {API.BlockFetcher[]} fetchers */
64
- constructor (...fetchers) {
65
- this.#fetchers = fetchers
66
- }
67
-
68
- /** @type {API.BlockFetcher['get']} */
69
- async get (link) {
70
- for (const f of this.#fetchers) {
71
- const v = await f.get(link)
72
- if (v) return v
73
- }
74
- }
75
- }
@@ -1 +0,0 @@
1
- export {}