fix(cli): route HeyGen API calls through canary (#3201)

This commit is contained in:
Miguel Ángel
2026-08-10 21:26:46 -04:00
committed by GitHub
parent ce18acf075
commit 5545521556
7 changed files with 72 additions and 26 deletions
+6 -10
View File
@@ -5,6 +5,7 @@ import AdmZip from "adm-zip";
import ignore, { type Ignore } from "ignore";
import { CSS_URL_RE, isNonRelativeUrl, isPathInside } from "@hyperframes/core";
import { buildAuthHeaders } from "../auth/client.js";
import { withHeygenCanaryRoute } from "./heygenRoute.js";
import { tryResolveCredential } from "../auth/index.js";
import { writeProjectLink } from "./projectLink.js";
@@ -557,10 +558,7 @@ async function publishProjectArchiveDirect(
"file",
new File([archiveArrayBuffer(archive)], `${title}.zip`, { type: PUBLISH_CONTENT_TYPE }),
);
const headers: Record<string, string> = {
...authHeaders,
heygen_route: "canary",
};
const headers = withHeygenCanaryRoute(authHeaders);
const response = await fetchForPublish(
`${apiBaseUrl}/v1/hyperframes/projects/publish`,
@@ -623,11 +621,10 @@ async function publishProjectArchiveStaged(
content_type: PUBLISH_CONTENT_TYPE,
content_length: archive.buffer.byteLength,
}),
headers: {
headers: withHeygenCanaryRoute({
...authHeaders,
"content-type": "application/json",
heygen_route: "canary",
},
}),
signal: AbortSignal.timeout(PUBLISH_METADATA_TIMEOUT_MS),
}),
"Failed to prepare project upload",
@@ -657,11 +654,10 @@ async function publishProjectArchiveStaged(
...(isPublic ? { is_public: true } : {}),
...(projectId ? { project_id: projectId } : {}),
}),
headers: {
headers: withHeygenCanaryRoute({
...authHeaders,
"content-type": "application/json",
heygen_route: "canary",
},
}),
signal: AbortSignal.timeout(uploadTimeoutMs(archive.buffer.byteLength)),
}),
"Failed to finalize project publish",