@atproto/repo 0.1.0 → 0.2.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 (77) hide show
  1. package/dist/block-map.d.ts +2 -0
  2. package/dist/data-diff.d.ts +2 -2
  3. package/dist/index.d.ts +1 -0
  4. package/dist/index.js +12090 -2882
  5. package/dist/index.js.map +4 -4
  6. package/dist/mst/mst.d.ts +13 -14
  7. package/dist/readable-repo.d.ts +4 -3
  8. package/dist/repo.d.ts +6 -2
  9. package/dist/src/block-map.d.ts +23 -0
  10. package/dist/src/blockstore/persistent-blockstore.d.ts +12 -0
  11. package/dist/src/cid-set.d.ts +14 -0
  12. package/dist/src/collection.d.ts +22 -0
  13. package/dist/src/data-diff.d.ts +34 -0
  14. package/dist/src/error.d.ts +21 -0
  15. package/dist/src/index.d.ts +7 -0
  16. package/dist/src/logger.d.ts +2 -0
  17. package/dist/src/mst/diff.d.ts +33 -0
  18. package/dist/src/mst/index.d.ts +4 -0
  19. package/dist/src/mst/mst.d.ts +106 -0
  20. package/dist/src/mst/util.d.ts +9 -0
  21. package/dist/src/mst/walker.d.ts +22 -0
  22. package/dist/src/parse.d.ts +11 -0
  23. package/dist/src/readable-repo.d.ts +25 -0
  24. package/dist/src/repo.d.ts +39 -0
  25. package/dist/src/storage/error.d.ts +22 -0
  26. package/dist/src/storage/index.d.ts +1 -0
  27. package/dist/src/storage/memory-blobstore.d.ts +1 -0
  28. package/dist/src/storage/memory-blockstore.d.ts +28 -0
  29. package/dist/src/storage/readable-blockstore.d.ts +21 -0
  30. package/dist/src/storage/repo-storage.d.ts +18 -0
  31. package/dist/src/storage/sync-storage.d.ts +15 -0
  32. package/dist/src/storage/types.d.ts +12 -0
  33. package/dist/src/storage/util.d.ts +17 -0
  34. package/dist/src/structure.d.ts +39 -0
  35. package/dist/src/sync/consumer.d.ts +19 -0
  36. package/dist/src/sync/index.d.ts +2 -0
  37. package/dist/src/sync/producer.d.ts +13 -0
  38. package/dist/src/sync/provider.d.ts +11 -0
  39. package/dist/src/types.d.ts +368 -0
  40. package/dist/src/util.d.ts +13 -0
  41. package/dist/src/verify.d.ts +5 -0
  42. package/dist/storage/memory-blockstore.d.ts +2 -1
  43. package/dist/storage/repo-storage.d.ts +2 -1
  44. package/dist/storage/types.d.ts +1 -0
  45. package/dist/sync/consumer.d.ts +1 -0
  46. package/dist/sync/provider.d.ts +4 -4
  47. package/dist/tsconfig.build.tsbuildinfo +1 -0
  48. package/dist/types.d.ts +30 -31
  49. package/dist/util.d.ts +6 -2
  50. package/dist/verify.d.ts +6 -1
  51. package/jest.bench.config.js +2 -1
  52. package/package.json +11 -6
  53. package/src/block-map.ts +8 -0
  54. package/src/data-diff.ts +2 -6
  55. package/src/index.ts +1 -0
  56. package/src/mst/mst.ts +1 -10
  57. package/src/readable-repo.ts +3 -3
  58. package/src/repo.ts +33 -2
  59. package/src/storage/memory-blockstore.ts +20 -1
  60. package/src/storage/repo-storage.ts +2 -1
  61. package/src/storage/types.ts +1 -0
  62. package/src/sync/consumer.ts +4 -1
  63. package/src/sync/provider.ts +11 -11
  64. package/src/types.ts +19 -21
  65. package/src/util.ts +34 -13
  66. package/src/verify.ts +52 -11
  67. package/tests/rebase.test.ts +37 -0
  68. package/tests/sync/checkout.test.ts +21 -3
  69. package/tests/sync/diff.test.ts +9 -4
  70. package/tests/sync/narrow.test.ts +8 -4
  71. package/tests/util.test.ts +21 -0
  72. package/tsconfig.build.tsbuildinfo +1 -1
  73. package/tsconfig.json +1 -1
  74. /package/dist/{blockstore → src/blockstore}/index.d.ts +0 -0
  75. /package/dist/{blockstore → src/blockstore}/ipld-store.d.ts +0 -0
  76. /package/dist/{blockstore → src/blockstore}/memory-blockstore.d.ts +0 -0
  77. /package/dist/{sync.d.ts → src/sync.d.ts} +0 -0
@@ -5,6 +5,7 @@ export declare class BlockMap {
5
5
  add(value: LexValue): Promise<CID>;
6
6
  set(cid: CID, bytes: Uint8Array): void;
7
7
  get(cid: CID): Uint8Array | undefined;
8
+ delete(cid: CID): void;
8
9
  getMany(cids: CID[]): {
9
10
  blocks: BlockMap;
10
11
  missing: CID[];
@@ -13,6 +14,7 @@ export declare class BlockMap {
13
14
  clear(): void;
14
15
  forEach(cb: (bytes: Uint8Array, cid: CID) => void): void;
15
16
  entries(): Entry[];
17
+ cids(): CID[];
16
18
  addMap(toAdd: BlockMap): void;
17
19
  get size(): number;
18
20
  get byteSize(): number;
@@ -1,13 +1,13 @@
1
1
  import { CID } from 'multiformats';
2
2
  import CidSet from './cid-set';
3
- import { DataStore } from './types';
3
+ import { MST } from './mst';
4
4
  export declare class DataDiff {
5
5
  adds: Record<string, DataAdd>;
6
6
  updates: Record<string, DataUpdate>;
7
7
  deletes: Record<string, DataDelete>;
8
8
  newCids: CidSet;
9
9
  removedCids: CidSet;
10
- static of(curr: DataStore, prev: DataStore | null): Promise<DataDiff>;
10
+ static of(curr: MST, prev: MST | null): Promise<DataDiff>;
11
11
  recordAdd(key: string, cid: CID): void;
12
12
  recordUpdate(key: string, prev: CID, cid: CID): void;
13
13
  recordDelete(key: string, cid: CID): void;
package/dist/index.d.ts CHANGED
@@ -6,4 +6,5 @@ export * from './storage';
6
6
  export * from './sync';
7
7
  export * from './types';
8
8
  export * from './verify';
9
+ export * from './data-diff';
9
10
  export * from './util';