* move custom inputs from description to own json object * show custom inputs on success page * fix type error * add custom inputs to email and webhook * add custom inputs to all emails * add values for custom inputs when rescheduling * add custom input everywhere description is shown * fix bug with boolean value * fix issues with null values * disable custom inputs and add notes for organizer * don't show custom input with empty string * don't show custom inputs with empty string in calender event and email * add link to booking details page * redirect to success page to see booking details * add functionality to cancel and reschedule booking * fix bookings that require confirmation * clean code * fix infinite lopp in useEffect of success page * show web conference details message when integration as location * improve design of cancelling event * clean code * disable darkmode for organizer on booking details page * fix dark mode for cancelling booking * fix build error * Fixes infinite loop * Fixes infinite loop * Fixes infinite loop * Update all Yarn dependencies (2022-05-16) (#2769) * Update all Yarn dependencies (2022-05-16) * Upgrade dependencies * Removes deprecated packages * Upgrades deps * Updates submodules * Update yarn.lock * Linting * Linting * Update website * Build fixes * TODO: fix this * Module resolving * Type fixes * Intercom fixes on SSG * Fixes infinite loop * Upgrades to React 18 * Type fixes * Locks node version to 14 * Upgrades daily-js * Readds missing types * Upgrades playwright * Noop when intercom is not installed * Update website * Removed yarn.lock in favor of monorepo Co-authored-by: depfu[bot] <23717796+depfu[bot]@users.noreply.github.com> Co-authored-by: zomars <zomars@me.com> * Create ci.yml * Update ci.yml * Reintroduces typescript-eslint Buckle up! * Type fixes * Update ci.yml * Update api * Update admin * Reusable inferSSRProps * Linting * Linting * Prisma fixes * Update ci.yml * Cache testing * Update e2e.yml * Update DatePicker.tsx * Update e2e.yml * Revert "Linting" This reverts commitadf817766e. * Revert "Linting" This reverts commit1b59dacd64. * Linting * Update e2e.yml * Ci updates * Add team Id to hash url (#2803) * Fix missing tabs - Embed (#2804) * Fix missing tabs * Fix Eslint error * Fix Eslint errors * Add import statement (#2812) * Add import statement * Update apps/docs/next.config.js Co-authored-by: Omar López <zomars@me.com> * Show success page if booking was deleted on calendar (#2808) * Add exception to 410 * Fix type error * Add GoogelCalError type * only show invite link for app.cal.dev (#2807) Co-authored-by: CarinaWolli <wollencarina@gmail.com> Co-authored-by: Omar López <zomars@me.com> * fix: update eslint config to test .ts and .js separately (#2805) * fix: update eslint config * fix: update ts ignore * fix: update eslint config * Update TeamAvailabilityScreen.tsx * Type fixes * Update useIntercom.ts Co-authored-by: Omar López <zomars@me.com> * fix: sync api to latest commit (#2810) Co-authored-by: Agusti Fernandez Pardo <git@agusti.me> Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com> * Embed React improvements (#2782) * Add off support. Add getApi export. * Add publish command * Add embed-snippet in prod deps * Update README * Update package.json Co-authored-by: Bailey Pumfleet <pumfleet@hey.com> Co-authored-by: zomars <zomars@me.com> Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com> * Consolidates test-results * Type fixes * Abstracts minimal booking select * Type fixes * Update listBookings.ts * Update common.json * Update bookingReminder.ts * Consolidates isOutOfBounds * Update webhookResponse-chromium.txt * Update TableActions.tsx * Type fixes * Update BookingPage.tsx * Update webhookResponse-chromium.txt Co-authored-by: CarinaWolli <wollencarina@gmail.com> Co-authored-by: Alex van Andel <me@alexvanandel.com> Co-authored-by: Bailey Pumfleet <pumfleet@hey.com> Co-authored-by: zomars <zomars@me.com> Co-authored-by: depfu[bot] <23717796+depfu[bot]@users.noreply.github.com> Co-authored-by: sean-brydon <55134778+sean-brydon@users.noreply.github.com> Co-authored-by: Hariom Balhara <hariombalhara@gmail.com> Co-authored-by: Joe Au-Yeung <65426560+joeauyeung@users.noreply.github.com> Co-authored-by: iamkun <kunhello@outlook.com> Co-authored-by: Agusti Fernandez Pardo <me@agusti.me> Co-authored-by: Agusti Fernandez Pardo <git@agusti.me> Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
160 lines
3.7 KiB
TypeScript
160 lines
3.7 KiB
TypeScript
import type { Prisma, DestinationCalendar, SelectedCalendar } from "@prisma/client";
|
|
import type { Dayjs } from "dayjs";
|
|
import type { calendar_v3 } from "googleapis";
|
|
import type { Time } from "ical.js";
|
|
import type { TFunction } from "next-i18next";
|
|
import type { Frequency as RRuleFrequency } from "rrule";
|
|
|
|
import type { Event } from "./Event";
|
|
import type { Ensure } from "./utils";
|
|
|
|
export type Person = {
|
|
name: string;
|
|
email: string;
|
|
timeZone: string;
|
|
language: { translate: TFunction; locale: string };
|
|
username?: string;
|
|
id?: string;
|
|
};
|
|
|
|
export type EventBusyDate = Record<"start" | "end", Date | string>;
|
|
|
|
export type CalendarServiceType = typeof Calendar;
|
|
|
|
export type NewCalendarEventType = {
|
|
uid: string;
|
|
id: string;
|
|
type: string;
|
|
password: string;
|
|
url: string;
|
|
additionalInfo: Record<string, any>;
|
|
};
|
|
|
|
export type CalendarEventType = {
|
|
uid: string;
|
|
etag: string;
|
|
/** This is the actual caldav event url, not the location url. */
|
|
url: string;
|
|
summary: string;
|
|
description: string;
|
|
location: string;
|
|
sequence: number;
|
|
startDate: Date | Dayjs;
|
|
endDate: Date | Dayjs;
|
|
duration: {
|
|
weeks: number;
|
|
days: number;
|
|
hours: number;
|
|
minutes: number;
|
|
seconds: number;
|
|
isNegative: boolean;
|
|
};
|
|
organizer: string;
|
|
attendees: any[][];
|
|
recurrenceId: Time;
|
|
timezone: any;
|
|
};
|
|
|
|
export type BatchResponse = {
|
|
responses: SubResponse[];
|
|
};
|
|
|
|
export type SubResponse = {
|
|
body: {
|
|
value: {
|
|
showAs: "free" | "tentative" | "away" | "busy" | "workingElsewhere";
|
|
start: { dateTime: string };
|
|
end: { dateTime: string };
|
|
}[];
|
|
};
|
|
};
|
|
|
|
export interface ConferenceData {
|
|
createRequest?: calendar_v3.Schema$CreateConferenceRequest;
|
|
}
|
|
|
|
export interface AdditionInformation {
|
|
conferenceData?: ConferenceData;
|
|
entryPoints?: EntryPoint[];
|
|
hangoutLink?: string;
|
|
}
|
|
|
|
export interface RecurringEvent {
|
|
dtstart?: Date | undefined;
|
|
interval?: number;
|
|
count?: number;
|
|
freq?: RRuleFrequency;
|
|
until?: Date | undefined;
|
|
tzid?: string | undefined;
|
|
}
|
|
|
|
// If modifying this interface, probably should update builders/calendarEvent files
|
|
export interface CalendarEvent {
|
|
type: string;
|
|
title: string;
|
|
startTime: string;
|
|
endTime: string;
|
|
organizer: Person;
|
|
attendees: Person[];
|
|
additionalNotes?: string | null;
|
|
customInputs?: Prisma.JsonObject | null;
|
|
description?: string | null;
|
|
team?: {
|
|
name: string;
|
|
members: string[];
|
|
};
|
|
location?: string | null;
|
|
conferenceData?: ConferenceData;
|
|
additionInformation?: AdditionInformation;
|
|
uid?: string | null;
|
|
videoCallData?: VideoCallData;
|
|
paymentInfo?: PaymentInfo | null;
|
|
destinationCalendar?: DestinationCalendar | null;
|
|
cancellationReason?: string | null;
|
|
rejectionReason?: string | null;
|
|
hideCalendarNotes?: boolean;
|
|
recurrence?: string;
|
|
}
|
|
|
|
export interface EntryPoint {
|
|
entryPointType?: string;
|
|
uri?: string;
|
|
label?: string;
|
|
pin?: string;
|
|
accessCode?: string;
|
|
meetingCode?: string;
|
|
passcode?: string;
|
|
password?: string;
|
|
}
|
|
|
|
export interface AdditionInformation {
|
|
conferenceData?: ConferenceData;
|
|
entryPoints?: EntryPoint[];
|
|
hangoutLink?: string;
|
|
}
|
|
|
|
export interface IntegrationCalendar extends Ensure<Partial<SelectedCalendar>, "externalId"> {
|
|
primary?: boolean;
|
|
name?: string;
|
|
}
|
|
|
|
export interface Calendar {
|
|
createEvent(event: CalendarEvent): Promise<NewCalendarEventType>;
|
|
|
|
updateEvent(
|
|
uid: string,
|
|
event: CalendarEvent,
|
|
externalCalendarId?: string | null
|
|
): Promise<Event | Event[]>;
|
|
|
|
deleteEvent(uid: string, event: CalendarEvent, externalCalendarId?: string | null): Promise<unknown>;
|
|
|
|
getAvailability(
|
|
dateFrom: string,
|
|
dateTo: string,
|
|
selectedCalendars: IntegrationCalendar[]
|
|
): Promise<EventBusyDate[]>;
|
|
|
|
listCalendars(event?: CalendarEvent): Promise<IntegrationCalendar[]>;
|
|
}
|