Skip to content

AI Agents & MCPs & AI Workflow Automation • (~400 MCP servers for AI agents) • AI Automation / AI Agent with MCPs • AI Workflows & AI Agents • MCPs for AI Agents

764 B
Raw Blame
import { isNil } from '@activepieces/core-utils'
import { ResolveEventDestinationHeadersRequest, ResolveEventDestinationHeadersResponse } from '@activepieces/shared'
import { FastifyBaseLogger } from 'fastify'
import { eventDestinationService } from './event-destinations.service'

export const eventDestinationRpcHandlers = (log: FastifyBaseLogger) => ({
    async resolveEventDestinationHeaders({ platformId, destinationId, destinationUrl }: ResolveEventDestinationHeadersRequest): Promise<ResolveEventDestinationHeadersResponse> {
        const headers = await eventDestinationService(log).resolveDeliveryHeaders({ platformId, destinationId, destinationUrl })
        if (isNil(headers)) {
            return null
        }
        return { headers }
    },
})