@lightcone-ai/daemon 0.15.50 → 0.15.51
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -229,37 +229,6 @@ export async function fetchPublishJobWorkspaceFile({ serverUrl, machineApiKey, j
|
|
|
229
229
|
return res.json();
|
|
230
230
|
}
|
|
231
231
|
|
|
232
|
-
export async function streamPublishJobVideo({
|
|
233
|
-
serverUrl,
|
|
234
|
-
machineApiKey,
|
|
235
|
-
jobId,
|
|
236
|
-
videoId,
|
|
237
|
-
localPath,
|
|
238
|
-
writeBinaryFile = writeFileAtomically,
|
|
239
|
-
}) {
|
|
240
|
-
const normalizedJobId = String(jobId ?? '').trim();
|
|
241
|
-
if (!normalizedJobId) {
|
|
242
|
-
throw new Error('publish job id is required to fetch video files');
|
|
243
|
-
}
|
|
244
|
-
const normalizedVideoId = String(videoId ?? '').trim();
|
|
245
|
-
if (!normalizedVideoId) {
|
|
246
|
-
throw new Error('video id is required to fetch video files');
|
|
247
|
-
}
|
|
248
|
-
const url = `${String(serverUrl).replace(/\/$/, '')}/internal/agent/publish-jobs/${encodeURIComponent(normalizedJobId)}/video-files/${encodeURIComponent(normalizedVideoId)}`;
|
|
249
|
-
const res = await fetch(url, {
|
|
250
|
-
headers: {
|
|
251
|
-
Authorization: `Bearer ${machineApiKey}`,
|
|
252
|
-
},
|
|
253
|
-
});
|
|
254
|
-
if (!res.ok) {
|
|
255
|
-
const text = await res.text().catch(() => '');
|
|
256
|
-
throw new Error(`publish-jobs video-files GET failed (${res.status}): ${text}`);
|
|
257
|
-
}
|
|
258
|
-
const data = Buffer.from(await res.arrayBuffer());
|
|
259
|
-
writeBinaryFile(localPath, data);
|
|
260
|
-
return localPath;
|
|
261
|
-
}
|
|
262
|
-
|
|
263
232
|
export function workspacePathFromMediaPath(filePath, workspaceId) {
|
|
264
233
|
if (!filePath) return null;
|
|
265
234
|
|