@aics/vole-core 3.15.1 → 3.15.2

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.
@@ -9,7 +9,7 @@ import { composeSubregion, computePackedAtlasDims, convertSubregionToPixels, pic
9
9
  import ChunkPrefetchIterator from "./zarr_utils/ChunkPrefetchIterator.js";
10
10
  import { getScale, getSourceChannelNames, matchSourceScaleLevels, orderByDimension, orderByTCZYX, remapAxesToTCZYX } from "./zarr_utils/utils.js";
11
11
  import { VolumeLoadError, VolumeLoadErrorType, wrapVolumeLoadError } from "./VolumeLoadError.js";
12
- import wrapArray from "./zarr_utils/wrapArray.js";
12
+ import wrapArray, { RelaxedFetchStore } from "./zarr_utils/wrappers.js";
13
13
  import { assertMetadataHasMultiscales, toOMEZarrMetaV4, validateOMEZarrMetadata } from "./zarr_utils/validation.js";
14
14
  const CHUNK_REQUEST_CANCEL_REASON = "chunk request cancelled";
15
15
 
@@ -96,7 +96,7 @@ class OMEZarrLoader extends ThreadableVolumeLoader {
96
96
 
97
97
  // Create one `ZarrSource` per URL
98
98
  const sourceProms = urlsArr.map(async (url, i) => {
99
- const store = new zarr.FetchStore(url);
99
+ const store = new RelaxedFetchStore(url);
100
100
  const root = zarr.root(store);
101
101
  const group = await zarr.open(root, {
102
102
  kind: "group"
@@ -1,3 +1,4 @@
1
+ import { FetchStore } from "zarrita";
1
2
  import { isChunk } from "../../VolumeCache.js";
2
3
  export default function wrapArray(array, basePath, cache, queue) {
3
4
  const path = basePath.endsWith("/") ? basePath.slice(0, -1) : basePath;
@@ -36,4 +37,23 @@ export default function wrapArray(array, basePath, cache, queue) {
36
37
  return value;
37
38
  }
38
39
  });
40
+ }
41
+ export class RelaxedFetchStore extends FetchStore {
42
+ constructor(baseUrl, options) {
43
+ super(baseUrl, options);
44
+ }
45
+
46
+ // Solution for https://github.com/manzt/zarrita.js/pull/212
47
+ // taken from https://github.com/vitessce/vitessce/pull/2069
48
+ async get(key, options = {}) {
49
+ try {
50
+ return await super.get(key, options);
51
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
52
+ } catch (e) {
53
+ if (e?.message?.startsWith("Unexpected response status 403")) {
54
+ return undefined;
55
+ }
56
+ throw e;
57
+ }
58
+ }
39
59
  }
@@ -1,7 +1,12 @@
1
- import type { Array as ZarrArray, AsyncReadable, DataType } from "zarrita";
1
+ import type { AbsolutePath, Array as ZarrArray, AsyncReadable, DataType } from "zarrita";
2
+ import { FetchStore } from "zarrita";
2
3
  import VolumeCache from "../../VolumeCache.js";
3
4
  import type { WrappedArrayOpts } from "./types.js";
4
5
  import SubscribableRequestQueue from "../../utils/SubscribableRequestQueue.js";
5
6
  type AsyncReadableExt<Opts> = AsyncReadable<Opts & WrappedArrayOpts>;
6
7
  export default function wrapArray<T extends DataType, Opts = unknown, Store extends AsyncReadable<Opts> = AsyncReadable<Opts>>(array: ZarrArray<T, Store>, basePath: string, cache?: VolumeCache, queue?: SubscribableRequestQueue): ZarrArray<T, AsyncReadableExt<Opts>>;
8
+ export declare class RelaxedFetchStore extends FetchStore {
9
+ constructor(baseUrl: string, options?: RequestInit);
10
+ get(key: AbsolutePath, options?: RequestInit): Promise<Uint8Array | undefined>;
11
+ }
7
12
  export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aics/vole-core",
3
- "version": "3.15.1",
3
+ "version": "3.15.2",
4
4
  "description": "volume renderer for 3d, 4d, or 5d imaging data with OME-Zarr support",
5
5
  "main": "es/index.js",
6
6
  "type": "module",
@@ -39,7 +39,7 @@
39
39
  "three": "^0.171.0",
40
40
  "throttled-queue": "^2.1.4",
41
41
  "tweakpane": "^3.1.9",
42
- "zarrita": "^0.4.0"
42
+ "zarrita": "^0.5.1"
43
43
  },
44
44
  "devDependencies": {
45
45
  "@babel/cli": "^7.25.6",