MCPcopy Index your code
hub / github.com/simstudioai/sim / createHttpResponseFromBlock

Function createHttpResponseFromBlock

apps/sim/lib/workflows/utils.ts:292–308  ·  view source on GitHub ↗
(
  executionResult: Pick<ExecutionResult, 'output'>,
  context?: ExecutionMaterializationContext
)

Source from the content-addressed store, hash-verified

290}
291
292export const createHttpResponseFromBlock = async (
293 executionResult: Pick<ExecutionResult, 'output'>,
294 context?: ExecutionMaterializationContext
295): Promise<NextResponse> => {
296 const { data = {}, status = 200, headers = {} } = executionResult.output
297 const responseData = await materializeInlineExecutionValue(data, context)
298
299 const responseHeaders = new Headers({
300 'Content-Type': 'application/json',
301 ...headers,
302 })
303
304 return NextResponse.json(responseData, {
305 status: status,
306 headers: responseHeaders,
307 })
308}
309
310/**
311 * Validates that the current user has permission to access/modify a workflow

Callers 3

utils.test.tsFile · 0.90
handleExecutePostFunction · 0.90

Calls 1

Tested by

no test coverage detected