@atcute/car 1.0.1 → 1.1.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.
- package/README.md +1 -1
- package/dist/atproto-repo.d.ts +3 -1
- package/dist/atproto-repo.js +3 -1
- package/dist/atproto-repo.js.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/dist/reader.d.ts +8 -0
- package/dist/reader.js +3 -1
- package/dist/reader.js.map +1 -1
- package/package.json +3 -3
package/README.md
CHANGED
package/dist/atproto-repo.d.ts
CHANGED
|
@@ -7,6 +7,8 @@ export declare class RepoEntry {
|
|
|
7
7
|
constructor(collection: string, rkey: string, cid: CBOR.CIDLink, blockmap: BlockMap);
|
|
8
8
|
get record(): unknown;
|
|
9
9
|
}
|
|
10
|
-
export declare function
|
|
10
|
+
export declare function iterateAtpRepo(buf: Uint8Array): Generator<RepoEntry>;
|
|
11
|
+
/** @deprecated Use `iterateAtpRepo` instead */
|
|
12
|
+
export declare const iterateAtpCar: typeof iterateAtpRepo;
|
|
11
13
|
type BlockMap = Map<string, Uint8Array>;
|
|
12
14
|
export {};
|
package/dist/atproto-repo.js
CHANGED
|
@@ -17,7 +17,7 @@ export class RepoEntry {
|
|
|
17
17
|
return readObject(this.blockmap, this.cid);
|
|
18
18
|
}
|
|
19
19
|
}
|
|
20
|
-
export function*
|
|
20
|
+
export function* iterateAtpRepo(buf) {
|
|
21
21
|
const { roots, iterate } = fromUint8Array(new Uint8Array(buf));
|
|
22
22
|
assert(roots.length === 1, `expected only 1 root in the car archive; got=${roots.length}`);
|
|
23
23
|
// Collect all archive entries into a mapping of CID string -> actual bytes
|
|
@@ -32,6 +32,8 @@ export function* iterateAtpCar(buf) {
|
|
|
32
32
|
yield new RepoEntry(collection, rkey, cid, blockmap);
|
|
33
33
|
}
|
|
34
34
|
}
|
|
35
|
+
/** @deprecated Use `iterateAtpRepo` instead */
|
|
36
|
+
export const iterateAtpCar = iterateAtpRepo;
|
|
35
37
|
function readObject(map, link) {
|
|
36
38
|
const cid = link.$link;
|
|
37
39
|
const bytes = map.get(cid);
|
package/dist/atproto-repo.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"atproto-repo.js","sourceRoot":"","sources":["../lib/atproto-repo.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,IAAI,MAAM,cAAc,CAAC;AACrC,OAAO,KAAK,GAAG,MAAM,aAAa,CAAC;AAEnC,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAE7C,MAAM,OAAO,GAAG,IAAI,WAAW,EAAE,CAAC;AAElC,MAAM,OAAO,SAAS;IAEJ;IACA;IACA;IACR;IAJT,YACiB,UAAkB,EAClB,IAAY,EACZ,GAAiB,EACzB,QAAkB;QAHV,eAAU,GAAV,UAAU,CAAQ;QAClB,SAAI,GAAJ,IAAI,CAAQ;QACZ,QAAG,GAAH,GAAG,CAAc;QACzB,aAAQ,GAAR,QAAQ,CAAU;IACxB,CAAC;IAEJ,IAAI,MAAM;QACT,OAAO,UAAU,CAAC,IAAI,CAAC,QAAQ,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC;IAC5C,CAAC;CACD;AAED,MAAM,SAAS,CAAC,CAAC,
|
|
1
|
+
{"version":3,"file":"atproto-repo.js","sourceRoot":"","sources":["../lib/atproto-repo.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,IAAI,MAAM,cAAc,CAAC;AACrC,OAAO,KAAK,GAAG,MAAM,aAAa,CAAC;AAEnC,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAE7C,MAAM,OAAO,GAAG,IAAI,WAAW,EAAE,CAAC;AAElC,MAAM,OAAO,SAAS;IAEJ;IACA;IACA;IACR;IAJT,YACiB,UAAkB,EAClB,IAAY,EACZ,GAAiB,EACzB,QAAkB;QAHV,eAAU,GAAV,UAAU,CAAQ;QAClB,SAAI,GAAJ,IAAI,CAAQ;Q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AAE,KAAK,CAAC,CAAC,CAAC,CAAC;QAClC,CAAC;IACF,CAAC;AACF,CAAC;AAED,SAAS,MAAM,CAAC,SAAkB,EAAE,OAAe;IAClD,IAAI,CAAC,SAAS,EAAE,CAAC;QAChB,MAAM,IAAI,KAAK,CAAC,OAAO,CAAC,CAAC;IAC1B,CAAC;AACF,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { iterateAtpCar, type RepoEntry } from './atproto-repo.js';
|
|
2
|
-
export { fromUint8Array } from './reader.js';
|
|
1
|
+
export { iterateAtpCar, iterateAtpRepo, type RepoEntry } from './atproto-repo.js';
|
|
2
|
+
export { fromUint8Array, readCar } from './reader.js';
|
package/dist/index.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { iterateAtpCar } from './atproto-repo.js';
|
|
2
|
-
export { fromUint8Array } from './reader.js';
|
|
1
|
+
export { iterateAtpCar, iterateAtpRepo } from './atproto-repo.js';
|
|
2
|
+
export { fromUint8Array, readCar } from './reader.js';
|
|
3
3
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../lib/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAkB,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../lib/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,cAAc,EAAkB,MAAM,mBAAmB,CAAC;AAClF,OAAO,EAAE,cAAc,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC"}
|
package/dist/reader.d.ts
CHANGED
|
@@ -1,3 +1,11 @@
|
|
|
1
|
+
export declare const readCar: (buffer: Uint8Array) => {
|
|
2
|
+
roots: import("@atcute/cbor").CIDLink[];
|
|
3
|
+
iterate(): Generator<{
|
|
4
|
+
cid: import("@atcute/cid").CID;
|
|
5
|
+
bytes: Uint8Array;
|
|
6
|
+
}>;
|
|
7
|
+
};
|
|
8
|
+
/** @deprecated Use `readCar` instead */
|
|
1
9
|
export declare const fromUint8Array: (buffer: Uint8Array) => {
|
|
2
10
|
roots: import("@atcute/cbor").CIDLink[];
|
|
3
11
|
iterate(): Generator<{
|
package/dist/reader.js
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { createUint8Reader } from './utilities/byte-reader.js';
|
|
2
2
|
import { createCarReader } from './utilities/sync-car-reader.js';
|
|
3
|
-
export const
|
|
3
|
+
export const readCar = (buffer) => {
|
|
4
4
|
const reader = createUint8Reader(buffer);
|
|
5
5
|
return createCarReader(reader);
|
|
6
6
|
};
|
|
7
|
+
/** @deprecated Use `readCar` instead */
|
|
8
|
+
export const fromUint8Array = readCar;
|
|
7
9
|
//# sourceMappingURL=reader.js.map
|
package/dist/reader.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"reader.js","sourceRoot":"","sources":["../lib/reader.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAC/D,OAAO,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAC;AAEjE,MAAM,CAAC,MAAM,
|
|
1
|
+
{"version":3,"file":"reader.js","sourceRoot":"","sources":["../lib/reader.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAC/D,OAAO,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAC;AAEjE,MAAM,CAAC,MAAM,OAAO,GAAG,CAAC,MAAkB,EAAE,EAAE;IAC7C,MAAM,MAAM,GAAG,iBAAiB,CAAC,MAAM,CAAC,CAAC;IACzC,OAAO,eAAe,CAAC,MAAM,CAAC,CAAC;AAChC,CAAC,CAAC;AAEF,wCAAwC;AACxC,MAAM,CAAC,MAAM,cAAc,GAAG,OAAO,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"type": "module",
|
|
3
3
|
"name": "@atcute/car",
|
|
4
|
-
"version": "1.0
|
|
4
|
+
"version": "1.1.0",
|
|
5
5
|
"description": "read AT Protocol's CAR (content-addressable archive) repositories",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"repository": {
|
|
@@ -18,9 +18,9 @@
|
|
|
18
18
|
"@types/bun": "^1.1.10"
|
|
19
19
|
},
|
|
20
20
|
"dependencies": {
|
|
21
|
+
"@atcute/cbor": "^1.0.2",
|
|
21
22
|
"@atcute/cid": "^1.0.1",
|
|
22
|
-
"@atcute/varint": "^1.0.0"
|
|
23
|
-
"@atcute/cbor": "^1.0.2"
|
|
23
|
+
"@atcute/varint": "^1.0.0"
|
|
24
24
|
},
|
|
25
25
|
"scripts": {
|
|
26
26
|
"build": "tsc --project tsconfig.build.json",
|