diff --git a/README.md b/README.md index 8bf875e..5b61cf2 100644 --- a/README.md +++ b/README.md @@ -103,10 +103,12 @@ const result = await client.sites.deploy("site-id", [ ]); ``` -The deploy method handles the full upload flow: requesting presigned URLs, uploading file parts to S3 (with concurrency), and finalizing the deployment. +The deploy method handles the full upload flow: requesting per-part upload URLs, PUTting each part (with concurrency), capturing ETags, and finalizing the deployment. Files larger than 5 MB are automatically split into multipart uploads. +By default the public API returns **partition-host upload URLs** (on the same hostname as the rest of the API, e.g. `https://us.api.hostsmith.net/v1/uploads/...`) - so the SDK only needs network access to your partition's API host. If you prefer direct-to-S3 presigned URLs (e.g. for CI runners in the same AWS region), pass `mode: "presigned"` when starting the upload via the lower-level `client.sites.startUpload(...)` API. `deploy()` follows the server default and works with either URL shape transparently. + ## Configuration ### Partitions diff --git a/src/__tests__/sites.test.ts b/src/__tests__/sites.test.ts index 06bba2b..5a328a2 100644 --- a/src/__tests__/sites.test.ts +++ b/src/__tests__/sites.test.ts @@ -409,7 +409,7 @@ describe("SitesResource.deploy", () => { partUploadUrls: [ { part: 1, - url: "https://us.api.hostsmith.net/v1/uploads/uploads/orgA/s1/v1/file0.html?ut=eyJhbGciOiJIUzI1NiJ9.payload.sig", + url: "https://us.api.hostsmith.net/v1/uploads/orgA/s1/v1/file0.html?ut=eyJhbGciOiJIUzI1NiJ9.payload.sig", }, ], }, @@ -431,7 +431,7 @@ describe("SitesResource.deploy", () => { expect(fetcher).toHaveBeenCalledTimes(1); const [calledUrl, init] = fetcher.mock.calls[0]; expect(calledUrl).toBe( - "https://us.api.hostsmith.net/v1/uploads/uploads/orgA/s1/v1/file0.html?ut=eyJhbGciOiJIUzI1NiJ9.payload.sig", + "https://us.api.hostsmith.net/v1/uploads/orgA/s1/v1/file0.html?ut=eyJhbGciOiJIUzI1NiJ9.payload.sig", ); expect(init).toEqual(expect.objectContaining({ method: "PUT" })); // SDK did not rewrite or strip the ut query parameter. @@ -448,11 +448,11 @@ describe("SitesResource.deploy", () => { partUploadUrls: [ { part: 1, - url: "https://us.api.hostsmith.net/v1/uploads/uploads/orgA/s1/v1/big.bin?partNumber=1&uploadId=upl-xyz&ut=tok1", + url: "https://us.api.hostsmith.net/v1/uploads/orgA/s1/v1/big.bin?partNumber=1&uploadId=upl-xyz&ut=tok1", }, { part: 2, - url: "https://us.api.hostsmith.net/v1/uploads/uploads/orgA/s1/v1/big.bin?partNumber=2&uploadId=upl-xyz&ut=tok2", + url: "https://us.api.hostsmith.net/v1/uploads/orgA/s1/v1/big.bin?partNumber=2&uploadId=upl-xyz&ut=tok2", }, ], },