@blaxel/core 0.3.29-preview.319 → 0.3.29-preview.321

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.
@@ -24,8 +24,8 @@ function missingCredentialsMessage() {
24
24
  return "No Blaxel credentials found. Set the BL_API_KEY and BL_WORKSPACE environment variables, or run `bl login`.";
25
25
  }
26
26
  // Build info - these placeholders are replaced at build time by build:replace-imports
27
- const BUILD_VERSION = "0.3.29-preview.319";
28
- const BUILD_COMMIT = "643251a25f011082e6849e55e91f3b06e3a1efb3";
27
+ const BUILD_VERSION = "0.3.29-preview.321";
28
+ const BUILD_COMMIT = "c1f5d1cffc5e85565febbbe0737df89947f2caa5";
29
29
  const BUILD_SENTRY_DSN = "https://fd5e60e1c9820e1eef5ccebb84a07127@o4508714045276160.ingest.us.sentry.io/4510465864564736";
30
30
  const BLAXEL_API_VERSION = "2026-09-22";
31
31
  // Bun < 1.3.11 never sends connection-level WINDOW_UPDATE: the pooled h2
@@ -614,6 +614,17 @@ describe("ImageInstance.build worker resources", () => {
614
614
  const { upload } = await buildWith({}, { "x-blaxel-auto-generated": "true", "x-blaxel-build-memory": "8192" }, "none");
615
615
  expect(upload.headers["x-amz-meta-x-blaxel-build-memory"]).toBeUndefined();
616
616
  });
617
+ it("sends the build region as a label and signed upload header", async () => {
618
+ const { create, upload } = await buildWith({ buildRegion: "us-was-1", buildMemory: 2048 });
619
+ expect(create.body.metadata?.labels?.["x-blaxel-build-region"]).toBe("us-was-1");
620
+ expect(upload.headers["x-amz-meta-x-blaxel-build-region"]).toBe("us-was-1");
621
+ expect(upload.headers["x-amz-meta-x-blaxel-build-memory"]).toBe("2048");
622
+ });
623
+ it("asks again when creating a sandbox does not sign the region", async () => {
624
+ const { upload } = await buildWith({ buildRegion: "us-was-1" }, undefined, "update");
625
+ expect(calls.filter((call) => call.url.includes("upload=true")).map((call) => call.method)).toEqual(["PUT", "POST", "PUT"]);
626
+ expect(upload.headers["x-amz-meta-x-blaxel-build-region"]).toBe("us-was-1");
627
+ });
617
628
  it("still accepts the deprecated Mb spellings", async () => {
618
629
  const { create, upload } = await buildWith({ buildMemoryMb: 8192, buildVolumeMb: 0 });
619
630
  expect(create.body.metadata?.labels?.["x-blaxel-build-memory"]).toBe("8192");
@@ -642,6 +653,11 @@ describe("ImageInstance.build worker resources", () => {
642
653
  [{ buildVolumeMb: -1 }, "buildVolumeMb must"],
643
654
  [{ buildMemory: 2048, buildMemoryMb: 2048 }, "not both"],
644
655
  [{ buildVolume: 0, buildVolumeMb: 0 }, "not both"],
656
+ [{ buildRegion: "" }, "buildRegion must"],
657
+ [{ buildRegion: "US-WAS-1" }, "buildRegion must"],
658
+ [{ buildRegion: " us-was-1" }, "buildRegion must"],
659
+ [{ buildRegion: "-us" }, "buildRegion must"],
660
+ [{ buildRegion: "a".repeat(64) }, "buildRegion must"],
645
661
  ])("rejects out-of-range %o before any request", async (options, option) => {
646
662
  const fetchSpy = vi.fn();
647
663
  vi.stubGlobal("fetch", fetchSpy);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@blaxel/core",
3
- "version": "0.3.29-preview.319",
3
+ "version": "0.3.29-preview.321",
4
4
  "description": "Blaxel Core SDK for TypeScript",
5
5
  "license": "MIT",
6
6
  "author": "Blaxel, INC (https://blaxel.ai)",