@atproto/repo 0.2.0 → 0.3.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 (79) hide show
  1. package/dist/data-diff.d.ts +11 -9
  2. package/dist/index.d.ts +0 -1
  3. package/dist/index.js +404 -1655
  4. package/dist/index.js.map +4 -4
  5. package/dist/mst/mst.d.ts +10 -6
  6. package/dist/readable-repo.d.ts +1 -1
  7. package/dist/repo.d.ts +1 -4
  8. package/dist/storage/index.d.ts +0 -1
  9. package/dist/storage/memory-blockstore.d.ts +7 -12
  10. package/dist/storage/types.d.ts +28 -0
  11. package/dist/sync/consumer.d.ts +13 -17
  12. package/dist/sync/provider.d.ts +1 -5
  13. package/dist/types.d.ts +228 -39
  14. package/dist/util.d.ts +3 -5
  15. package/package.json +2 -2
  16. package/src/data-diff.ts +46 -44
  17. package/src/index.ts +0 -1
  18. package/src/mst/diff.ts +14 -36
  19. package/src/mst/mst.ts +14 -4
  20. package/src/readable-repo.ts +3 -3
  21. package/src/repo.ts +49 -70
  22. package/src/storage/index.ts +0 -1
  23. package/src/storage/memory-blockstore.ts +18 -77
  24. package/src/storage/types.ts +29 -0
  25. package/src/sync/consumer.ts +170 -116
  26. package/src/sync/provider.ts +2 -40
  27. package/src/types.ts +49 -23
  28. package/src/util.ts +24 -79
  29. package/tests/_util.ts +38 -67
  30. package/tests/mst.test.ts +4 -1
  31. package/tests/{sync/narrow.test.ts → proofs.test.ts} +9 -20
  32. package/tests/repo.test.ts +5 -4
  33. package/tests/sync.test.ts +97 -0
  34. package/tsconfig.build.tsbuildinfo +1 -1
  35. package/dist/src/block-map.d.ts +0 -23
  36. package/dist/src/blockstore/index.d.ts +0 -2
  37. package/dist/src/blockstore/ipld-store.d.ts +0 -27
  38. package/dist/src/blockstore/memory-blockstore.d.ts +0 -13
  39. package/dist/src/blockstore/persistent-blockstore.d.ts +0 -12
  40. package/dist/src/cid-set.d.ts +0 -14
  41. package/dist/src/collection.d.ts +0 -22
  42. package/dist/src/data-diff.d.ts +0 -34
  43. package/dist/src/error.d.ts +0 -21
  44. package/dist/src/index.d.ts +0 -7
  45. package/dist/src/logger.d.ts +0 -2
  46. package/dist/src/mst/diff.d.ts +0 -33
  47. package/dist/src/mst/index.d.ts +0 -4
  48. package/dist/src/mst/mst.d.ts +0 -106
  49. package/dist/src/mst/util.d.ts +0 -9
  50. package/dist/src/mst/walker.d.ts +0 -22
  51. package/dist/src/parse.d.ts +0 -11
  52. package/dist/src/readable-repo.d.ts +0 -25
  53. package/dist/src/repo.d.ts +0 -39
  54. package/dist/src/storage/error.d.ts +0 -22
  55. package/dist/src/storage/index.d.ts +0 -1
  56. package/dist/src/storage/memory-blobstore.d.ts +0 -1
  57. package/dist/src/storage/memory-blockstore.d.ts +0 -28
  58. package/dist/src/storage/readable-blockstore.d.ts +0 -21
  59. package/dist/src/storage/repo-storage.d.ts +0 -18
  60. package/dist/src/storage/sync-storage.d.ts +0 -15
  61. package/dist/src/storage/types.d.ts +0 -12
  62. package/dist/src/storage/util.d.ts +0 -17
  63. package/dist/src/structure.d.ts +0 -39
  64. package/dist/src/sync/consumer.d.ts +0 -19
  65. package/dist/src/sync/index.d.ts +0 -2
  66. package/dist/src/sync/producer.d.ts +0 -13
  67. package/dist/src/sync/provider.d.ts +0 -11
  68. package/dist/src/sync.d.ts +0 -9
  69. package/dist/src/types.d.ts +0 -368
  70. package/dist/src/util.d.ts +0 -13
  71. package/dist/src/verify.d.ts +0 -5
  72. package/dist/storage/repo-storage.d.ts +0 -19
  73. package/dist/tsconfig.build.tsbuildinfo +0 -1
  74. package/dist/verify.d.ts +0 -32
  75. package/src/storage/repo-storage.ts +0 -43
  76. package/src/verify.ts +0 -268
  77. package/tests/rebase.test.ts +0 -37
  78. package/tests/sync/checkout.test.ts +0 -75
  79. package/tests/sync/diff.test.ts +0 -92
@@ -1,23 +1,25 @@
1
1
  import { CID } from 'multiformats';
2
2
  import CidSet from './cid-set';
3
- import { MST } from './mst';
3
+ import { MST, NodeEntry } from './mst';
4
+ import BlockMap from './block-map';
4
5
  export declare class DataDiff {
5
6
  adds: Record<string, DataAdd>;
6
7
  updates: Record<string, DataUpdate>;
7
8
  deletes: Record<string, DataDelete>;
8
- newCids: CidSet;
9
+ newMstBlocks: BlockMap;
10
+ newLeafCids: CidSet;
9
11
  removedCids: CidSet;
10
12
  static of(curr: MST, prev: MST | null): Promise<DataDiff>;
11
- recordAdd(key: string, cid: CID): void;
12
- recordUpdate(key: string, prev: CID, cid: CID): void;
13
- recordDelete(key: string, cid: CID): void;
14
- recordNewCid(cid: CID): void;
15
- recordRemovedCid(cid: CID): void;
16
- addDiff(diff: DataDiff): void;
13
+ nodeAdd(node: NodeEntry): Promise<void>;
14
+ nodeDelete(node: NodeEntry): Promise<void>;
15
+ leafAdd(key: string, cid: CID): void;
16
+ leafUpdate(key: string, prev: CID, cid: CID): void;
17
+ leafDelete(key: string, cid: CID): void;
18
+ treeAdd(cid: CID, bytes: Uint8Array): void;
19
+ treeDelete(cid: CID): void;
17
20
  addList(): DataAdd[];
18
21
  updateList(): DataUpdate[];
19
22
  deleteList(): DataDelete[];
20
- newCidList(): CID[];
21
23
  updatedKeys(): string[];
22
24
  }
23
25
  export declare type DataAdd = {
package/dist/index.d.ts CHANGED
@@ -5,6 +5,5 @@ export * from './mst';
5
5
  export * from './storage';
6
6
  export * from './sync';
7
7
  export * from './types';
8
- export * from './verify';
9
8
  export * from './data-diff';
10
9
  export * from './util';