@web3-storage/pail 0.4.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 (55) hide show
  1. package/LICENSE.md +232 -0
  2. package/README.md +84 -0
  3. package/cli.js +259 -0
  4. package/dist/src/api.d.ts +33 -0
  5. package/dist/src/api.d.ts.map +1 -0
  6. package/dist/src/batch/api.d.ts +33 -0
  7. package/dist/src/batch/api.d.ts.map +1 -0
  8. package/dist/src/batch/index.d.ts +74 -0
  9. package/dist/src/batch/index.d.ts.map +1 -0
  10. package/dist/src/batch/shard.d.ts +3 -0
  11. package/dist/src/batch/shard.d.ts.map +1 -0
  12. package/dist/src/block.d.ts +35 -0
  13. package/dist/src/block.d.ts.map +1 -0
  14. package/dist/src/clock/api.d.ts +10 -0
  15. package/dist/src/clock/api.d.ts.map +1 -0
  16. package/dist/src/clock/index.d.ts +48 -0
  17. package/dist/src/clock/index.d.ts.map +1 -0
  18. package/dist/src/crdt/api.d.ts +26 -0
  19. package/dist/src/crdt/api.d.ts.map +1 -0
  20. package/dist/src/crdt/batch/api.d.ts +11 -0
  21. package/dist/src/crdt/batch/api.d.ts.map +1 -0
  22. package/dist/src/crdt/batch/index.d.ts +5 -0
  23. package/dist/src/crdt/batch/index.d.ts.map +1 -0
  24. package/dist/src/crdt/index.d.ts +11 -0
  25. package/dist/src/crdt/index.d.ts.map +1 -0
  26. package/dist/src/diff.d.ts +13 -0
  27. package/dist/src/diff.d.ts.map +1 -0
  28. package/dist/src/index.d.ts +12 -0
  29. package/dist/src/index.d.ts.map +1 -0
  30. package/dist/src/merge.d.ts +5 -0
  31. package/dist/src/merge.d.ts.map +1 -0
  32. package/dist/src/shard.d.ts +51 -0
  33. package/dist/src/shard.d.ts.map +1 -0
  34. package/dist/tsconfig.tsbuildinfo +1 -0
  35. package/package.json +174 -0
  36. package/src/api.js +1 -0
  37. package/src/api.ts +47 -0
  38. package/src/batch/api.js +1 -0
  39. package/src/batch/api.ts +61 -0
  40. package/src/batch/index.js +245 -0
  41. package/src/batch/shard.js +14 -0
  42. package/src/block.js +75 -0
  43. package/src/clock/api.js +1 -0
  44. package/src/clock/api.ts +12 -0
  45. package/src/clock/index.js +179 -0
  46. package/src/crdt/api.js +1 -0
  47. package/src/crdt/api.ts +33 -0
  48. package/src/crdt/batch/api.js +1 -0
  49. package/src/crdt/batch/api.ts +31 -0
  50. package/src/crdt/batch/index.js +156 -0
  51. package/src/crdt/index.js +355 -0
  52. package/src/diff.js +151 -0
  53. package/src/index.js +285 -0
  54. package/src/merge.js +43 -0
  55. package/src/shard.js +248 -0
@@ -0,0 +1,74 @@
1
+ export function put(blocks: API.BlockFetcher, shard: API.BatcherShard, key: string, value: API.UnknownLink): Promise<void>;
2
+ export function traverse(shards: ShardFetcher, key: string, shard: API.BatcherShard): Promise<{
3
+ shard: API.BatcherShard;
4
+ key: string;
5
+ }>;
6
+ export function commit(shard: API.BatcherShard): Promise<{
7
+ root: import("multiformats").CID<import("../api.js").Shard, 113, 18, 1>;
8
+ additions: API.ShardBlockView[];
9
+ removals: API.ShardBlockView[];
10
+ }>;
11
+ export function create(blocks: API.BlockFetcher, root: API.ShardLink): Promise<API.Batcher>;
12
+ export class BatchCommittedError extends Error {
13
+ static code: string;
14
+ /**
15
+ * @param {string} [message]
16
+ * @param {ErrorOptions} [options]
17
+ */
18
+ constructor(message?: string | undefined, options?: ErrorOptions | undefined);
19
+ code: string;
20
+ }
21
+ import * as API from './api.js';
22
+ import * as BatcherShard from './shard.js';
23
+ import { ShardFetcher } from '../shard.js';
24
+ /** @implements {API.Batcher} */
25
+ declare class Batcher implements API.Batcher {
26
+ /**
27
+ * @param {object} init
28
+ * @param {API.BlockFetcher} init.blocks Block storage.
29
+ * @param {API.ShardLink} init.link CID of the shard block.
30
+ * @param {string} init.prefix
31
+ */
32
+ static create({ blocks, link, prefix }: {
33
+ blocks: API.BlockFetcher;
34
+ link: API.ShardLink;
35
+ prefix: string;
36
+ }): Promise<Batcher>;
37
+ /**
38
+ * @param {object} init
39
+ * @param {API.BlockFetcher} init.blocks Block storage.
40
+ * @param {API.BatcherShardEntry[]} init.entries The entries in this shard.
41
+ * @param {string} init.prefix Key prefix.
42
+ * @param {number} init.maxSize
43
+ * @param {number} init.maxKeyLength
44
+ * @param {API.ShardBlockView} init.base Original shard this batcher is based on.
45
+ */
46
+ constructor({ blocks, entries, prefix, maxSize, maxKeyLength, base }: {
47
+ blocks: API.BlockFetcher;
48
+ entries: API.BatcherShardEntry[];
49
+ prefix: string;
50
+ maxSize: number;
51
+ maxKeyLength: number;
52
+ base: API.ShardBlockView;
53
+ });
54
+ blocks: API.BlockFetcher;
55
+ prefix: string;
56
+ entries: API.BatcherShardEntry[];
57
+ base: API.ShardBlockView;
58
+ maxSize: number;
59
+ maxKeyLength: number;
60
+ /**
61
+ * @param {string} key The key of the value to put.
62
+ * @param {API.UnknownLink} value The value to put.
63
+ * @returns {Promise<void>}
64
+ */
65
+ put(key: string, value: API.UnknownLink): Promise<void>;
66
+ commit(): Promise<{
67
+ root: import("multiformats").CID<import("../api.js").Shard, 113, 18, 1>;
68
+ additions: API.ShardBlockView[];
69
+ removals: API.ShardBlockView[];
70
+ }>;
71
+ #private;
72
+ }
73
+ export {};
74
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/batch/index.js"],"names":[],"mappings":"AAgEO,4BANI,IAAI,YAAY,SAChB,gBAAgB,OAChB,MAAM,SACN,IAAI,WAAW,GACb,QAAQ,IAAI,CAAC,CA4FzB;AAWM,iCALI,YAAY,OACZ,MAAM,SACN,gBAAgB,GACd,QAAQ;IAAE,KAAK,EAAE,gBAAgB,CAAC;IAAC,GAAG,EAAE,MAAM,CAAA;CAAE,CAAC,CAe7D;AAQM,8BAFI,gBAAgB;;;;GAkC1B;AAaM,+BAJI,IAAI,YAAY,QAChB,IAAI,SAAS,GACX,QAAQ,WAAW,CAAC,CAEyD;AAE1F;IAUE,oBAAmC;IATnC;;;OAGG;IACH,8EAGC;IADC,aAAoC;CAIvC;qBAnPoB,UAAU;8BAGD,YAAY;6BAFb,aAAa;AAI1C,gCAAgC;AAChC,iCADiB,GAAG,CAAC,OAAO;IAsC1B;;;;;OAKG;IACH;QAJkC,MAAM,EAA7B,IAAI,YAAY;QACI,IAAI,EAAxB,IAAI,SAAS;QACA,MAAM,EAAnB,MAAM;yBAMhB;IA5CD;;;;;;;;OAQG;IACH;QAPkC,MAAM,EAA7B,IAAI,YAAY;QACc,OAAO,EAArC,uBAAuB;QACV,MAAM,EAAnB,MAAM;QACO,OAAO,EAApB,MAAM;QACO,YAAY,EAAzB,MAAM;QACmB,IAAI,EAA7B,IAAI,cAAc;OAS5B;IANC,yBAAoB;IACpB,eAAoB;IACpB,iCAAsB;IACtB,yBAAgB;IAChB,gBAAsB;IACtB,qBAAgC;IAGlC;;;;OAIG;IACH,SAJW,MAAM,SACN,IAAI,WAAW,GACb,QAAQ,IAAI,CAAC,CAKzB;IAED;;;;OAIC;;CAaF"}
@@ -0,0 +1,3 @@
1
+ export function create(init?: API.BatcherShardInit | undefined): API.BatcherShard;
2
+ import * as API from './api.js';
3
+ //# sourceMappingURL=shard.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"shard.d.ts","sourceRoot":"","sources":["../../../src/batch/shard.js"],"names":[],"mappings":"AAQO,iEAFM,IAAI,YAAY,CAO3B;qBAZmB,UAAU"}
@@ -0,0 +1,35 @@
1
+ /** @implements {API.BlockFetcher} */
2
+ export class MemoryBlockstore implements API.BlockFetcher {
3
+ /**
4
+ * @param {Array<import('multiformats').Block>} [blocks]
5
+ */
6
+ constructor(blocks?: API.Block<any, number, number, 1>[] | undefined);
7
+ get<T = unknown, C extends number = number, A extends number = number, V extends API.Version = 1>(link: API.Link<T, C, A, V>): Promise<API.Block<T, C, A, V> | undefined>;
8
+ /**
9
+ * @param {API.UnknownLink} cid
10
+ * @param {Uint8Array} bytes
11
+ */
12
+ put(cid: API.UnknownLink, bytes: Uint8Array): Promise<void>;
13
+ /**
14
+ * @param {API.UnknownLink} cid
15
+ * @param {Uint8Array} bytes
16
+ */
17
+ putSync(cid: API.UnknownLink, bytes: Uint8Array): void;
18
+ /** @param {API.UnknownLink} cid */
19
+ delete(cid: API.UnknownLink): Promise<void>;
20
+ /** @param {API.UnknownLink} cid */
21
+ deleteSync(cid: API.UnknownLink): void;
22
+ entries(): Generator<{
23
+ cid: API.Link<unknown, number, number, API.Version>;
24
+ bytes: Uint8Array;
25
+ }, void, unknown>;
26
+ #private;
27
+ }
28
+ export class MultiBlockFetcher {
29
+ /** @param {API.BlockFetcher[]} fetchers */
30
+ constructor(...fetchers: API.BlockFetcher[]);
31
+ get<T = unknown, C extends number = number, A extends number = number, V extends API.Version = 1>(link: API.Link<T, C, A, V>): Promise<API.Block<T, C, A, V> | undefined>;
32
+ #private;
33
+ }
34
+ import * as API from './api.js';
35
+ //# sourceMappingURL=block.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"block.d.ts","sourceRoot":"","sources":["../../src/block.js"],"names":[],"mappings":"AAIA,qCAAqC;AACrC,yCADiB,GAAG,CAAC,YAAY;IAK/B;;OAEG;IACH,sEAIC;IAmCD,0KAQY;IAlCZ;;;OAGG;IACH,SAHW,IAAI,WAAW,SACf,UAAU,iBAIpB;IAED;;;OAGG;IACH,aAHW,IAAI,WAAW,SACf,UAAU,QAIpB;IAED,mCAAmC;IACnC,YADY,IAAI,WAAW,iBAG1B;IAED,mCAAmC;IACnC,gBADY,IAAI,WAAW,QAG1B;IAED;;;sBAIC;;CACF;AAED;IAIE,2CAA2C;IAC3C,yBADY,IAAI,YAAY,EAAE,EAG7B;IAdD,0KAQY;;CAeb;qBAzEoB,UAAU"}
@@ -0,0 +1,10 @@
1
+ import { Link, BlockView } from 'multiformats';
2
+ export { BlockFetcher } from '../api.js';
3
+ export type EventLink<T> = Link<EventView<T>>;
4
+ export interface EventView<T> {
5
+ parents: EventLink<T>[];
6
+ data: T;
7
+ }
8
+ export interface EventBlockView<T> extends BlockView<EventView<T>> {
9
+ }
10
+ //# sourceMappingURL=api.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../../../src/clock/api.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,cAAc,CAAA;AAE9C,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAA;AAExC,MAAM,MAAM,SAAS,CAAC,CAAC,IAAI,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAA;AAE7C,MAAM,WAAW,SAAS,CAAC,CAAC;IAC1B,OAAO,EAAE,SAAS,CAAC,CAAC,CAAC,EAAE,CAAA;IACvB,IAAI,EAAE,CAAC,CAAA;CACR;AAED,MAAM,WAAW,cAAc,CAAC,CAAC,CAAE,SAAQ,SAAS,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC;CAAG"}
@@ -0,0 +1,48 @@
1
+ export function advance<T>(blocks: API.BlockFetcher, head: API.EventLink<T>[], event: API.EventLink<T>): Promise<API.EventLink<T>[]>;
2
+ /**
3
+ * @template T
4
+ * @extends {Block<API.EventView<T>, typeof cbor.code, typeof sha256.code, 1>}
5
+ * @implements {API.EventBlockView<T>}
6
+ */
7
+ export class EventBlock<T> extends Block<API.EventView<T>, 113, 18, 1> implements API.EventBlockView<T> {
8
+ /**
9
+ * @template T
10
+ * @param {T} data
11
+ * @param {API.EventLink<T>[]} [parents]
12
+ */
13
+ static create<T_1>(data: T_1, parents?: API.EventLink<T_1>[] | undefined): Promise<API.EventBlockView<T_1>>;
14
+ /**
15
+ * @param {object} config
16
+ * @param {API.EventLink<T>} config.cid
17
+ * @param {Event} config.value
18
+ * @param {Uint8Array} config.bytes
19
+ * @param {string} config.prefix
20
+ */
21
+ constructor({ cid, value, bytes, prefix }: {
22
+ cid: API.EventLink<T>;
23
+ value: Event;
24
+ bytes: Uint8Array;
25
+ prefix: string;
26
+ });
27
+ prefix: string;
28
+ }
29
+ /** @template T */
30
+ export class EventFetcher<T> {
31
+ /** @param {API.BlockFetcher} blocks */
32
+ constructor(blocks: API.BlockFetcher);
33
+ /** @private */
34
+ private _blocks;
35
+ /**
36
+ * @param {API.EventLink<T>} link
37
+ * @returns {Promise<API.EventBlockView<T>>}
38
+ */
39
+ get(link: API.EventLink<T>): Promise<API.EventBlockView<T>>;
40
+ }
41
+ export function encodeEventBlock<T>(value: API.EventView<T>): Promise<API.EventBlockView<T>>;
42
+ export function decodeEventBlock<T>(bytes: Uint8Array): Promise<API.EventBlockView<T>>;
43
+ export function vis<T>(blocks: API.BlockFetcher, head: API.EventLink<T>[], options?: {
44
+ renderNodeLabel?: ((b: API.EventBlockView<T>) => string) | undefined;
45
+ } | undefined): AsyncGenerator<string, void, unknown>;
46
+ import * as API from './api.js';
47
+ import { Block } from 'multiformats/block';
48
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/clock/index.js"],"names":[],"mappings":"AAcO,mCAJI,IAAI,YAAY,kFA8B1B;AAED;;;;GAIG;AACH,kFAFgB,GAAG,CAAC,cAAc,CAAC,CAAC;IAgBlC;;;;OAIG;IACH,4GAEC;IApBD;;;;;;OAMG;IACH;QALoC,GAAG,EAA5B,IAAI,SAAS,CAAC,CAAC,CAAC;QACF,KAAK,EAAnB,KAAK;QACc,KAAK,EAAxB,UAAU;QACK,MAAM,EAArB,MAAM;OAMhB;IADC,eAAoB;CAWvB;AAED,kBAAkB;AAClB;IACE,uCAAuC;IACvC,oBADY,IAAI,YAAY,EAI3B;IAFC,eAAe;IACf,gBAAqB;IAGvB;;;OAGG;IACH,UAHW,IAAI,SAAS,CAAC,CAAC,CAAC,GACd,QAAQ,IAAI,cAAc,CAAC,CAAC,CAAC,CAAC,CAM1C;CACF;AAOM,6FAKN;AAOM,2CAHI,UAAU,kCAOpB;AAiCM,+BALI,IAAI,YAAY;qDAGc,MAAM;sDAiC9C;qBA3KoB,UAAU;sBAJO,oBAAoB"}
@@ -0,0 +1,26 @@
1
+ import { ShardDiff, ShardLink, UnknownLink } from '../api.js';
2
+ import { EventLink, EventBlockView } from '../clock/api.js';
3
+ export { BlockFetcher, UnknownLink, ShardBlockView, ShardDiff, ShardLink } from '../api.js';
4
+ export { EventBlockView, EventLink } from '../clock/api.js';
5
+ export interface Result extends ShardDiff {
6
+ root: ShardLink;
7
+ head: EventLink<Operation>[];
8
+ event?: EventBlockView<Operation>;
9
+ }
10
+ export type Operation = (PutOperation | DeleteOperation | BatchOperation) & {
11
+ root: ShardLink;
12
+ };
13
+ export interface PutOperation {
14
+ type: 'put';
15
+ key: string;
16
+ value: UnknownLink;
17
+ }
18
+ export interface DeleteOperation {
19
+ type: 'del';
20
+ key: string;
21
+ }
22
+ export interface BatchOperation {
23
+ type: 'batch';
24
+ ops: Array<PutOperation | DeleteOperation>;
25
+ }
26
+ //# sourceMappingURL=api.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../../../src/crdt/api.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,WAAW,CAAA;AAC7D,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAA;AAE3D,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,cAAc,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,WAAW,CAAA;AAC3F,OAAO,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAA;AAE3D,MAAM,WAAW,MAAO,SAAQ,SAAS;IACvC,IAAI,EAAE,SAAS,CAAA;IACf,IAAI,EAAE,SAAS,CAAC,SAAS,CAAC,EAAE,CAAA;IAC5B,KAAK,CAAC,EAAE,cAAc,CAAC,SAAS,CAAC,CAAA;CAClC;AAED,MAAM,MAAM,SAAS,GAAG,CACpB,YAAY,GACZ,eAAe,GACf,cAAc,CACjB,GAAG;IAAE,IAAI,EAAE,SAAS,CAAA;CAAE,CAAA;AAEvB,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,KAAK,CAAC;IACZ,GAAG,EAAE,MAAM,CAAA;IACX,KAAK,EAAE,WAAW,CAAA;CACnB;AAED,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,KAAK,CAAC;IACZ,GAAG,EAAE,MAAM,CAAA;CACZ;AAED,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,OAAO,CAAC;IACd,GAAG,EAAE,KAAK,CAAC,YAAY,GAAC,eAAe,CAAC,CAAA;CACzC"}
@@ -0,0 +1,11 @@
1
+ import { Batcher, BatcherShardEntry, ShardBlockView, BlockFetcher, ShardLink, UnknownLink } from '../../batch/api.js';
2
+ import { Operation, BatchOperation, EventLink, Result } from '../api.js';
3
+ export { Batcher, BatcherShardEntry, ShardBlockView, BlockFetcher, ShardLink, UnknownLink, Operation, BatchOperation, EventLink, Result };
4
+ export interface CRDTBatcher extends Batcher {
5
+ /**
6
+ * Encode all altered shards in the batch and return the new root CID, new
7
+ * clock head, the new clock event and the difference blocks.
8
+ */
9
+ commit(): Promise<Result>;
10
+ }
11
+ //# sourceMappingURL=api.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../../../../src/crdt/batch/api.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,OAAO,EACP,iBAAiB,EAEjB,cAAc,EACd,YAAY,EACZ,SAAS,EACT,WAAW,EACZ,MAAM,oBAAoB,CAAA;AAC3B,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,WAAW,CAAA;AAExE,OAAO,EACL,OAAO,EACP,iBAAiB,EACjB,cAAc,EACd,YAAY,EACZ,SAAS,EACT,WAAW,EACX,SAAS,EACT,cAAc,EACd,SAAS,EACT,MAAM,EACP,CAAA;AAED,MAAM,WAAW,WAAY,SAAQ,OAAO;IAC1C;;;OAGG;IACH,MAAM,IAAK,OAAO,CAAC,MAAM,CAAC,CAAA;CAC3B"}
@@ -0,0 +1,5 @@
1
+ export { BatchCommittedError };
2
+ export function create(blocks: API.BlockFetcher, head: API.EventLink<API.Operation>[]): Promise<API.CRDTBatcher>;
3
+ import { BatchCommittedError } from '../../batch/index.js';
4
+ import * as API from './api.js';
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/crdt/batch/index.js"],"names":[],"mappings":";AA2JO,+BAJI,IAAI,YAAY,QAChB,IAAI,SAAS,CAAC,IAAI,SAAS,CAAC,EAAE,GAC5B,QAAQ,IAAI,WAAW,CAAC,CAE+C;oCAtJhD,sBAAsB;qBAJrC,UAAU"}
@@ -0,0 +1,11 @@
1
+ export function put(blocks: API.BlockFetcher, head: API.EventLink<API.Operation>[], key: string, value: API.UnknownLink): Promise<API.Result>;
2
+ export function del(blocks: API.BlockFetcher, head: API.EventLink<API.Operation>[], key: string, options?: object | undefined): Promise<API.Result>;
3
+ export function root(blocks: API.BlockFetcher, head: API.EventLink<API.Operation>[]): Promise<{
4
+ root: API.ShardLink;
5
+ } & API.ShardDiff>;
6
+ export function get(blocks: API.BlockFetcher, head: API.EventLink<API.Operation>[], key: string): Promise<import("multiformats").Link<unknown, number, number, import("multiformats").Version> | undefined>;
7
+ export function entries(blocks: API.BlockFetcher, head: API.EventLink<API.Operation>[], options?: {
8
+ prefix?: string | undefined;
9
+ } | undefined): AsyncGenerator<import("../api.js").ShardValueEntry, void, undefined>;
10
+ import * as API from './api.js';
11
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/crdt/index.js"],"names":[],"mappings":"AAmBO,4BANI,IAAI,YAAY,QAChB,IAAI,SAAS,CAAC,IAAI,SAAS,CAAC,EAAE,OAC9B,MAAM,SACN,IAAI,WAAW,GACb,QAAQ,IAAI,MAAM,CAAC,CAoG/B;AAYM,4BANI,IAAI,YAAY,QAChB,IAAI,SAAS,CAAC,IAAI,SAAS,CAAC,EAAE,OAC9B,MAAM,iCAEJ,QAAQ,IAAI,MAAM,CAAC,CAI/B;AAYM,6BAJI,IAAI,YAAY,QAChB,IAAI,SAAS,CAAC,IAAI,SAAS,CAAC,EAAE;UACZ,IAAI,SAAS;mBAsEzC;AAOM,4BAJI,IAAI,YAAY,QAChB,IAAI,SAAS,CAAC,IAAI,SAAS,CAAC,EAAE,OAC9B,MAAM,6GAShB;AAQM,gCALI,IAAI,YAAY,QAChB,IAAI,SAAS,CAAC,IAAI,SAAS,CAAC,EAAE;;qFAWxC;qBA/OoB,UAAU"}
@@ -0,0 +1,13 @@
1
+ export function difference(blocks: API.BlockFetcher, a: API.ShardLink, b: API.ShardLink, prefix?: string): Promise<CombinedDiff>;
2
+ export type K = string;
3
+ export type AddV = [before: null, after: API.UnknownLink];
4
+ export type UpdateV = [before: API.UnknownLink, after: API.UnknownLink];
5
+ export type DeleteV = [before: API.UnknownLink, after: null];
6
+ export type KV = [key: K, value: [before: null, after: API.UnknownLink] | [before: API.UnknownLink, after: API.UnknownLink] | [before: API.UnknownLink, after: null]];
7
+ export type KeysDiff = [key: string, value: AddV | UpdateV | DeleteV][];
8
+ export type CombinedDiff = {
9
+ keys: KV[];
10
+ shards: API.ShardDiff;
11
+ };
12
+ import * as API from './api.js';
13
+ //# sourceMappingURL=diff.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"diff.d.ts","sourceRoot":"","sources":["../../src/diff.js"],"names":[],"mappings":"AAoBO,mCALI,IAAI,YAAY,KAChB,IAAI,SAAS,KACb,IAAI,SAAS,oBACX,QAAQ,YAAY,CAAC,CAgHjC;gBA7HY,MAAM;mBACN,CAAC,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,WAAW,CAAC;sBACtC,CAAC,MAAM,EAAE,IAAI,WAAW,EAAE,KAAK,EAAE,IAAI,WAAW,CAAC;sBACjD,CAAC,MAAM,EAAE,IAAI,WAAW,EAAE,KAAK,EAAE,IAAI,CAAC;iBACtC,CAAC,GAAG,EAAE,CAAC,EAAE,KAAK,EAAE,mIAAoB,CAAC;uBACrC,gDAAI;2BACJ;IAAE,IAAI,OAAW;IAAC,MAAM,EAAE,IAAI,SAAS,CAAA;CAAE;qBAVjC,UAAU"}
@@ -0,0 +1,12 @@
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?: {
9
+ prefix?: string | undefined;
10
+ } | undefined): AsyncIterableIterator<API.ShardValueEntry>;
11
+ import * as API from './api.js';
12
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.js"],"names":[],"mappings":"AAeO,4BANI,IAAI,YAAY,QAChB,IAAI,SAAS,OACb,MAAM,SACN,IAAI,WAAW,GACb,QAAQ;IAAE,IAAI,EAAE,IAAI,SAAS,CAAA;CAAE,GAAG,IAAI,SAAS,CAAC,CA0G5D;AAWM,4BALI,IAAI,YAAY,QAChB,IAAI,SAAS,OACb,MAAM,GACJ,QAAQ,IAAI,WAAW,GAAG,SAAS,CAAC,CAWhD;AAWM,4BALI,IAAI,YAAY,QAChB,IAAI,SAAS,OACb,MAAM,GACJ,QAAQ;IAAE,IAAI,EAAE,IAAI,SAAS,CAAA;CAAE,GAAG,IAAI,SAAS,CAAC,CAoE5D;AAWM,gCANI,IAAI,YAAY,QAChB,IAAI,SAAS;;gBAGX,0CAA0C,CAsCtD;qBAtQoB,UAAU"}
@@ -0,0 +1,5 @@
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
@@ -0,0 +1 @@
1
+ {"version":3,"file":"merge.d.ts","sourceRoot":"","sources":["../../src/merge.js"],"names":[],"mappings":"AAWO,8BALI,IAAI,YAAY,QAChB,IAAI,SAAS,WACb,IAAI,SAAS,EAAE;UACG,IAAI,SAAS;mBAiCzC;qBAzCoB,UAAU"}
@@ -0,0 +1,51 @@
1
+ export const MaxKeyLength: 64;
2
+ export const MaxShardSize: number;
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?: Partial<API.ShardConfig> | undefined): 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
+ * @param {string} config.prefix
16
+ */
17
+ constructor({ cid, value, bytes, prefix }: {
18
+ cid: API.ShardLink;
19
+ value: API.Shard;
20
+ bytes: Uint8Array;
21
+ prefix: string;
22
+ });
23
+ prefix: string;
24
+ }
25
+ export function create(options?: Partial<API.ShardConfig> | undefined): API.Shard;
26
+ export function configure(options?: Partial<API.ShardConfig> | undefined): API.ShardConfig;
27
+ export function withEntries(entries: API.ShardEntry[], options?: Partial<API.ShardConfig> | undefined): API.Shard;
28
+ export function encodeBlock(value: API.Shard, prefix?: string | undefined): Promise<API.ShardBlockView>;
29
+ export function decodeBlock(bytes: Uint8Array, prefix?: string | undefined): Promise<API.ShardBlockView>;
30
+ export function isShard(value: any): value is API.Shard;
31
+ export function isShardLink(value: any): value is API.ShardLink;
32
+ export class ShardFetcher {
33
+ /** @param {API.BlockFetcher} blocks */
34
+ constructor(blocks: API.BlockFetcher);
35
+ _blocks: API.BlockFetcher;
36
+ /**
37
+ * @param {API.ShardLink} link
38
+ * @param {string} [prefix]
39
+ * @returns {Promise<API.ShardBlockView>}
40
+ */
41
+ get(link: API.ShardLink, prefix?: string | undefined): Promise<API.ShardBlockView>;
42
+ }
43
+ export function putEntry(target: API.ShardEntry[], newEntry: API.ShardEntry): API.ShardEntry[];
44
+ export function findCommonPrefix(entries: API.ShardEntry[], skey: string): {
45
+ prefix: string;
46
+ matches: API.ShardEntry[];
47
+ } | undefined;
48
+ export function encodedLength(shard: API.Shard): number;
49
+ import * as API from './api.js';
50
+ import { Block } from 'multiformats/block';
51
+ //# sourceMappingURL=shard.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"shard.d.ts","sourceRoot":"","sources":["../../src/shard.js"],"names":[],"mappings":"AASA,8BAA8B;AAC9B,kCAAsC;AAItC;;;GAGG;AACH,wEAFgB,GAAG,CAAC,cAAc;IAgBhC,0CAA0C;IAC1C,2FAEC;IAhBD;;;;;;OAMG;IACH;QALiC,GAAG,EAAzB,IAAI,SAAS;QACK,KAAK,EAAvB,IAAI,KAAK;QACU,KAAK,EAAxB,UAAU;QACK,MAAM,EAArB,MAAM;OAMhB;IADC,eAAoB;CAOvB;AAMM,wEAFM,IAAI,KAAK,CAEqD;AAMpE,2EAFM,IAAI,WAAW,CAK1B;AAOK,qCAJI,gBAAgB,mDAEd,IAAI,KAAK,CAE4D;AAU3E,mCAJI,IAAI,KAAK,gCAEP,QAAQ,IAAI,cAAc,CAAC,CAOvC;AAOM,mCAJI,UAAU,gCAER,QAAQ,IAAI,cAAc,CAAC,CAQvC;AAMM,+BAHI,GAAG,sBAQ0B;AAMjC,mCAHI,GAAG,0BAKe;AAE7B;IACE,uCAAuC;IACvC,oBADY,IAAI,YAAY,EAG3B;IADC,0BAAqB;IAGvB;;;;OAIG;IACH,UAJW,IAAI,SAAS,gCAEX,QAAQ,IAAI,cAAc,CAAC,CAMvC;CACF;AAOM,iCAJI,gBAAgB,6BAEd,gBAAgB,CAoD5B;AAMM,0CAHI,gBAAgB,QAChB,MAAM;;;cA0BhB;AAGM,qCADK,IAAI,KAAK,UAgBpB;qBA7NoB,UAAU;sBANO,oBAAoB"}
@@ -0,0 +1 @@
1
+ {"program":{"fileNames":["../node_modules/.pnpm/typescript@5.3.3/node_modules/typescript/lib/lib.es5.d.ts","../node_modules/.pnpm/typescript@5.3.3/node_modules/typescript/lib/lib.es2015.d.ts","../node_modules/.pnpm/typescript@5.3.3/node_modules/typescript/lib/lib.es2016.d.ts","../node_modules/.pnpm/typescript@5.3.3/node_modules/typescript/lib/lib.es2017.d.ts","../node_modules/.pnpm/typescript@5.3.3/node_modules/typescript/lib/lib.es2018.d.ts","../node_modules/.pnpm/typescript@5.3.3/node_modules/typescript/lib/lib.es2019.d.ts","../node_modules/.pnpm/typescript@5.3.3/node_modules/typescript/lib/lib.es2020.d.ts","../node_modules/.pnpm/typescript@5.3.3/node_modules/typescript/lib/lib.es2021.d.ts","../node_modules/.pnpm/typescript@5.3.3/node_modules/typescript/lib/lib.es2022.d.ts","../node_modules/.pnpm/typescript@5.3.3/node_modules/typescript/lib/lib.dom.d.ts","../node_modules/.pnpm/typescript@5.3.3/node_modules/typescript/lib/lib.dom.iterable.d.ts","../node_modules/.pnpm/typescript@5.3.3/node_modules/typescript/lib/lib.webworker.importscripts.d.ts","../node_modules/.pnpm/typescript@5.3.3/node_modules/typescript/lib/lib.scripthost.d.ts","../node_modules/.pnpm/typescript@5.3.3/node_modules/typescript/lib/lib.es2015.core.d.ts","../node_modules/.pnpm/typescript@5.3.3/node_modules/typescript/lib/lib.es2015.collection.d.ts","../node_modules/.pnpm/typescript@5.3.3/node_modules/typescript/lib/lib.es2015.generator.d.ts","../node_modules/.pnpm/typescript@5.3.3/node_modules/typescript/lib/lib.es2015.iterable.d.ts","../node_modules/.pnpm/typescript@5.3.3/node_modules/typescript/lib/lib.es2015.promise.d.ts","../node_modules/.pnpm/typescript@5.3.3/node_modules/typescript/lib/lib.es2015.proxy.d.ts","../node_modules/.pnpm/typescript@5.3.3/node_modules/typescript/lib/lib.es2015.reflect.d.ts","../node_modules/.pnpm/typescript@5.3.3/node_modules/typescript/lib/lib.es2015.symbol.d.ts","../node_modules/.pnpm/typescript@5.3.3/node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts","../node_modules/.pnpm/typescript@5.3.3/node_modules/typescript/lib/lib.es2016.array.include.d.ts","../node_modules/.pnpm/typescript@5.3.3/node_modules/typescript/lib/lib.es2017.date.d.ts","../node_modules/.pnpm/typescript@5.3.3/node_modules/typescript/lib/lib.es2017.object.d.ts","../node_modules/.pnpm/typescript@5.3.3/node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts","../node_modules/.pnpm/typescript@5.3.3/node_modules/typescript/lib/lib.es2017.string.d.ts","../node_modules/.pnpm/typescript@5.3.3/node_modules/typescript/lib/lib.es2017.intl.d.ts","../node_modules/.pnpm/typescript@5.3.3/node_modules/typescript/lib/lib.es2017.typedarrays.d.ts","../node_modules/.pnpm/typescript@5.3.3/node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts","../node_modules/.pnpm/typescript@5.3.3/node_modules/typescript/lib/lib.es2018.asynciterable.d.ts","../node_modules/.pnpm/typescript@5.3.3/node_modules/typescript/lib/lib.es2018.intl.d.ts","../node_modules/.pnpm/typescript@5.3.3/node_modules/typescript/lib/lib.es2018.promise.d.ts","../node_modules/.pnpm/typescript@5.3.3/node_modules/typescript/lib/lib.es2018.regexp.d.ts","../node_modules/.pnpm/typescript@5.3.3/node_modules/typescript/lib/lib.es2019.array.d.ts","../node_modules/.pnpm/typescript@5.3.3/node_modules/typescript/lib/lib.es2019.object.d.ts","../node_modules/.pnpm/typescript@5.3.3/node_modules/typescript/lib/lib.es2019.string.d.ts","../node_modules/.pnpm/typescript@5.3.3/node_modules/typescript/lib/lib.es2019.symbol.d.ts","../node_modules/.pnpm/typescript@5.3.3/node_modules/typescript/lib/lib.es2019.intl.d.ts","../node_modules/.pnpm/typescript@5.3.3/node_modules/typescript/lib/lib.es2020.bigint.d.ts","../node_modules/.pnpm/typescript@5.3.3/node_modules/typescript/lib/lib.es2020.date.d.ts","../node_modules/.pnpm/typescript@5.3.3/node_modules/typescript/lib/lib.es2020.promise.d.ts","../node_modules/.pnpm/typescript@5.3.3/node_modules/typescript/lib/lib.es2020.sharedmemory.d.ts","../node_modules/.pnpm/typescript@5.3.3/node_modules/typescript/lib/lib.es2020.string.d.ts","../node_modules/.pnpm/typescript@5.3.3/node_modules/typescript/lib/lib.es2020.symbol.wellknown.d.ts","../node_modules/.pnpm/typescript@5.3.3/node_modules/typescript/lib/lib.es2020.intl.d.ts","../node_modules/.pnpm/typescript@5.3.3/node_modules/typescript/lib/lib.es2020.number.d.ts","../node_modules/.pnpm/typescript@5.3.3/node_modules/typescript/lib/lib.es2021.promise.d.ts","../node_modules/.pnpm/typescript@5.3.3/node_modules/typescript/lib/lib.es2021.string.d.ts","../node_modules/.pnpm/typescript@5.3.3/node_modules/typescript/lib/lib.es2021.weakref.d.ts","../node_modules/.pnpm/typescript@5.3.3/node_modules/typescript/lib/lib.es2021.intl.d.ts","../node_modules/.pnpm/typescript@5.3.3/node_modules/typescript/lib/lib.es2022.array.d.ts","../node_modules/.pnpm/typescript@5.3.3/node_modules/typescript/lib/lib.es2022.error.d.ts","../node_modules/.pnpm/typescript@5.3.3/node_modules/typescript/lib/lib.es2022.intl.d.ts","../node_modules/.pnpm/typescript@5.3.3/node_modules/typescript/lib/lib.es2022.object.d.ts","../node_modules/.pnpm/typescript@5.3.3/node_modules/typescript/lib/lib.es2022.sharedmemory.d.ts","../node_modules/.pnpm/typescript@5.3.3/node_modules/typescript/lib/lib.es2022.string.d.ts","../node_modules/.pnpm/typescript@5.3.3/node_modules/typescript/lib/lib.es2022.regexp.d.ts","../node_modules/.pnpm/typescript@5.3.3/node_modules/typescript/lib/lib.decorators.d.ts","../node_modules/.pnpm/typescript@5.3.3/node_modules/typescript/lib/lib.decorators.legacy.d.ts","../node_modules/.pnpm/typescript@5.3.3/node_modules/typescript/lib/lib.es2022.full.d.ts","../node_modules/.pnpm/multiformats@12.1.3/node_modules/multiformats/dist/types/src/bases/interface.d.ts","../node_modules/.pnpm/multiformats@12.1.3/node_modules/multiformats/dist/types/src/hashes/interface.d.ts","../node_modules/.pnpm/multiformats@12.1.3/node_modules/multiformats/dist/types/src/link/interface.d.ts","../node_modules/.pnpm/multiformats@12.1.3/node_modules/multiformats/dist/types/src/cid.d.ts","../node_modules/.pnpm/multiformats@12.1.3/node_modules/multiformats/dist/types/src/block/interface.d.ts","../node_modules/.pnpm/multiformats@12.1.3/node_modules/multiformats/dist/types/src/codecs/interface.d.ts","../node_modules/.pnpm/multiformats@12.1.3/node_modules/multiformats/dist/types/src/interface.d.ts","../node_modules/.pnpm/multiformats@12.1.3/node_modules/multiformats/dist/types/src/hashes/digest.d.ts","../node_modules/.pnpm/multiformats@12.1.3/node_modules/multiformats/dist/types/src/hashes/hasher.d.ts","../node_modules/.pnpm/multiformats@12.1.3/node_modules/multiformats/dist/types/src/varint.d.ts","../node_modules/.pnpm/multiformats@12.1.3/node_modules/multiformats/dist/types/src/bytes.d.ts","../node_modules/.pnpm/multiformats@12.1.3/node_modules/multiformats/dist/types/src/index.d.ts","../node_modules/.pnpm/multiformats@12.1.3/node_modules/multiformats/dist/types/src/hashes/sha2.d.ts","../node_modules/.pnpm/multiformats@13.0.1/node_modules/multiformats/dist/src/bases/interface.d.ts","../node_modules/.pnpm/multiformats@13.0.1/node_modules/multiformats/dist/src/block/interface.d.ts","../node_modules/.pnpm/multiformats@13.0.1/node_modules/multiformats/dist/src/hashes/interface.d.ts","../node_modules/.pnpm/multiformats@13.0.1/node_modules/multiformats/dist/src/link/interface.d.ts","../node_modules/.pnpm/multiformats@13.0.1/node_modules/multiformats/dist/src/cid.d.ts","../node_modules/.pnpm/multiformats@13.0.1/node_modules/multiformats/dist/src/codecs/interface.d.ts","../node_modules/.pnpm/@ipld+dag-cbor@9.0.8/node_modules/@ipld/dag-cbor/dist/src/index.d.ts","../src/api.ts","../node_modules/.pnpm/multiformats@12.1.3/node_modules/multiformats/dist/types/src/link.d.ts","../src/block.js","../node_modules/.pnpm/multiformats@12.1.3/node_modules/multiformats/dist/types/src/block.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/length.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","../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"],"fileInfos":[{"version":"f33e5332b24c3773e930e212cbb8b6867c8ba3ec4492064ea78e55a524d57450","affectsGlobalScope":true},"45b7ab580deca34ae9729e97c13cfd999df04416a79116c3bfb483804f85ded4","26f2f787e82c4222710f3b676b4d83eb5ad0a72fa7b746f03449e7a026ce5073","9a68c0c07ae2fa71b44384a839b7b8d81662a236d4b9ac30916718f7510b1b2d","5e1c4c362065a6b95ff952c0eab010f04dcd2c3494e813b493ecfd4fcb9fc0d8","68d73b4a11549f9c0b7d352d10e91e5dca8faa3322bfb77b661839c42b1ddec7","5efce4fc3c29ea84e8928f97adec086e3dc876365e0982cc8479a07954a3efd4","feecb1be483ed332fad555aff858affd90a48ab19ba7272ee084704eb7167569","5514e54f17d6d74ecefedc73c504eadffdeda79c7ea205cf9febead32d45c4bc",{"version":"21e41a76098aa7a191028256e52a726baafd45a925ea5cf0222eb430c96c1d83","affectsGlobalScope":true},{"version":"35299ae4a62086698444a5aaee27fc7aa377c68cbb90b441c9ace246ffd05c97","affectsGlobalScope":true},{"version":"80e18897e5884b6723488d4f5652167e7bb5024f946743134ecc4aa4ee731f89","affectsGlobalScope":true},{"version":"cd034f499c6cdca722b60c04b5b1b78e058487a7085a8e0d6fb50809947ee573","affectsGlobalScope":true},{"version":"138fb588d26538783b78d1e3b2c2cc12d55840b97bf5e08bca7f7a174fbe2f17","affectsGlobalScope":true},{"version":"dc2df20b1bcdc8c2d34af4926e2c3ab15ffe1160a63e58b7e09833f616efff44","affectsGlobalScope":true},{"version":"4443e68b35f3332f753eacc66a04ac1d2053b8b035a0e0ac1d455392b5e243b3","affectsGlobalScope":true},{"version":"bc47685641087c015972a3f072480889f0d6c65515f12bd85222f49a98952ed7","affectsGlobalScope":true},{"version":"0dc1e7ceda9b8b9b455c3a2d67b0412feab00bd2f66656cd8850e8831b08b537","affectsGlobalScope":true},{"version":"ce691fb9e5c64efb9547083e4a34091bcbe5bdb41027e310ebba8f7d96a98671","affectsGlobalScope":true},{"version":"8d697a2a929a5fcb38b7a65594020fcef05ec1630804a33748829c5ff53640d0","affectsGlobalScope":true},{"version":"4ff2a353abf8a80ee399af572debb8faab2d33ad38c4b4474cff7f26e7653b8d","affectsGlobalScope":true},{"version":"93495ff27b8746f55d19fcbcdbaccc99fd95f19d057aed1bd2c0cafe1335fbf0","affectsGlobalScope":true},{"version":"6fc23bb8c3965964be8c597310a2878b53a0306edb71d4b5a4dfe760186bcc01","affectsGlobalScope":true},{"version":"38f0219c9e23c915ef9790ab1d680440d95419ad264816fa15009a8851e79119","affectsGlobalScope":true},{"version":"bb42a7797d996412ecdc5b2787720de477103a0b2e53058569069a0e2bae6c7e","affectsGlobalScope":true},{"version":"4738f2420687fd85629c9efb470793bb753709c2379e5f85bc1815d875ceadcd","affectsGlobalScope":true},{"version":"2f11ff796926e0832f9ae148008138ad583bd181899ab7dd768a2666700b1893","affectsGlobalScope":true},{"version":"4de680d5bb41c17f7f68e0419412ca23c98d5749dcaaea1896172f06435891fc","affectsGlobalScope":true},{"version":"9fc46429fbe091ac5ad2608c657201eb68b6f1b8341bd6d670047d32ed0a88fa","affectsGlobalScope":true},{"version":"61c37c1de663cf4171e1192466e52c7a382afa58da01b1dc75058f032ddf0839","affectsGlobalScope":true},{"version":"b541a838a13f9234aba650a825393ffc2292dc0fc87681a5d81ef0c96d281e7a","affectsGlobalScope":true},{"version":"e0275cd0e42990dc3a16f0b7c8bca3efe87f1c8ad404f80c6db1c7c0b828c59f","affectsGlobalScope":true},{"version":"811ec78f7fefcabbda4bfa93b3eb67d9ae166ef95f9bff989d964061cbf81a0c","affectsGlobalScope":true},{"version":"717937616a17072082152a2ef351cb51f98802fb4b2fdabd32399843875974ca","affectsGlobalScope":true},{"version":"d7e7d9b7b50e5f22c915b525acc5a49a7a6584cf8f62d0569e557c5cfc4b2ac2","affectsGlobalScope":true},{"version":"71c37f4c9543f31dfced6c7840e068c5a5aacb7b89111a4364b1d5276b852557","affectsGlobalScope":true},{"version":"576711e016cf4f1804676043e6a0a5414252560eb57de9faceee34d79798c850","affectsGlobalScope":true},{"version":"89c1b1281ba7b8a96efc676b11b264de7a8374c5ea1e6617f11880a13fc56dc6","affectsGlobalScope":true},{"version":"49ed889be54031e1044af0ad2c603d627b8bda8b50c1a68435fe85583901d072","affectsGlobalScope":true},{"version":"e93d098658ce4f0c8a0779e6cab91d0259efb88a318137f686ad76f8410ca270","affectsGlobalScope":true},{"version":"063600664504610fe3e99b717a1223f8b1900087fab0b4cad1496a114744f8df","affectsGlobalScope":true},{"version":"934019d7e3c81950f9a8426d093458b65d5aff2c7c1511233c0fd5b941e608ab","affectsGlobalScope":true},{"version":"bf14a426dbbf1022d11bd08d6b8e709a2e9d246f0c6c1032f3b2edb9a902adbe","affectsGlobalScope":true},{"version":"ec0104fee478075cb5171e5f4e3f23add8e02d845ae0165bfa3f1099241fa2aa","affectsGlobalScope":true},{"version":"2b72d528b2e2fe3c57889ca7baef5e13a56c957b946906d03767c642f386bbc3","affectsGlobalScope":true},{"version":"acae90d417bee324b1372813b5a00829d31c7eb670d299cd7f8f9a648ac05688","affectsGlobalScope":true},{"version":"368af93f74c9c932edd84c58883e736c9e3d53cec1fe24c0b0ff451f529ceab1","affectsGlobalScope":true},{"version":"af3dd424cf267428f30ccfc376f47a2c0114546b55c44d8c0f1d57d841e28d74","affectsGlobalScope":true},{"version":"995c005ab91a498455ea8dfb63aa9f83fa2ea793c3d8aa344be4a1678d06d399","affectsGlobalScope":true},{"version":"51e547984877a62227042850456de71a5c45e7fe86b7c975c6e68896c86fa23b","affectsGlobalScope":true},{"version":"62a4966981264d1f04c44eb0f4b5bdc3d81c1a54725608861e44755aa24ad6a5","affectsGlobalScope":true},{"version":"4fa6ed14e98aa80b91f61b9805c653ee82af3502dc21c9da5268d3857772ca05","affectsGlobalScope":true},{"version":"e6633e05da3ff36e6da2ec170d0d03ccf33de50ca4dc6f5aeecb572cedd162fb","affectsGlobalScope":true},{"version":"86a34c7a13de9cabc43161348f663624b56871ed80986e41d214932ddd8d6719","affectsGlobalScope":true},{"version":"8444af78980e3b20b49324f4a16ba35024fef3ee069a0eb67616ea6ca821c47a","affectsGlobalScope":true},{"version":"caccc56c72713969e1cfe5c3d44e5bab151544d9d2b373d7dbe5a1e4166652be","affectsGlobalScope":true},{"version":"3287d9d085fbd618c3971944b65b4be57859f5415f495b33a6adc994edd2f004","affectsGlobalScope":true},{"version":"50d53ccd31f6667aff66e3d62adf948879a3a16f05d89882d1188084ee415bbc","affectsGlobalScope":true},{"version":"33358442698bb565130f52ba79bfd3d4d484ac85fe33f3cb1759c54d18201393","affectsGlobalScope":true},{"version":"782dec38049b92d4e85c1585fbea5474a219c6984a35b004963b00beb1aab538","affectsGlobalScope":true},"1df2366de6650547b3dc1d7c4147355c0f6b4729c964e3839636fa418982d131","f997c5be1eb27b8c37d50d3f61fc5671fb79efd80c499e0e16b5d56c32182f8d","0828334538f604701c9dd0bf54abb758803f9efb4acb4aedd9b18acde4b1bcdf","552223520e823223ee13c5764e9b69b1819c985818a8bcda435d8d1dbd909bee","671efcb4cb21897b43dec53d0218afcac3d1e13c7d50158b0c1a0b300acdb69e","e68d682c8224a5c2e5f5e3720537cec720c41a829e1367316ea9acf6fec48ecc","f9e46527ef7833f803a47c256179c05e5149a8dc776c5a6952572052c9e00b24","557b8c7481296f4b7ed362320f3bbb40bb87404edf880c81224f365a8d1e17f3","467a7c09abfde00a7fc41d06c1c599f01e944c9f4948d38a0bde82b766a7e364","7697d44896d7082a0195b088b1a5c49bb70aea87721448982bee34720cfa73f4","77c738b0671d324f6cb2c7c1d7dfc0282a5836c67af55c9ba6df315c62207f57","f2dc47a6b115cd100153d2aaa3dbec094e7a55c5e471c9df8cf7fd651925d63f","2d57b5c1d1ef4cf78480539c0e0650af78ccf387d95f0585b12dbd658691a30f","5b563db2a9fdba4950d49351dae9909146ca93bec867e748754d255769e169e0","4a3605bef1a5ef29fd5a1696dd95b0b4e2259e2d07a4d88fac79f3a9765c44a2","d3df79602ca0303c65d2197c9e71222db97a4a0e5a691bdab49a65f83397558f","90240231e730deed31569f6c686766a538e4a024bbc33ea1738fe924f477ba61","552223520e823223ee13c5764e9b69b1819c985818a8bcda435d8d1dbd909bee","49b7c3ddd683c09aa437dd92681699387441f522524b14d2331ce494a9bf2f27","f9e46527ef7833f803a47c256179c05e5149a8dc776c5a6952572052c9e00b24","096e5d8e4e2faca903221837f5c249153aa5d98405d4150bd41e54f7efbc8929",{"version":"0edd12211684abc8d60719241bc1c0a178f32413f319f5b81e27cc515ab12c5c","signature":"5f6f0c2f504a3fd3628abf2d0657fbe2e37ed8059f68757eb089ce35adc32f1b"},"894510c4bac920c0ffbdc60e3743438be522c3f2bc029367aaae438b7ecee16b",{"version":"3c60343b48438de7de857209f3272804f325705e05945d0b5c6b77d8c0b91271","signature":"6bb7ea47ab2fdff568fb0958e303868ab4d62acc1c8de4d4633d0ee767de7d8d"},"dfd8fa0db9817c18d04f46d320051bf96638e0ef03b732c1abedf7b00337f0e6","0e84a640a449bd767be2ebebf4acf7cac1b1f92e72941b30d370ca0c8f1a30b3","a32c2dd5736b27da05ddf1034df28c75e8db3ef26effe60df4bd608f5c7a03d8","f65fb2149519d5e7cdf1245e0d5e5c6369855d9f14cfd1da9a678750da3f3fe6","346a9400fd471109354689e5dc93384e56e7a33d0c3ce05e7d5901380f4dc6ce","15f502c247a60ad85c2a87635e7b0a71701a7f6d75fecba0f541e2b28d66f6fd","730fedb3e76078f11d9a8a595c3f337dadfb1c687810999b02394e853b668c5a","babe35042b7448cb38bbc24c357a358c5e1e71d2692a818f21a8550340e41329",{"version":"87400e2622608e49974ce16867e2f8fc6413e08172594a8620b027c2649a9971","signature":"73409439c0ea0c6c6b0d47d3caef6053678d81e4528ee9a77516478f602e7092"},{"version":"305ec608b339faf40414803f6bd066c667b24cd20851cdd3297a76cd692acd38","signature":"e6670b4952693ae74bb8d2228b8257d1736ebb058d6312ba3feea52c9da4ef98"},{"version":"b5d8997faf430ccf8b7821108fdf0a4a9027b5bc54153b6242354a8d573e2070","signature":"ed062bf7a44961474312776691fef0f3fb9c1b26a69ffff27c80073db0311353"},{"version":"229faf86cd68a721d11b73a0b398ee241a57172cb3eef98351fa6adc4ed96aec","signature":"6bfa5af024804ea22f15370d2feb92958199fd3827bc97bf0487d29fb488925f"},{"version":"755c81b4020b74b08ee753e352c302b8af4e96e87b82cfafdb8ee5bb583f5056","signature":"d284155626e041407da87b191b56bdebee51d13fe52333b62c8b5c4a1fa02bd8"},{"version":"b6db814b4505af29f58207309fa6dcd03d4a86890699bbcc9dd83889f5158db8","signature":"d5a68a94dc567b806248a014e5267fe7f47c62048b91824581efd4aee7c67e02"},{"version":"c8ffe5cd16d2f59146d433754d391888b74bae980a3717ad8d0199c025fe6121","signature":"34ce54a41b59354e167390b4db48112a2a2daf5a79c6c6a740c09f9b7dbc3e0c"},{"version":"634e303df54ddd9c2e20bce6784a7fef1ea06183d75161fbf57e3324d4d6f07e","signature":"de94446f7a45df1aa8cfbe6aba6041f18551e6cee0067f29ecbe8615baf45360"},{"version":"bd4cfdbc64a9244f1eb14763036e56a912c20bc122ccb5d65ef74e549a0e3ac8","signature":"8404e591edea1a6f802f4099ced1c87a143250519ae18e88be1d8bf0eaf6ace5"},{"version":"9cb65f8ee81b46b10869cb3640f3dc1c377e9830b73fd93f97991230e3b3e0b2","signature":"d65e247691eef67fc9b388fd2f73ba1d42c0a756ce0a6f1e4bf34aa8544017be"},{"version":"20e2f5c83e426e0665b2de8e00f57f736031644150965aeca80237b96d287293","signature":"18951b384763db13a5f0597e5ee1fa141e36fd80323938471e69e954c434818c"},{"version":"6e6ed3848a3f096cf172b6e81d2218b6f95f37772822cf749850271008e0a0b3","signature":"39eaa64d9ce59d3a874d8f8d738db4428f23f1983b0aa99e0fefdcaf6ec5f9ae"},{"version":"a20f6bbe256e1de5d724c37fd4f4054abcf7a5b1402bab81a8ddfa52783422a6","signature":"c69bc379f337d1e362506c4b44d64004801262c7b4c6ee280a131c86eb1ced15"}],"root":[82,84,[93,105]],"options":{"allowJs":true,"checkJs":true,"composite":true,"declarationMap":true,"emitDeclarationOnly":true,"esModuleInterop":true,"module":7,"outDir":"./","skipLibCheck":true,"strict":true,"target":9},"fileIdsList":[[79,80],[86,88,90,91],[86,87],[86,88],[88],[68,73],[64,65],[64],[66],[63],[63,69],[70],[65,68,69,70,71,72],[62,63,64,66,67],[62,63,66],[78,79],[78],[76],[75,76,77],[73,74,81],[82],[93,97,98],[93,97],[73,82,83],[73,82],[73,74,81,85,100],[82,100],[97,102],[84,93,99,101,103,104],[84,93,95,99,101,102],[82,93],[82,94,95],[74,81,82,83,85,89,92]],"referencedMap":[[81,1],[92,2],[88,3],[90,4],[91,5],[89,5],[85,6],[66,7],[65,8],[67,9],[69,10],[70,11],[74,12],[73,13],[68,14],[83,7],[64,15],[76,16],[79,17],[80,18],[78,19],[82,20],[97,21],[99,22],[98,23],[84,24],[100,25],[101,26],[102,27],[104,28],[105,29],[103,30],[94,31],[95,31],[96,32],[93,33]],"exportedModulesMap":[[81,1],[92,2],[88,3],[90,4],[91,5],[89,5],[85,6],[66,7],[65,8],[67,9],[69,10],[70,11],[74,12],[73,13],[68,14],[83,7],[64,15],[76,16],[79,17],[80,18],[78,19],[82,20],[97,21],[99,25],[100,25],[102,27],[104,28],[103,25]],"semanticDiagnosticsPerFile":[81,92,88,87,90,91,89,86,62,85,66,72,65,67,69,70,63,74,73,68,83,64,71,75,76,79,80,77,78,59,60,10,11,15,14,2,16,17,18,19,20,21,22,23,3,4,24,28,25,26,27,29,30,31,5,32,33,34,35,6,39,36,37,38,40,7,41,46,47,42,43,44,45,8,51,48,49,50,52,9,53,61,54,55,58,56,57,1,13,12,82,97,99,98,84,100,101,102,104,105,103,94,95,96,93],"latestChangedDtsFile":"./src/crdt/batch/index.d.ts"},"version":"5.3.3"}
package/package.json ADDED
@@ -0,0 +1,174 @@
1
+ {
2
+ "name": "@web3-storage/pail",
3
+ "version": "0.4.0",
4
+ "description": "DAG based key value store.",
5
+ "main": "src/index.js",
6
+ "type": "module",
7
+ "types": "./dist/src/index.d.ts",
8
+ "typesVersions": {
9
+ "*": {
10
+ "*": [
11
+ "dist/*"
12
+ ],
13
+ "dist/src/index.d.ts": [
14
+ "dist/src/index.d.ts"
15
+ ],
16
+ "api": [
17
+ "dist/src/api.d.ts"
18
+ ],
19
+ "batch": [
20
+ "dist/src/batch/index.d.ts"
21
+ ],
22
+ "batch/api": [
23
+ "dist/src/batch/api.d.ts"
24
+ ],
25
+ "block": [
26
+ "dist/src/block.d.ts"
27
+ ],
28
+ "clock": [
29
+ "dist/src/clock/index.d.ts"
30
+ ],
31
+ "clock/api": [
32
+ "dist/src/clock/api.d.ts"
33
+ ],
34
+ "crdt": [
35
+ "dist/src/crdt/index.d.ts"
36
+ ],
37
+ "crdt/api": [
38
+ "dist/src/crdt/api.d.ts"
39
+ ],
40
+ "crdt/batch": [
41
+ "dist/src/crdt/batch/index.d.ts"
42
+ ],
43
+ "crdt/batch/api": [
44
+ "dist/src/crdt/batch/api.d.ts"
45
+ ],
46
+ "diff": [
47
+ "dist/src/diff.d.ts"
48
+ ],
49
+ "link": [
50
+ "dist/src/link.d.ts"
51
+ ],
52
+ "merge": [
53
+ "dist/src/merge.d.ts"
54
+ ],
55
+ "shard": [
56
+ "dist/src/shard.d.ts"
57
+ ]
58
+ }
59
+ },
60
+ "exports": {
61
+ ".": {
62
+ "types": "./dist/src/index.d.ts",
63
+ "import": "./src/index.js"
64
+ },
65
+ "./api": {
66
+ "types": "./dist/src/api.d.ts",
67
+ "import": "./src/api.js"
68
+ },
69
+ "./batch": {
70
+ "types": "./dist/src/batch/index.d.ts",
71
+ "import": "./src/batch/index.js"
72
+ },
73
+ "./batch/api": {
74
+ "types": "./dist/src/batch/api.d.ts",
75
+ "import": "./src/batch/api.js"
76
+ },
77
+ "./block": {
78
+ "types": "./dist/src/block.d.ts",
79
+ "import": "./src/block.js"
80
+ },
81
+ "./clock": {
82
+ "types": "./dist/src/clock/index.d.ts",
83
+ "import": "./src/clock/index.js"
84
+ },
85
+ "./clock/api": {
86
+ "types": "./dist/src/clock/api.d.ts",
87
+ "import": "./src/clock/api.js"
88
+ },
89
+ "./crdt": {
90
+ "types": "./dist/src/crdt/index.d.ts",
91
+ "import": "./src/crdt/index.js"
92
+ },
93
+ "./crdt/api": {
94
+ "types": "./dist/src/crdt/api.d.ts",
95
+ "import": "./src/crdt/api.js"
96
+ },
97
+ "./crdt/batch": {
98
+ "types": "./dist/src/crdt/batch/index.d.ts",
99
+ "import": "./src/crdt/batch/index.js"
100
+ },
101
+ "./crdt/batch/api": {
102
+ "types": "./dist/src/crdt/batch/api.d.ts",
103
+ "import": "./src/crdt/batch/api.js"
104
+ },
105
+ "./diff": {
106
+ "types": "./dist/src/diff.d.ts",
107
+ "import": "./src/diff.js"
108
+ },
109
+ "./link": {
110
+ "types": "./dist/src/link.d.ts",
111
+ "import": "./src/link.js"
112
+ },
113
+ "./merge": {
114
+ "types": "./dist/src/merge.d.ts",
115
+ "import": "./src/merge.js"
116
+ },
117
+ "./shard": {
118
+ "types": "./dist/src/shard.d.ts",
119
+ "import": "./src/shard.js"
120
+ }
121
+ },
122
+ "bin": {
123
+ "pail": "./cli.js"
124
+ },
125
+ "keywords": [
126
+ "bucket",
127
+ "KV",
128
+ "DAG",
129
+ "IPLD",
130
+ "CID",
131
+ "IPFS"
132
+ ],
133
+ "author": "Alan Shaw",
134
+ "license": "Apache-2.0 OR MIT",
135
+ "files": [
136
+ "src",
137
+ "dist"
138
+ ],
139
+ "dependencies": {
140
+ "@ipld/car": "^5.2.4",
141
+ "@ipld/dag-cbor": "^9.0.6",
142
+ "archy": "^1.0.0",
143
+ "cborg": "^4.0.7",
144
+ "cli-color": "^2.0.3",
145
+ "multiformats": "^12.1.3",
146
+ "sade": "^1.8.1"
147
+ },
148
+ "devDependencies": {
149
+ "c8": "^8.0.1",
150
+ "mocha": "^10.2.0",
151
+ "nanoid": "^4.0.0",
152
+ "standard": "^17.0.0",
153
+ "typescript": "^5.0.2"
154
+ },
155
+ "repository": {
156
+ "type": "git",
157
+ "url": "git+https://github.com/web3-storage/pail.git"
158
+ },
159
+ "bugs": {
160
+ "url": "https://github.com/web3-storage/pail/issues"
161
+ },
162
+ "homepage": "https://github.com/web3-storage/pail#readme",
163
+ "standard": {
164
+ "ignore": [
165
+ "*.ts"
166
+ ]
167
+ },
168
+ "scripts": {
169
+ "build": "tsc --build",
170
+ "test": "mocha test/*.test.js",
171
+ "coverage": "c8 -r html -r text npm test",
172
+ "lint": "standard"
173
+ }
174
+ }
package/src/api.js ADDED
@@ -0,0 +1 @@
1
+ export {}