diff --git a/src/test/url_utils.test.ts b/src/test/url_utils.test.ts index ac51edd4..a69ac078 100644 --- a/src/test/url_utils.test.ts +++ b/src/test/url_utils.test.ts @@ -31,6 +31,12 @@ describe("remapUrl", () => { expect(remapUri("/allen/aics/example/data.zarr")).toBe("https://vast-files.int.allencell.org/example/data.zarr"); }); + it("maps FMS file paths", () => { + expect(remapUri("/allen/programs/allencell/data/proj0/folder/some-data.ome.zarr")).toBe( + "https://s3.us-west-2.amazonaws.com/production.files.allencell.org/folder/some-data.ome.zarr" + ); + }); + it("maps example Human Organ Atlas GCS URL", () => { expect( remapUri( diff --git a/src/utils/url_utils.ts b/src/utils/url_utils.ts index cd129b1a..c86d918d 100644 --- a/src/utils/url_utils.ts +++ b/src/utils/url_utils.ts @@ -2,6 +2,8 @@ const S3_URL_PREFIX = "s3://"; const GCS_URL_PREFIX = "gs://"; const VAST_FILES_PREFIX = "/allen/aics/"; const VAST_FILES_URL = "https://vast-files.int.allencell.org/"; +const FMS_FILES_PREFIX = "/allen/programs/allencell/data/proj0"; +const FMS_FILES_URL = "https://s3.us-west-2.amazonaws.com/production.files.allencell.org"; /** * Remaps non-standard URIs (e.g. S3 (`s3://`), Google Cloud Storage (`gs://`), or @@ -19,8 +21,9 @@ export function remapUri(url: string): string { // remap gs://bucket/key to https://storage.googleapis.com/bucket/key newUrl = newUrl.replace(GCS_URL_PREFIX, "https://storage.googleapis.com/"); } else if (newUrl.startsWith(VAST_FILES_PREFIX)) { - // remap /allen/aics/... to https://vast-files.int.allencell.org/... newUrl = newUrl.replace(VAST_FILES_PREFIX, VAST_FILES_URL); + } else if (newUrl.startsWith(FMS_FILES_PREFIX)) { + newUrl = newUrl.replace(FMS_FILES_PREFIX, FMS_FILES_URL); } return newUrl;