Add Feishu channel adapter with webhook and send path
This commit is contained in:
@@ -24,6 +24,7 @@ describe('registerChannels', () => {
|
||||
setGoogleChatHandler: vi.fn(),
|
||||
setBlueBubblesHandler: vi.fn(),
|
||||
setLineHandler: vi.fn(),
|
||||
setFeishuHandler: vi.fn(),
|
||||
};
|
||||
|
||||
registerChannels({
|
||||
@@ -57,6 +58,7 @@ describe('registerChannels', () => {
|
||||
setGoogleChatHandler: vi.fn(),
|
||||
setBlueBubblesHandler: vi.fn(),
|
||||
setLineHandler: vi.fn(),
|
||||
setFeishuHandler: vi.fn(),
|
||||
};
|
||||
|
||||
registerChannels({
|
||||
@@ -70,4 +72,38 @@ describe('registerChannels', () => {
|
||||
expect(names).toContain('line');
|
||||
expect(gateway.setLineHandler).toHaveBeenCalledTimes(1);
|
||||
});
|
||||
|
||||
it('registers Feishu adapter when configured', () => {
|
||||
const config = configSchema.parse({
|
||||
telegram: { bot_token: 'test-token', allowed_chat_ids: [1] },
|
||||
models: { default: { provider: 'anthropic', model: 'claude-3' } },
|
||||
feishu: {
|
||||
app_id: 'cli_a1b2c3',
|
||||
app_secret: 'secret',
|
||||
allowed_chat_ids: ['oc_123'],
|
||||
},
|
||||
});
|
||||
|
||||
const channelRegistry = new ChannelRegistry();
|
||||
const gateway = {
|
||||
setWebhookHandler: vi.fn(),
|
||||
setGmailHandler: vi.fn(),
|
||||
setTeamsHandler: vi.fn(),
|
||||
setGoogleChatHandler: vi.fn(),
|
||||
setBlueBubblesHandler: vi.fn(),
|
||||
setLineHandler: vi.fn(),
|
||||
setFeishuHandler: vi.fn(),
|
||||
};
|
||||
|
||||
registerChannels({
|
||||
config,
|
||||
channelRegistry,
|
||||
hookEngine: new HookEngine(config.hooks),
|
||||
gateway: gateway as unknown as Parameters<typeof registerChannels>[0]['gateway'],
|
||||
});
|
||||
|
||||
const names = channelRegistry.list().map((adapter) => adapter.name);
|
||||
expect(names).toContain('feishu');
|
||||
expect(gateway.setFeishuHandler).toHaveBeenCalledTimes(1);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user