export default async function route(nango, integration, _headers, body, logContextGetter) {
    if (Array.isArray(body)) {
        let connectionIds = [];
        for (const event of body) {
            const response = await nango.executeScriptForWebhooks(integration, event, 'payload.webhookEvent', 'payload.user.accountId', logContextGetter, 'accountId');
            if (response && response.connectionIds?.length > 0) {
                connectionIds = connectionIds.concat(response.connectionIds);
            }
        }
        return connectionIds;
    }
    else {
        return nango.executeScriptForWebhooks(integration, body, 'payload.webhookEvent', 'payload.user.accountId', logContextGetter, 'accountId');
    }
}
//# sourceMappingURL=jira-webhook-routing.js.map