Refresh docs and client for backend-routed asset uploads.
CI / test (push) Successful in 5s

This updates developer docs and web demos to use backend upload endpoints, adds a client upload helper, and aligns integration tests with the no-direct-MinIO URL flow.

Made-with: Cursor
This commit is contained in:
2026-03-02 21:51:47 +00:00
parent e981a334ea
commit a666f1233d
9 changed files with 92 additions and 84 deletions
+9 -2
View File
@@ -231,7 +231,12 @@ async function createMockServer(): Promise<{ url: string; server: ReturnType<typ
// POST /v1/assets/:id/signed-upload
if (method === "POST" && path.match(/^\/v1\/assets\/[^/]+\/signed-upload$/)) {
const id = path.split("/")[3]!;
return Response.json({ url: `http://upload.local/${id}`, method: "PUT" });
return Response.json({ url: `/v1/assets/${id}/upload`, method: "PUT" });
}
// PUT /v1/assets/:id/upload
if (method === "PUT" && path.match(/^\/v1\/assets\/[^/]+\/upload$/)) {
return new Response(null, { status: 204 });
}
// PATCH /v1/assets/:id
@@ -325,7 +330,9 @@ describe("GeoApiClient integration (docs flow)", () => {
const upload = await client.getAssetSignedUploadUrl(createdAsset.asset.id, "model/gltf-binary");
expect(upload.method).toBe("PUT");
expect(upload.url).toContain(createdAsset.asset.id);
expect(upload.url).toContain(`/v1/assets/${createdAsset.asset.id}/upload`);
await client.uploadAssetBinary(createdAsset.asset.id, new Blob(["fake-glb"]), "model/gltf-binary");
const toggled = await client.setAssetVisibility(createdAsset.asset.id, false);
expect(toggled.asset.isPublic).toBe(false);