Files
botpress--botpress/integrations/googlecalendar/src/webhook-events/handler-dispatcher.ts
T
2026-07-13 13:34:48 +08:00

12 lines
474 B
TypeScript

import { oauthCallbackHandler } from './handlers/oauth-callback'
import * as bp from '.botpress'
export const handler: bp.IntegrationProps['handler'] = async ({ client, ctx, logger, req }) => {
if (req.path === '/oauth') {
logger.forBot().info('Handling Google Calendar OAuth callback')
await oauthCallbackHandler({ client, ctx, req, logger })
} else {
logger.forBot().debug('Received unsupported webhook event', { path: req.path, query: req.query })
}
}