( webhookUrl: string, secret?: string, )
| 47 | } |
| 48 | |
| 49 | export async function verifyWebhook( |
| 50 | webhookUrl: string, |
| 51 | secret?: string, |
| 52 | ): Promise<{ ok: true }> { |
| 53 | if (!isValidWebhookUrl(webhookUrl)) { |
| 54 | throw new Error('Invalid Feishu webhook URL format'); |
| 55 | } |
| 56 | |
| 57 | await postWebhook(webhookUrl, { |
| 58 | msg_type: 'text', |
| 59 | content: { text: 'MedKit 连通性测试 ✓' }, |
| 60 | ...buildSignFields(secret), |
| 61 | }); |
| 62 | |
| 63 | return { ok: true }; |
| 64 | } |
| 65 | |
| 66 | export async function sendWebhook( |
| 67 | webhookUrl: string, |
nothing calls this directly
no test coverage detected