MCPcopy Create free account
hub / github.com/CommandCodeAI/BaseAI / updateExistingPipe

Function updateExistingPipe

packages/baseai/src/deploy/index.ts:275–303  ·  view source on GitHub ↗
({
	updateUrl,
	pipe,
	account
}: {
	updateUrl: string;
	pipe: PipeOld;
	account: Account;
})

Source from the content-addressed store, hash-verified

273}
274
275async function updateExistingPipe({
276 updateUrl,
277 pipe,
278 account
279}: {
280 updateUrl: string;
281 pipe: PipeOld;
282 account: Account;
283}): Promise<PipeOld> {
284 p.log.info(`Pipe "${pipe.name}" already exists. Updating instead.`);
285
286 const updateResponse = await fetch(updateUrl, {
287 method: 'POST',
288 headers: {
289 'Content-Type': 'application/json',
290 Authorization: `Bearer ${account.apiKey}`
291 },
292 body: JSON.stringify(pipe)
293 });
294
295 if (!updateResponse.ok) {
296 const error = await updateResponse.text();
297 throw new Error(
298 `HTTP error! status: ${updateResponse.status}, message: ${error}`
299 );
300 }
301
302 return (await updateResponse.json()) as PipeOld;
303}
304
305export function handleError({
306 spinner,

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected