docs(cli): sync SRT upload docs from EF (#2364)

This commit is contained in:
Miguel Ángel
2026-07-13 17:51:25 -04:00
committed by GitHub
parent 9b71bc2103
commit 74fb4dbcc3
2 changed files with 16 additions and 1 deletions
+1 -1
View File
@@ -204,7 +204,7 @@ export class HyperframesCloudClient {
/**
* Upload Asset
*
* Uploads a file (image, video, audio, or PDF) and returns an asset_id for use in other endpoints. Max 32 MB. Supported types: png, jpeg, mp4, webm, mp3, wav, pdf.
* Uploads a file (image, video, audio, PDF, or SRT subtitle) and returns an asset_id for use in other endpoints. Max 32 MB. Supported types: png, jpeg, mp4, webm, mp3, wav, pdf, srt.
*/
async uploadAsset(args: {
file: Blob | Buffer | Uint8Array;
@@ -0,0 +1,15 @@
import { readFileSync } from "node:fs";
import { describe, expect, it } from "vitest";
const generatedClientSource = readFileSync(new URL("./_gen/client.ts", import.meta.url), "utf8");
describe("generated cloud client source contract", () => {
it("documents SRT subtitles on the uploadAsset endpoint", () => {
const uploadAssetDocs = generatedClientSource.match(
/\/\*\*\s*\*\s*Upload Asset[\s\S]*?\*\/\s+async uploadAsset/,
)?.[0];
expect(uploadAssetDocs).toContain("SRT subtitle");
expect(uploadAssetDocs).toMatch(/Supported types:[^\n]*\bsrt\b/);
});
});