mirror of
https://github.com/heygen-com/hyperframes.git
synced 2026-09-12 15:20:13 +00:00
fix(cli): route HeyGen API calls through canary (#3201)
This commit is contained in:
@@ -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",
|
||||
|
||||
Reference in New Issue
Block a user