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

Function getTriggerId

apps/sim/lib/workflows/blocks/block-outputs.ts:168–184  ·  view source on GitHub ↗
(
  subBlocks: Record<string, SubBlockWithValue> | undefined,
  blockConfig: BlockConfig
)

Source from the content-addressed store, hash-verified

166}
167
168function getTriggerId(
169 subBlocks: Record<string, SubBlockWithValue> | undefined,
170 blockConfig: BlockConfig
171): string | undefined {
172 const selectedTriggerIdValue = subBlocks?.selectedTriggerId?.value
173 const triggerIdValue = subBlocks?.triggerId?.value
174
175 return (
176 (typeof selectedTriggerIdValue === 'string' && isTriggerValid(selectedTriggerIdValue)
177 ? selectedTriggerIdValue
178 : undefined) ||
179 (typeof triggerIdValue === 'string' && isTriggerValid(triggerIdValue)
180 ? triggerIdValue
181 : undefined) ||
182 blockConfig.triggers?.available?.[0]
183 )
184}
185
186function getUnifiedStartOutputs(
187 subBlocks: Record<string, SubBlockWithValue> | undefined

Callers 1

getBlockOutputsFunction · 0.85

Calls 1

isTriggerValidFunction · 0.90

Tested by

no test coverage detected