mirror of
https://github.com/hanzoai/calendar.git
synced 2026-09-24 22:42:24 +00:00
* zapier and webhook * instructions for zapier * Fix types * fix types * revert adding zap template * Update packages/app-store/zapier/README.md Co-authored-by: Carina Wollendorfer <[email protected]> * Update packages/app-store/zapier/README.md Co-authored-by: Carina Wollendorfer <[email protected]> * Update packages/app-store/zapier/README.md Co-authored-by: Carina Wollendorfer <[email protected]> * Update packages/features/webhooks/lib/scheduleTrigger.ts Co-authored-by: Carina Wollendorfer <[email protected]> * wip * Fixes from comments, no more sendPayloadNoBooking * fix subscriberOptions teamIds param type * types * Update packages/features/webhooks/lib/sendPayload.ts * Re add zapierPayload to don't break old zaps * instead of metadata use oooEntry inside webhookPayload * undo comment message * Types * reset changes on yarn.lock * review changes * fix types * fix types * tentative fix for types in webhook * type improvements * fix description + clean up * revert yarn.lock changes * allow custom template for ooo entry * type fixes * type fix * fix donwloadLinks in payload * simplify some types * allow array or number for teamId * same payload for test trigger * code clean up * fix no show e2e test * translate text for webhook payload and fix conditional * add test for ooo_created webhooks * reset files * merge fix * fix test data test id * remove unused variable * only trigger for accepted memberships * remove unused variable --------- Co-authored-by: Carina Wollendorfer <[email protected]> Co-authored-by: CarinaWolli <[email protected]> Co-authored-by: Udit Takkar <[email protected]> Co-authored-by: Keith Williams <[email protected]> Co-authored-by: Omar López <[email protected]>
41 lines
1023 B
TypeScript
41 lines
1023 B
TypeScript
import type { EventPayloadType, EventTypeInfo } from "@calcom/features/webhooks/lib/sendPayload";
|
|
import type { CalendarEvent } from "@calcom/types/Calendar";
|
|
|
|
export const getWebhookPayloadForBooking = ({
|
|
booking,
|
|
evt,
|
|
}: {
|
|
booking: {
|
|
eventType: {
|
|
title: string;
|
|
description: string | null;
|
|
requiresConfirmation: boolean;
|
|
price: number;
|
|
currency: string;
|
|
length: number;
|
|
id: number;
|
|
} | null;
|
|
id: number;
|
|
eventTypeId: number | null;
|
|
userId: number | null;
|
|
};
|
|
evt: CalendarEvent;
|
|
}) => {
|
|
const eventTypeInfo: EventTypeInfo = {
|
|
eventTitle: booking.eventType?.title,
|
|
eventDescription: booking.eventType?.description,
|
|
requiresConfirmation: booking.eventType?.requiresConfirmation || null,
|
|
price: booking.eventType?.price,
|
|
currency: booking.eventType?.currency,
|
|
length: booking.eventType?.length,
|
|
};
|
|
|
|
const payload: EventPayloadType = {
|
|
...evt,
|
|
...eventTypeInfo,
|
|
bookingId: booking.id,
|
|
};
|
|
|
|
return payload;
|
|
};
|