MCPcopy Create free account
hub / github.com/Superflows-AI/superflows / buildBody

Function buildBody

supabase/functions/execute-code-2/requests.ts:217–235  ·  view source on GitHub ↗
(
  schema: SchemaObject,
  parameters: Record<string, unknown>,
)

Source from the content-addressed store, hash-verified

215}
216
217function buildBody(
218 schema: SchemaObject,
219 parameters: Record<string, unknown>,
220): { [x: string]: any } {
221 const properties = schema.properties as {
222 [name: string]: SchemaObject;
223 };
224 console.info("properties:" + JSON.stringify(properties));
225
226 const bodyArray = Object.entries(properties).map(([name, property]) => {
227 // Throw out readonly attributes
228 if (property.readOnly) return undefined;
229 const paramValue = getParam(parameters, name);
230 if (paramValue) {
231 return { [name]: paramValue };
232 }
233 });
234 return Object.assign({}, ...bodyArray);
235}
236
237export async function makeHttpRequest(
238 url: string,

Callers 1

constructHttpRequestFunction · 0.70

Calls 1

getParamFunction · 0.90

Tested by

no test coverage detected