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

Function getSchedulePayloadFromValue

apps/sim/app/api/schedules/execute/route.ts:218–230  ·  view source on GitHub ↗
(payload: unknown)

Source from the content-addressed store, hash-verified

216>
217
218function getSchedulePayloadFromValue(payload: unknown): ScheduleExecutionPayload | null {
219 if (!payload || typeof payload !== 'object') return null
220 const candidate = payload as Partial<ScheduleExecutionPayload>
221 if (
222 typeof candidate.scheduleId !== 'string' ||
223 typeof candidate.workflowId !== 'string' ||
224 typeof candidate.now !== 'string'
225 ) {
226 return null
227 }
228
229 return candidate as ScheduleExecutionPayload
230}
231
232function getSchedulePayloadFromJob(job: Job): ScheduleExecutionPayload | null {
233 return getSchedulePayloadFromValue(job.payload)

Calls

no outgoing calls

Tested by

no test coverage detected