MCPcopy Index your code
hub / github.com/triggerdotdev/trigger.dev / buildRequest

Function buildRequest

packages/testing/src/index.ts:71–86  ·  view source on GitHub ↗
(action: TriggerAction, apiKey: string, opts: Record<string, any> = {})

Source from the content-addressed store, hash-verified

69 | "VALIDATE";
70
71const buildRequest = (action: TriggerAction, apiKey: string, opts: Record<string, any> = {}) => {
72 if (action === "DELIVER_HTTP_SOURCE_REQUEST") {
73 throw new Error(`action ${action} not implemented yet`);
74 }
75 return new Request("https://example.com/trigger", {
76 method: "POST",
77 headers: {
78 "Content-Type": "application/json",
79 "x-trigger-api-key": apiKey,
80 "x-trigger-action": action,
81 "x-trigger-endpoint-id": opts.endpointId,
82 "x-trigger-job-id": opts.jobId,
83 },
84 body: JSON.stringify(opts.body),
85 });
86};
87
88const buildRequestBody = (event: RunJobBody["event"], job: RunJobBody["job"]): RunJobBody => ({
89 event,

Callers 1

createJobTesterFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…