-
Add custom
fetchoption toFetchStore. Accepts a WinterTC-style fetch handler (Requestin,Responseout) to cover the long tail of things users need at the fetch level. Deprecatesoverrides. (#388)Presigning a URL:
const store = new FetchStore("https://my-bucket.s3.amazonaws.com/data.zarr", { async fetch(request) { const newUrl = await presign(request.url); return fetch(new Request(newUrl, request)); }, });
Remapping response status codes:
const store = new FetchStore("https://my-bucket.s3.amazonaws.com/data.zarr", { async fetch(request) { const response = await fetch(request); if (response.status === 403) { return new Response(null, { status: 404 }); } return response; }, });
overridesonly supported staticRequestInitproperties. For anything dynamic (like refreshing a token), you had to thread it through every call site:const store = new FetchStore("https://example.com/data.zarr"); const arr = await zarr.open(store); // token logic leaks into every get call let chunk = await zarr.get(arr, null, { opts: { headers: { Authorization: `Bearer ${await getAccessToken()}` } }, });
With
fetch, auth is configured once on the store and every request picks it up:const store = new FetchStore("https://example.com/data.zarr", { async fetch(request) { const token = await getAccessToken(); request.headers.set("Authorization", `Bearer ${token}`); return fetch(request); }, }); const arr = await zarr.open(store); // call sites don't need to know about auth let chunk = await zarr.get(arr);
-
ReferenceStorenow usesFetchStoreinternally and accepts the samefetchoption. The default fetch handler translatess3://,gs://, andgcs://URIs to HTTPS, but you can provide your own to add auth or handle other protocols: (#389)const store = await ReferenceStore.fromUrl("https://example.com/refs.json", { async fetch(request) { // translate s3:// and gs:// URIs to HTTPS const url = ReferenceStore.resolveUri(request.url); const req = new Request(url, request); req.headers.set("Authorization", `Bearer ${await getToken()}`); return fetch(req); }, });
-
Enable
declarationMapso "go to definition" resolves to.tssource instead of.d.tsfiles (#361) -
Upgrade
unzipitfrom 1.4.3 to 2.0.0 (#386)
-
Add
getRange()toZipFileStorefor sharding support (#337)Enables reading sharded arrays from zip files by implementing partial byte-range reads. Uncompressed entries support true partial reads; compressed entries fall back to reading the full entry and slicing.
-
Fix handling of paths with spaces in Zarr stores (
a06a7e6)Paths containing spaces or other special characters in Zarr stores were not being resolved correctly. The internal use of the
URLfor path resolution was inadvertently exposing URL-encoded paths (e.g., converting spaces to%20), preventing stores from finding entries with these characters.This fix ensures paths are properly decoded after resolution, allowing Zarr arrays and groups with spaces in their names to be accessed correctly in both
ZipFileStoreand consolidated metadata.
- Add a transformEntries option for the ZipFileStore, to allow for transformation of internal zip paths (e.g., to remove a root folder). (#294)
- Emit and publish sourcemap files (#278)
- fix(storage): Rename storage type
WriteabletoWritable(#114)
-
Fix TypedArray types for TypeScript < 5.7 (#239)
TypeScript changed the typing behavior of all
TypedArrayobjects to now be generic over the underlyingArrayBufferLiketype. In order to have our types be consistent with these changes, we needed to specify theArrayBufferexplicitly, but that breaks for older versions of TypeScript. This PR fixes the version of TypeScript to 5.6. We will need to bump again when we want to support 5.7. -
Use a counter to prioritize v2/v3 when opening. (#109)
-
Remove use of public any from API in favor of unknown (#173)
-
Consolidate @zarrita/core into zarrita (#269)
-
Add default generic paramter to
ZipFileStore(#248) -
FetchStorethrows an error for 403 (forbidden) responses. This is a breaking change because previously404and403responses were treated the same way. Now, only404responses signify a "missing" key from the store. (#212) -
Add support for passing fetch options to ReferenceStore. (#155)
- Consolidate @zarrita/core into zarrita (#269)
- Add default generic paramter to
ZipFileStore(#248)
-
Fix TypedArray types for TypeScript < 5.7 (#239)
TypeScript changed the typing behavior of all
TypedArrayobjects to now be generic over the underlyingArrayBufferLiketype. In order to have our types be consistent with these changes, we needed to specify theArrayBufferexplicitly, but that breaks for older versions of TypeScript. This PR fixes the version of TypeScript to 5.6. We will need to bump again when we want to support 5.7.
FetchStorethrows an error for 403 (forbidden) responses. This is a breaking change because previously404and403responses were treated the same way. Now, only404responses signify a "missing" key from the store. (#212)
- Enable creation of ReferenceStore via non-async functions. (#203)
- Remove use of public any from API in favor of unknown (#173)
-
Add support for passing fetch options to ReferenceStore. (#155)
-
Add support for passing fetch options to ZipFileStore.fromUrl. (#156)
- fix(storage): Rename storage type
WriteabletoWritable(#114)
- Use a counter to prioritize v2/v3 when opening. (#109)
- Add licenses and READMES to packages (#107)
- chore: prepare preleases (
fa43aff)
-
feat: Support partial reads from
Readable(#93)Introduces the
Readable.getRangemethod, which can be optionally implemented by a store to support partial reads. TheRangeQueryparam is inspired by the HTTPRangeheader. Allowing thesuffixLengthquery means the store can decide the best way to return the final N bytes from a file.const store = new FetchStore("http://localhost:8080/data.zarr"); await store.getRange("/foo.json", { suffixLength: 100 }); await store.getRange("/foo.json", { offset: 10, length: 20 });
- feat: allow
RequestInitoptions to be configured inFetchStoreconstructor (#77)