| 5003 | } |
| 5004 | |
| 5005 | function getHookDefinitionsForTelemetry( |
| 5006 | matchedHooks: MatchedHook[], |
| 5007 | ): Array<{ type: string; command?: string; prompt?: string; name?: string }> { |
| 5008 | return matchedHooks.map(({ hook }) => { |
| 5009 | if (hook.type === 'command') { |
| 5010 | return { type: 'command', command: hook.command } |
| 5011 | } else if (hook.type === 'prompt') { |
| 5012 | return { type: 'prompt', prompt: hook.prompt } |
| 5013 | } else if (hook.type === 'http') { |
| 5014 | return { type: 'http', command: hook.url } |
| 5015 | } else if (hook.type === 'function') { |
| 5016 | return { type: 'function', name: 'function' } |
| 5017 | } else if (hook.type === 'callback') { |
| 5018 | return { type: 'callback', name: 'callback' } |
| 5019 | } |
| 5020 | return { type: 'unknown' } |
| 5021 | }) |
| 5022 | } |