Skip to content

armgit / macro

Public Imported from GitHub
0

Macro is a unified workspace for teams: email, chat, docs, tasks, agents, calls, and CRM — @-linked together with shared AI memory.

feat(calendar): calendar event mentions with viewer-relative previews (#5731)

gbirman0c847232d264
diff --git a/.sqlx/query-3fbe926f3799c34ca5df0e947e387203a9700ca0aaec3609a84078aa3f50ae98.json b/.sqlx/query-3fbe926f3799c34ca5df0e947e387203a9700ca0aaec3609a84078aa3f50ae98.json
new file mode 100644
index 0000000000..c1ffd696f1
--- /dev/null
+++ b/.sqlx/query-3fbe926f3799c34ca5df0e947e387203a9700ca0aaec3609a84078aa3f50ae98.json
@@ -0,0 +1,133 @@
+{
+ "db_name": "PostgreSQL",
+ "query": "\n SELECT\n (mentioned.id IS NOT NULL) AS \"mention_exists!\",\n viewer_event.id AS \"viewer_event_id?\",\n viewer_event.title AS \"title?\",\n viewer_event.location AS \"location?\",\n viewer_event.organizer_email AS \"organizer_email?\",\n viewer_event.organizer_name AS \"organizer_name?\",\n viewer_event.recurrence_lines AS \"recurrence_lines?\",\n viewer_event.starts_at AS \"event_starts_at?\",\n viewer_event.ends_at AS \"event_ends_at?\",\n viewer_event.start_date AS \"event_start_date?\",\n viewer_event.end_date AS \"event_end_date?\",\n viewer_event.time_zone AS \"time_zone?\",\n viewer_event.updated_at AS \"updated_at?\",\n occurrence.occurrence_key AS \"occurrence_key?\",\n occurrence.starts_at AS \"occurrence_starts_at?\",\n occurrence.ends_at AS \"occurrence_ends_at?\",\n occurrence.start_date AS \"occurrence_start_date?\",\n occurrence.end_date AS \"occurrence_end_date?\",\n attendees.attendee_count AS \"attendee_count?\"\n FROM unnest($2::uuid[], $3::text[])\n WITH ORDINALITY AS requested(event_id, occurrence_key, ord)\n LEFT JOIN calendar_events mentioned\n ON mentioned.id = requested.event_id\n AND mentioned.status <> 'cancelled'\n LEFT JOIN LATERAL (\n SELECT\n candidate.id,\n candidate.title,\n candidate.location,\n candidate.organizer_email,\n candidate.organizer_name,\n candidate.recurrence_lines,\n candidate.starts_at,\n candidate.ends_at,\n candidate.start_date,\n candidate.end_date,\n candidate.time_zone,\n candidate.updated_at\n FROM calendar_events candidate\n WHERE candidate.ical_uid = mentioned.ical_uid\n AND candidate.status <> 'cancelled'\n AND (\n candidate.owner_id = $1\n OR EXISTS (\n SELECT 1\n FROM macro_user_links link\n WHERE link.link_id = candidate.source_link_id\n AND link.primary_macro_id = $1\n )\n )\n ORDER BY\n (candidate.owner_id = $1) DESC,\n (candidate.id = mentioned.id) DESC,\n candidate.updated_at DESC,\n candidate.id\n LIMIT 1\n ) viewer_event ON true\n LEFT JOIN LATERAL (\n SELECT\n instance.occurrence_key,\n instance.starts_at,\n instance.ends_at,\n instance.start_date,\n instance.end_date\n FROM calendar_event_occurrences instance\n CROSS JOIN LATERAL (\n SELECT COALESCE(\n instance.starts_at,\n instance.start_date::timestamp AT TIME ZONE 'UTC'\n ) AS at\n ) instance_start\n WHERE instance.event_id = viewer_event.id\n AND NOT instance.is_cancelled\n ORDER BY\n (instance.occurrence_key\n IS NOT DISTINCT FROM requested.occurrence_key) DESC,\n (instance_start.at >= $4) DESC,\n CASE WHEN instance_start.at >= $4 THEN instance_start.at END ASC,\n instance_start.at DESC,\n instance.occurrence_key\n LIMIT 1\n ) occurrence ON true\n LEFT JOIN LATERAL (\n SELECT count(*) AS attendee_count\n FROM calendar_event_attendees attendee\n WHERE attendee.event_id = viewer_event.id\n ) attendees ON true\n ORDER BY requested.ord\n ",
+ "describe": {
+ "columns": [
+ {
+ "ordinal": 0,
+ "name": "mention_exists!",
+ "type_info": "Bool"
+ },
+ {
+ "ordinal": 1,
+ "name": "viewer_event_id?",
+ "type_info": "Uuid"
+ },
+ {
+ "ordinal": 2,
+ "name": "title?",
+ "type_info": "Text"
+ },
+ {
+ "ordinal": 3,
+ "name": "location?",
+ "type_info": "Text"
+ },
+ {
+ "ordinal": 4,
+ "name": "organizer_email?",
+ "type_info": "Text"
+ },
+ {
+ "ordinal": 5,
+ "name": "organizer_name?",
+ "type_info": "Text"
+ },
+ {
+ "ordinal": 6,
+ "name": "recurrence_lines?",
+ "type_info": "TextArray"
+ },
+ {
+ "ordinal": 7,
+ "name": "event_starts_at?",
+ "type_info": "Timestamptz"
+ },
+ {
+ "ordinal": 8,
+ "name": "event_ends_at?",
+ "type_info": "Timestamptz"
+ },
+ {
+ "ordinal": 9,
+ "name": "event_start_date?",
+ "type_info": "Date"
+ },
+ {
+ "ordinal": 10,
+ "name": "event_end_date?",
+ "type_info": "Date"
+ },
+ {
+ "ordinal": 11,
+ "name": "time_zone?",
+ "type_info": "Text"
+ },
+ {
+ "ordinal": 12,
+ "name": "updated_at?",
+ "type_info": "Timestamptz"
+ },
+ {
+ "ordinal": 13,
+ "name": "occurrence_key?",
+ "type_info": "Text"
+ },
+ {
+ "ordinal": 14,
+ "name": "occurrence_starts_at?",
+ "type_info": "Timestamptz"
+ },
+ {
+ "ordinal": 15,
+ "name": "occurrence_ends_at?",
+ "type_info": "Timestamptz"
+ },
+ {
+ "ordinal": 16,
+ "name": "occurrence_start_date?",
+ "type_info": "Date"
+ },
+ {
+ "ordinal": 17,
+ "name": "occurrence_end_date?",
+ "type_info": "Date"
+ },
+ {
+ "ordinal": 18,
+ "name": "attendee_count?",
+ "type_info": "Int8"
+ }
+ ],
+ "parameters": {
+ "Left": [
+ "Text",
+ "UuidArray",
+ "TextArray",
+ "Timestamptz"
+ ]
+ },
+ "nullable": [
+ null,
+ true,
+ true,
+ true,
+ true,
+ true,
+ true,
+ true,
+ true,
+ true,
+ true,
+ true,
+ true,
+ true,
+ true,
+ true,
+ true,
+ true,
+ null
+ ]
+ },
+ "hash": "3fbe926f3799c34ca5df0e947e387203a9700ca0aaec3609a84078aa3f50ae98"
+}
diff --git a/apps/web/src/features/block-calendar/CalendarBlockAdapter.tsx b/apps/web/src/features/block-calendar/CalendarBlockAdapter.tsx
index efafe33e1f..80813714af 100644
--- a/apps/web/src/features/block-calendar/CalendarBlockAdapter.tsx
+++ b/apps/web/src/features/block-calendar/CalendarBlockAdapter.tsx
@@ -8,10 +8,15 @@ import { LoadingBlock } from '@core/component/LoadingBlock';
import { useUserId } from '@core/context/user';
import { createMethodRegistration } from '@core/orchestrator';
import { blockHandleSignal } from '@core/signal/load';
+import { fetchCalendarMentionPreview } from '@queries/calendar/mention-preview';
import { useCalendarOccurrencesQuery } from '@queries/calendar/occurrences';
import { createMemo, createSignal, onMount, Show } from 'solid-js';
import { CalendarFocusContextProvider } from './calendar-focus-target';
-import { isCalendarBlockRange } from './calendar-range';
+import {
+ type CalendarBlockEventTime,
+ createCalendarBlockRange,
+ isCalendarBlockRange,
+} from './calendar-range';
import { resolveCalendarBlockTarget } from './calendar-target';
import { Workspace } from './components/Workspace';
import type { CalendarBlockProps, CalendarBlockTargetRequest } from './types';
@@ -40,6 +45,51 @@ function targetRequestFromParams(
};
}
+/**
+ * A target with an event id but no usable range — a copied `/app/calendar`
+ * link or a mention without preview data — resolves through the calendar
+ * mention preview API, which also maps another user's projection of the
+ * meeting to the viewer's own copy.
+ */
+async function resolveTargetRequestFromPreview(
+ params: CalendarBlockProps,
+ requestId: number
+): Promise<CalendarBlockTargetRequest | undefined> {
+ if (typeof params.eventId !== 'string' || params.eventId.length === 0) {
+ return undefined;
+ }
+ const occurrenceKey =
+ typeof params.occurrenceKey === 'string' ? params.occurrenceKey : undefined;
+ const event = await fetchCalendarMentionPreview(
+ params.eventId,
+ occurrenceKey
+ ).catch(() => null);
+ if (!event) return undefined;
+
+ const time: CalendarBlockEventTime =
+ event.time.kind === 'timed'
+ ? {
+ kind: 'timed',
+ startsAt: event.time.startsAt,
+ endsAt: event.time.endsAt,
+ }
+ : {
+ kind: 'allDay',
+ startDate: event.time.startDate,
+ endDate: event.time.endDate,
+ };
+ const range = createCalendarBlockRange(time);
+ if (!range) return undefined;
+
+ return {
+ eventId: event.viewerEventId,
+ range,
+ occurrenceKey: event.occurrenceKey ?? occurrenceKey,
+ requestId,
+ requestedAt: Date.now(),
+ };
+}
+
function CalendarBlockDisabledRedirect() {
const panel = useSplitPanelOrThrow();
onMount(() => {
@@ -56,17 +106,42 @@ function CalendarBlockAdapter(props: CalendarBlockProps) {
const analytics = useAnalytics();
const blockHandle = blockHandleSignal.get;
let nextRequestId = 1;
+ let latestRequestId = 0;
const [targetRequest, setTargetRequest] = createSignal<
CalendarBlockTargetRequest | undefined
>(targetRequestFromParams(props, nextRequestId++));
+ // Preview resolution is async, so a stale answer must never clobber a
+ // target the user has since re-aimed or cleared.
+ const applyResolvedTarget = (request: CalendarBlockTargetRequest) => {
+ if (request.requestId < latestRequestId) return;
+ setTargetRequest(request);
+ };
+
+ const aimAtParams = (params: CalendarBlockProps) => {
+ const requestId = nextRequestId++;
+ latestRequestId = requestId;
+ const direct = targetRequestFromParams(params, requestId);
+ if (direct) {
+ setTargetRequest(direct);
+ return;
+ }
+ if (typeof params.eventId === 'string' && params.eventId.length > 0) {
+ resolveTargetRequestFromPreview(params, requestId).then((resolved) => {
+ if (resolved) applyResolvedTarget(resolved);
+ });
+ return;
+ }
+ setTargetRequest(undefined);
+ };
+
+ if (!targetRequest() && typeof props.eventId === 'string' && props.eventId) {
+ aimAtParams(props);
+ }
+
createMethodRegistration(blockHandle, {
goToLocationFromParams: async (params: Record<string, unknown>) => {
- const request = targetRequestFromParams(
- params as CalendarBlockProps,
- nextRequestId++
- );
- setTargetRequest(request);
+ aimAtParams(params as CalendarBlockProps);
},
});
diff --git a/apps/web/src/features/block-calendar/components/SelectedEventDetails.tsx b/apps/web/src/features/block-calendar/components/SelectedEventDetails.tsx
index d3e8ff890e..f5f65691b7 100644
--- a/apps/web/src/features/block-calendar/components/SelectedEventDetails.tsx
+++ b/apps/web/src/features/block-calendar/components/SelectedEventDetails.tsx
@@ -10,6 +10,7 @@ import { MobileDrawer } from '@components/app/mobile/MobileDrawer';
import { toast } from '@core/component/Toast/Toast';
import { isMobile } from '@core/mobile/isMobile';
import { Popover } from '@kobalte/core/popover';
+import LinkIcon from '@phosphor/link.svg';
import PencilSimpleIcon from '@phosphor/pencil-simple.svg';
import TrashIcon from '@phosphor/trash.svg';
import CloseIcon from '@phosphor/x.svg';
@@ -25,6 +26,7 @@ import {
useImperativeDialog,
} from '@ui';
import { type Accessor, createMemo, createSignal, Show } from 'solid-js';
+import { copyCalendarEventMention } from '../copy-event-mention';
import { EventRsvpSection } from './EventRsvpSection';
import { useOpenEventComposer } from './use-open-event-composer';
@@ -156,8 +158,18 @@ function EventDetailsDrawer(props: EventDetailsOverlayProps) {
>
<CloseIcon />
</MobileDrawer.Close>
- <Show when={canModify()}>
- <div class="flex items-center gap-1">
+ <div class="flex items-center gap-1">
+ <Button
+ aria-label="Copy event"
+ variant="ghost"
+ size="icon-md"
+ depth={3}
+ class="rounded-md text-ink-extra-muted [&_svg]:size-4"
+ onClick={() => copyCalendarEventMention(props.event)}
+ >
+ <LinkIcon />
+ </Button>
+ <Show when={canModify()}>
<Button
aria-label="Edit event"
variant="ghost"
@@ -178,8 +190,8 @@ function EventDetailsDrawer(props: EventDetailsOverlayProps) {
>
<TrashIcon />
</Button>
- </div>
- </Show>
+ </Show>
+ </div>
</div>
<div class="flex min-h-0 flex-1 flex-col overflow-y-auto">
<div class="px-3">
@@ -367,6 +379,16 @@ function EventDetailsPopover(props: EventDetailsPopoverProps) {
<div class="w-fit min-w-[min(20rem,calc(100vw-2rem))] max-w-[min(24rem,calc(100vw-2rem))] overflow-hidden rounded-xl bg-surface text-ink shadow-menu ring ring-edge-muted">
<Popover.Title class="sr-only">{props.event.title}</Popover.Title>
<div class="flex items-center justify-end gap-1 px-2 pt-2">
+ <Button
+ aria-label="Copy event"
+ variant="ghost"
+ size="icon-sm"
+ depth={3}
+ class="rounded-md text-ink-muted [&_svg]:size-4"
+ onClick={() => copyCalendarEventMention(props.event)}
+ >
+ <LinkIcon />
+ </Button>
<Show when={canModify()}>
<Button
aria-label="Edit event"
diff --git a/apps/web/src/features/block-calendar/copy-event-mention.ts b/apps/web/src/features/block-calendar/copy-event-mention.ts
new file mode 100644
index 0000000000..7cb9720671
--- /dev/null
+++ b/apps/web/src/features/block-calendar/copy-event-mention.ts
@@ -0,0 +1,68 @@
+import type { CalendarEvent } from '@app/features/calendar/types';
+import { toast } from '@core/component/Toast/Toast';
+import { writeClipboardData } from '@core/util/dataTransfer';
+import { CALENDAR_BLOCK_ID } from './types';
+
+function isRecurring(event: CalendarEvent): boolean {
+ return event.recurrenceLines.length > 0 || event.recurrenceId !== undefined;
+}
+
+/**
+ * The same span shape `DocumentMentionNode.exportDOM` copies, so pasting
+ * into any Macro editor reconstructs a live calendar mention through
+ * `importDOM`. A series mention names the whole event; an instance of a
+ * recurring event pins its occurrence key.
+ */
+function mentionHtml(event: CalendarEvent): string {
+ const span = document.createElement('span');
+ span.setAttribute('data-document-mention', 'true');
+ span.setAttribute('data-document-id', event.eventId);
+ span.setAttribute('data-document-name', event.title);
+ span.setAttribute('data-block-name', 'calendar');
+ if (isRecurring(event)) {
+ span.setAttribute(
+ 'data-block-params',
+ JSON.stringify({ occurrenceKey: event.occurrenceKey })
+ );
+ }
+ span.textContent = event.title;
+ return span.outerHTML;
+}
+
+/**
+ * Deep link to one event on the singleton calendar block, using the same
+ * host convention as the copy-link actions elsewhere in the app.
+ */
+export function calendarEventDeepLink(target: {
+ eventId: string;
+ occurrenceKey?: string;
+}): string {
+ let hostname = window.location.hostname.replace('www.', '').toLowerCase();
+ if (hostname === 'localhost') {
+ hostname = 'dev.macro.com';
+ }
+ const params = new URLSearchParams({
+ eventId: target.eventId,
+ ...(target.occurrenceKey ? { occurrenceKey: target.occurrenceKey } : {}),
+ });
+ return `https://${hostname}/app/calendar/${CALENDAR_BLOCK_ID}?${params.toString()}`;
+}
+
+/**
+ * Copy an event to the clipboard as a calendar mention (rich flavor) with a
+ * deep link fallback (plain flavor). Must be called from a user gesture.
+ */
+export async function copyCalendarEventMention(event: CalendarEvent) {
+ const written = await writeClipboardData({
+ 'text/html': mentionHtml(event),
+ 'text/plain': calendarEventDeepLink({
+ eventId: event.eventId,
+ occurrenceKey: isRecurring(event) ? event.occurrenceKey : undefined,
+ }),
+ });
+ if (written) {
+ toast.success('Copied event to clipboard');
+ } else {
+ toast.failure('Failed to copy event');
+ }
+}
diff --git a/apps/web/src/features/block-calendar/open-calendar-event.ts b/apps/web/src/features/block-calendar/open-calendar-event.ts
new file mode 100644
index 0000000000..166906c2ce
--- /dev/null
+++ b/apps/web/src/features/block-calendar/open-calendar-event.ts
@@ -0,0 +1,79 @@
+import { globalSplitManager } from '@app/signal/splitLayout';
+import { ENABLE_CALENDAR_UI } from '@core/constant/featureFlags';
+import {
+ type CalendarBlockEventTime,
+ createCalendarBlockRange,
+} from './calendar-range';
+import { CALENDAR_BLOCK_ID, type CalendarBlockProps } from './types';
+
+export type CalendarEventOpenTarget = {
+ /** The viewer's own event entity to focus. */
+ eventId: string;
+ /** Instance to focus, for recurring events. */
+ occurrenceKey?: string;
+ /** Instance timing used to build the locator range. */
+ time?: CalendarBlockEventTime;
+ openInNewSplit?: boolean;
+};
+
+/**
+ * Timed occurrence keys are the instance's RFC 3339 start and all-day keys
+ * its YYYY-MM-DD start date, so a key alone can anchor the locator range
+ * when no richer timing is at hand.
+ */
+export function eventTimeFromOccurrenceKey(
+ occurrenceKey: string
+): CalendarBlockEventTime | undefined {
+ if (/^\d{4}-\d{2}-\d{2}$/.test(occurrenceKey)) {
+ return { kind: 'allDay', startDate: occurrenceKey };
+ }
+ const startsAt = new Date(occurrenceKey);
+ if (!Number.isFinite(startsAt.getTime())) return undefined;
+ return { kind: 'timed', startsAt: occurrenceKey };
+}
+
+/**
+ * Open the singleton calendar block focused on one event occurrence,
+ * mirroring how soup rows and notifications retarget the calendar. Repeat
+ * opens re-aim the already-open split instead of stacking another calendar.
+ */
+export async function openCalendarEventSplit(target: CalendarEventOpenTarget) {
+ if (!ENABLE_CALENDAR_UI()) return;
+ const splitManager = globalSplitManager();
+ if (!splitManager) return;
+
+ const time =
+ target.time ??
+ (target.occurrenceKey
+ ? eventTimeFromOccurrenceKey(target.occurrenceKey)
+ : undefined);
+ const params: CalendarBlockProps = {
+ eventId: target.eventId,
+ occurrenceKey: target.occurrenceKey,
+ range: time ? createCalendarBlockRange(time) : undefined,
+ };
+
+ const existing = splitManager.getSplitByContent(
+ 'calendar',
+ CALENDAR_BLOCK_ID
+ );
+ if (existing) {
+ existing.activate();
+ } else {
+ splitManager.openWithSplit(
+ { type: 'calendar', id: CALENDAR_BLOCK_ID, params },
+ {
+ activate: true,
+ referredFrom: null,
+ preferNewSplit: target.openInNewSplit,
+ }
+ );
+ }
+
+ const orchestrator = splitManager.getOrchestrator();
+ const handle = await orchestrator.getBlockHandle(
+ CALENDAR_BLOCK_ID,
+ 'calendar'
+ );
+ await handle?.goToLocationFromParams(params);
+}
diff --git a/apps/web/src/features/entity/queries/rename.ts b/apps/web/src/features/entity/queries/rename.ts
index 266e5df296..fd9d746d43 100644
--- a/apps/web/src/features/entity/queries/rename.ts
+++ b/apps/web/src/features/entity/queries/rename.ts
@@ -268,6 +268,9 @@ const renameCallRecordSetData = (
const renamePreviewSetData = (entities: EntityRenameOptimisticInfo[]) => {
entities.forEach(({ id, newName, itemType }) => {
+ // Calendar event previews are API-served projections keyed to the
+ // viewer's copy; renames flow through calendar mutations instead.
+ if (itemType === 'calendar_event') return;
setPreviewName({
itemId: id,
name: newName,
diff --git a/apps/web/src/lib/core/component/DocumentPreview.tsx b/apps/web/src/lib/core/component/DocumentPreview.tsx
index c2343f0f47..37ea920d61 100644
--- a/apps/web/src/lib/core/component/DocumentPreview.tsx
+++ b/apps/web/src/lib/core/component/DocumentPreview.tsx
@@ -1,5 +1,9 @@
+import { parseLocalDate } from '@app/features/calendar/utils/calendar-date';
import { openChatWithAgent } from '@app/features/chat/ChatWithAgentButton';
import { globalSplitManager } from '@app/signal/splitLayout';
+import { calendarEventDeepLink } from '@block-calendar/copy-event-mention';
+import { openCalendarEventSplit } from '@block-calendar/open-calendar-event';
+import { CALENDAR_BLOCK_ID } from '@block-calendar/types';
import { URL_PARAMS as URL_PARAMS_CANVAS } from '@block-canvas/constants';
import { URL_PARAMS as CHANNEL_PARAMS } from '@block-channel/constants';
import { URL_PARAMS as URL_PARAMS_MD } from '@block-md/constants';
@@ -34,14 +38,17 @@ import MapPinIcon from '@phosphor/map-pin-simple.svg';
import SparkleIcon from '@phosphor/sparkle.svg';
import LoadingSpinner from '@phosphor/spinner.svg';
import TrashSimple from '@phosphor/trash-simple.svg';
+import UsersIcon from '@phosphor/users.svg';
import { Property } from '@property';
import { SYSTEM_PROPERTY_IDS } from '@property/constants';
import { useEntityProperties } from '@property/hooks';
import { getEntityValues, hasValue } from '@property/utils';
import {
isAccessiblePreviewItem,
+ isCalendarEventPreviewItem,
isChannelPreviewItem,
isPreviewItemNoAccess,
+ type PreviewCalendarEventAccess,
} from '@queries/preview';
import { useBinaryDocumentQuery } from '@queries/storage/binary-document';
import { blockNameToItemType } from '@service-storage/client';
@@ -451,6 +458,82 @@ function PreviewPropertyPill(props: {
);
}
+const calendarDateFormat = new Intl.DateTimeFormat(undefined, {
+ weekday: 'short',
+ month: 'short',
+ day: 'numeric',
+});
+const calendarTimeFormat = new Intl.DateTimeFormat(undefined, {
+ hour: 'numeric',
+ minute: '2-digit',
+});
+
+/** One compact local-time schedule line for a calendar mention preview. */
+export function calendarPreviewSchedule(
+ event: PreviewCalendarEventAccess['event']
+): string | undefined {
+ if (event.time.kind === 'allDay') {
+ const start = parseLocalDate(event.time.startDate);
+ if (!start) return undefined;
+ const end = parseLocalDate(event.time.endDate);
+ const inclusiveEnd = end ? new Date(end) : undefined;
+ inclusiveEnd?.setDate(inclusiveEnd.getDate() - 1);
+ return inclusiveEnd && inclusiveEnd > start
+ ? `${calendarDateFormat.format(start)} – ${calendarDateFormat.format(inclusiveEnd)} · All day`
+ : `${calendarDateFormat.format(start)} · All day`;
+ }
+ const start = new Date(event.time.startsAt);
+ const end = new Date(event.time.endsAt);
+ if (!Number.isFinite(start.getTime())) return undefined;
+ if (!Number.isFinite(end.getTime())) {
+ return `${calendarDateFormat.format(start)} · ${calendarTimeFormat.format(start)}`;
+ }
+ return start.toDateString() === end.toDateString()
+ ? `${calendarDateFormat.format(start)} · ${calendarTimeFormat.format(start)} – ${calendarTimeFormat.format(end)}`
+ : `${calendarDateFormat.format(start)}, ${calendarTimeFormat.format(start)} – ${calendarDateFormat.format(end)}, ${calendarTimeFormat.format(end)}`;
+}
+
+/** Meeting-level rows of the calendar mention hover card. */
+function CalendarEventPreviewDetails(props: {
+ event: PreviewCalendarEventAccess['event'];
+}) {
+ const organizer = () =>
+ props.event.organizerName ?? props.event.organizerEmail;
+ return (
+ <div class="px-2 pb-2 flex flex-col gap-1 text-sm text-ink-muted">
+ <Show when={calendarPreviewSchedule(props.event)}>
+ {(schedule) => (
+ <MetadataInfo icon={ClockIcon}>
+ {schedule()}
+ <Show when={props.event.isRecurring}> · Repeats</Show>
+ </MetadataInfo>
+ )}
+ </Show>
+ <Show when={props.event.location}>
+ {(location) => (
+ <MetadataInfo icon={MapPinIcon}>
+ <span class="truncate">{location()}</span>
+ </MetadataInfo>
+ )}
+ </Show>
+ <Show when={organizer() || props.event.attendeeCount > 0}>
+ <MetadataInfo icon={UsersIcon}>
+ <span class="truncate">
+ <Show when={organizer()}>{(name) => <>{name()}</>}</Show>
+ <Show when={organizer() && props.event.attendeeCount > 0}>
+ {' · '}
+ </Show>
+ <Show when={props.event.attendeeCount > 0}>
+ {props.event.attendeeCount}{' '}
+ {props.event.attendeeCount === 1 ? 'attendee' : 'attendees'}
+ </Show>
+ </span>
+ </MetadataInfo>
+ </Show>
+ </div>
+ );
+}
+
/**
* Props for the reusable document-preview body. These are everything
* {@link PopupPreview} needs EXCEPT the floating-hover-card concerns
@@ -545,7 +628,36 @@ export function DocumentPreviewContent(props: DocumentPreviewContentProps) {
props.collapseInfo?.handleCollapse();
};
+ // The calendar is a singleton block: a mentioned event opens it aimed at
+ // the viewer's own copy of the meeting rather than a per-id split.
+ const calendarOpenTarget = () => {
+ const i = item();
+ if (isCalendarEventPreviewItem(i)) {
+ return {
+ eventId: i.event.viewerEventId,
+ occurrenceKey: i.event.occurrenceKey ?? undefined,
+ time: i.event.time,
+ };
+ }
+ // Preview not (yet) accessible — e.g. the recent-mention fallback for a
+ // just-created event. Still route through the singleton opener with the
+ // mentioned id; a generic `{type:'calendar', id:<event-id>}` split would
+ // be rejected by the calendar block's load.
+ if (targetBlockType() === 'calendar') {
+ return {
+ eventId: props.documentInfo.id,
+ occurrenceKey: props.documentInfo.params?.occurrenceKey,
+ };
+ }
+ return undefined;
+ };
+
const openDocument = createCallback(async () => {
+ const calendarTarget = calendarOpenTarget();
+ if (calendarTarget) {
+ await openCalendarEventSplit(calendarTarget);
+ return;
+ }
const type = targetBlockType();
const splitManager = globalSplitManager();
if (!splitManager) {
@@ -587,6 +699,14 @@ export function DocumentPreviewContent(props: DocumentPreviewContentProps) {
if (hostname === 'localhost') {
hostname = 'dev.macro.com';
}
+
+ const calendarTarget = calendarOpenTarget();
+ if (calendarTarget) {
+ navigator.clipboard.writeText(calendarEventDeepLink(calendarTarget));
+ toast.success('Copied document link to clipboard');
+ return;
+ }
+
let link = `https://${hostname}/app/${targetBlockType()}/${props.documentInfo.id}`;
if (
@@ -612,6 +732,9 @@ export function DocumentPreviewContent(props: DocumentPreviewContentProps) {
const isSplitAlreadyOpen = () => {
const splitManager = globalSplitManager();
if (!splitManager) return false;
+ if (calendarOpenTarget()) {
+ return !!splitManager.getSplitByContent('calendar', CALENDAR_BLOCK_ID);
+ }
return !!splitManager.getSplitByContent(
targetBlockType(),
props.documentInfo.id
@@ -619,6 +742,11 @@ export function DocumentPreviewContent(props: DocumentPreviewContentProps) {
};
const openInNewSplit = createCallback(async () => {
+ const calendarTarget = calendarOpenTarget();
+ if (calendarTarget) {
+ await openCalendarEventSplit({ ...calendarTarget, openInNewSplit: true });
+ return;
+ }
const splitManager = globalSplitManager();
if (!splitManager) return;
@@ -817,6 +945,13 @@ export function DocumentPreviewContent(props: DocumentPreviewContentProps) {
</Suspense>
</Show>
+ {/* Calendar event schedule, location, and people */}
+ <Show when={matches(item(), isCalendarEventPreviewItem)}>
+ {(calendarItem) => (
+ <CalendarEventPreviewDetails event={calendarItem().event} />
+ )}
+ </Show>
+
{/* Visual preview for images */}
<Show when={props.documentInfo.type === 'image'}>
<ImageCoverStrip
diff --git a/apps/web/src/lib/core/component/EntityIcon.tsx b/apps/web/src/lib/core/component/EntityIcon.tsx
index 430122c291..1ad2f49b3d 100644
--- a/apps/web/src/lib/core/component/EntityIcon.tsx
+++ b/apps/web/src/lib/core/component/EntityIcon.tsx
@@ -537,6 +537,7 @@ export function getEntityIconType(entity: EntityIconData): EntityWithValidIcon {
// reminder first, and what it points at is iconed beside its name instead
// — see `reminderReferenceIconType`.
.with({ type: 'reminder' }, () => 'reminder')
+ .with({ type: 'calendar_event' }, () => 'calendar')
.otherwise((e) => e.type);
return validateEntity(typeString);
diff --git a/apps/web/src/lib/core/component/LexicalMarkdown/component/decorator/DocumentMention.tsx b/apps/web/src/lib/core/component/LexicalMarkdown/component/decorator/DocumentMention.tsx
index 1d4c4d549b..5f55c7b758 100644
--- a/apps/web/src/lib/core/component/LexicalMarkdown/component/decorator/DocumentMention.tsx
+++ b/apps/web/src/lib/core/component/LexicalMarkdown/component/decorator/DocumentMention.tsx
@@ -1,3 +1,5 @@
+import { parseLocalDate } from '@app/features/calendar/utils/calendar-date';
+import { openCalendarEventSplit } from '@block-calendar/open-calendar-event';
import { URL_PARAMS as CHANNEL_PARAMS } from '@block-channel/constants';
import {
type BlockAlias,
@@ -39,6 +41,8 @@ import { useEntityProperties } from '@property/hooks';
import {
type ItemEntity,
isAccessiblePreviewItem,
+ isCalendarEventPreviewItem,
+ type PreviewCalendarEventAccess,
type PreviewItemNoAccess,
useItemPreview,
} from '@queries/preview';
@@ -155,6 +159,17 @@ function SkillSlashText(props: {
);
}
+/** Compact start-time label appended to a calendar event mention pill. */
+export function calendarMentionTimeLabel(
+ event: PreviewCalendarEventAccess['event']
+): string | undefined {
+ if (event.time.kind === 'timed') {
+ return formatDate(event.time.startsAt, { showTime: true });
+ }
+ const startDate = parseLocalDate(event.time.startDate);
+ return startDate ? formatDate(startDate) : undefined;
+}
+
function InlineTaskProperties(props: { taskId: string }) {
const { properties, isLoading } = useEntityProperties(
props.taskId,
@@ -361,6 +376,19 @@ function InlinePreview(props: {
);
}}
</Show>
+ <Show when={matches(item(), isCalendarEventPreviewItem)}>
+ {(calendarItem) => (
+ <Show
+ when={calendarMentionTimeLabel(calendarItem().event)}
+ >
+ {(timeLabel) => (
+ <span class="text-current/50 text-[0.8em]">
+ {` ${timeLabel()}`}
+ </span>
+ )}
+ </Show>
+ )}
+ </Show>
<span class="relative text-[0.8em] text-current/50 rounded-xs">
{(() => {
const accessories = mentionsAccessories(
@@ -549,6 +577,27 @@ function DocumentMentionInner(props: DocumentMentionDecoratorProps) {
});
const open = createCallback((e: MouseEvent | KeyboardEvent | null) => {
+ // The calendar is a singleton block: open it aimed at the viewer's own
+ // copy of the meeting, which the preview resolved through the shared
+ // iCalendar UID.
+ if (verifyBlockName(props.blockName) === 'calendar') {
+ const i = item();
+ const event = isCalendarEventPreviewItem(i) ? i.event : undefined;
+ const paramKey = props.blockParams?.occurrenceKey;
+ openCalendarEventSplit({
+ eventId: event?.viewerEventId ?? props.documentId,
+ occurrenceKey: paramKey ?? event?.occurrenceKey ?? undefined,
+ // The preview's time only locates the instance it previewed; a
+ // mention aimed at a different instance derives its range from the
+ // occurrence key instead.
+ time:
+ !paramKey || paramKey === event?.occurrenceKey
+ ? event?.time
+ : undefined,
+ openInNewSplit: openInNewSplitForMention(e?.shiftKey, e != null),
+ });
+ return;
+ }
openDocument(
resolvedBlockName(),
props.documentId,
diff --git a/apps/web/src/lib/core/component/LexicalMarkdown/plugins/mentions/mentionsPlugin.ts b/apps/web/src/lib/core/component/LexicalMarkdown/plugins/mentions/mentionsPlugin.ts
index 52e59e2091..4b5cec3e08 100644
--- a/apps/web/src/lib/core/component/LexicalMarkdown/plugins/mentions/mentionsPlugin.ts
+++ b/apps/web/src/lib/core/component/LexicalMarkdown/plugins/mentions/mentionsPlugin.ts
@@ -137,6 +137,7 @@ export type ItemMention = {
| 'unknown'
| 'color'
| 'call'
+ | 'calendar_event'
| 'foreign'
| 'group'
| 'automation'
@@ -210,6 +211,9 @@ function $mentionItemFromNode(node: MentionNode): ItemMention {
} else if (blockName === 'call') {
fileType = 'call';
itemType = 'call';
+ } else if (blockName === 'calendar') {
+ fileType = 'calendar_event';
+ itemType = 'calendar_event';
} else if (blockName === 'company') {
fileType = 'company';
itemType = 'crm_company';
@@ -301,9 +305,7 @@ const getDocumentMentionItemType = (
.with('channel_thread', () => 'channel')
.with('automation', () => 'automation')
.with('call', () => 'call')
- .with('calendar_event', () => {
- throw new Error('calendar blocks cannot be document mentions');
- })
+ .with('calendar_event', () => 'calendar_event')
.with('foreign', () => {
throw new Error('foreign entities cannot be document mentions');
})
diff --git a/apps/web/src/lib/queries/calendar/keys.ts b/apps/web/src/lib/queries/calendar/keys.ts
index 4862abd3ad..9cc56e7abc 100644
--- a/apps/web/src/lib/queries/calendar/keys.ts
+++ b/apps/web/src/lib/queries/calendar/keys.ts
@@ -15,4 +15,7 @@ export const calendarKeys = createQueryKeys('calendar', {
) => ({
queryKey: [userId, range],
}),
+ mentionPreview: (eventId: string, occurrenceKey: string | undefined) => ({
+ queryKey: [eventId, occurrenceKey],
+ }),
});
diff --git a/apps/web/src/lib/queries/calendar/mention-preview.ts b/apps/web/src/lib/queries/calendar/mention-preview.ts
new file mode 100644
index 0000000000..61072b9035
--- /dev/null
+++ b/apps/web/src/lib/queries/calendar/mention-preview.ts
@@ -0,0 +1,31 @@
+import { queryClient } from '@queries/client';
+import { storageServiceClient } from '@service-storage/client';
+import type { CalendarMentionEvent } from '@service-storage/generated/schemas/calendarMentionEvent';
+import { calendarKeys } from './keys';
+
+const MENTION_PREVIEW_STALE_TIME = 60_000;
+
+/**
+ * Resolve one mentioned event to the viewer's own copy of the meeting,
+ * occurrence-scoped when a key is given. Returns `null` when the viewer has
+ * no access or the event no longer exists.
+ */
+export async function fetchCalendarMentionPreview(
+ eventId: string,
+ occurrenceKey?: string
+): Promise<CalendarMentionEvent | null> {
+ return queryClient.fetchQuery({
+ queryKey: calendarKeys.mentionPreview(eventId, occurrenceKey).queryKey,
+ queryFn: async () => {
+ const result = await storageServiceClient.getBatchCalendarEventPreviews({
+ items: [{ eventId, occurrenceKey }],
+ });
+ if (result.isErr()) {
+ throw new Error('Failed to fetch calendar mention preview');
+ }
+ const item = result.value.items[0];
+ return item?.type === 'access' && item.event ? item.event : null;
+ },
+ staleTime: MENTION_PREVIEW_STALE_TIME,
+ });
+}
diff --git a/apps/web/src/lib/queries/preview/fetchers.ts b/apps/web/src/lib/queries/preview/fetchers.ts
index 874359add8..e6c95ef86b 100644
--- a/apps/web/src/lib/queries/preview/fetchers.ts
+++ b/apps/web/src/lib/queries/preview/fetchers.ts
@@ -357,6 +357,53 @@ async function fetchEmailPreviews(threadIds: string[]): Promise<PreviewItem[]> {
return results;
}
+/**
+ * Calendar mention previews resolve through the requester's own copy of the
+ * meeting: the API answers with the viewer-relative event (or no_access /
+ * does_not_exist), never another user's row. The batch is occurrence-agnostic
+ * — previews cache per event id, and the server picks the instance nearest to
+ * now.
+ */
+async function fetchCalendarEventPreviews(
+ eventIds: string[]
+): Promise<PreviewItem[]> {
+ const result = await storageServiceClient.getBatchCalendarEventPreviews({
+ items: eventIds.map((eventId) => ({ eventId })),
+ });
+
+ if (result.isErr()) {
+ console.error('Failed to fetch calendar event previews');
+ return [];
+ }
+
+ return result.value.items.map((item) => {
+ const base = {
+ id: item.eventId,
+ type: 'calendar_event',
+ } as const;
+
+ if (item.type === 'access' && item.event) {
+ return {
+ ...base,
+ access: 'access' as const,
+ loading: false as const,
+ rawName: item.event.title,
+ name: item.event.title,
+ updatedAt: item.event.updatedAt,
+ event: item.event,
+ };
+ }
+ return {
+ ...base,
+ access:
+ item.type === 'does_not_exist'
+ ? ('does_not_exist' as const)
+ : ('no_access' as const),
+ loading: false as const,
+ };
+ });
+}
+
function filterMapToId(items: Array<ItemEntity>, type: ItemEntity['type']) {
return items.filter((i) => i.type === type).map(({ id }) => id);
}
@@ -380,6 +427,7 @@ export async function fetchPreviewBatch(
doFetch(fetchProjectPreviews, filterMapToId(items, 'project')),
doFetch(fetchEmailPreviews, filterMapToId(items, 'email')),
doFetch(fetchCrmCompanyPreviews, filterMapToId(items, 'crm_company')),
+ doFetch(fetchCalendarEventPreviews, filterMapToId(items, 'calendar_event')),
]);
const resultMap = new Map<string, PreviewItem>();
results.flat().forEach((result) => {
diff --git a/apps/web/src/lib/queries/preview/index.ts b/apps/web/src/lib/queries/preview/index.ts
index 83d55fcbb1..89391e1786 100644
--- a/apps/web/src/lib/queries/preview/index.ts
+++ b/apps/web/src/lib/queries/preview/index.ts
@@ -11,11 +11,13 @@ export {
export type {
AccessiblePreviewItem,
ItemEntity,
+ PreviewCalendarEventAccess,
PreviewItem,
PreviewItemNoAccess,
} from './types';
export {
isAccessiblePreviewItem,
+ isCalendarEventPreviewItem,
isChannelPreviewItem,
isPreviewItemNoAccess,
} from './types';
diff --git a/apps/web/src/lib/queries/preview/preview.ts b/apps/web/src/lib/queries/preview/preview.ts
index fade33cf14..bfeb5240da 100644
--- a/apps/web/src/lib/queries/preview/preview.ts
+++ b/apps/web/src/lib/queries/preview/preview.ts
@@ -172,7 +172,9 @@ export function setPreviewName({
}: {
itemId: string;
name: string;
- itemType?: ItemType;
+ // Calendar event previews carry required API-served event data, so the
+ // optimistic default constructor cannot fabricate one.
+ itemType?: Exclude<ItemType, 'calendar_event'>;
}) {
const prev = getPreviewData(itemId);
// only merge into accessible entries: a cached no_access/does_not_exist
@@ -195,7 +197,10 @@ export function setPreviewName({
name,
loading: false,
access: 'access',
- type: itemType ?? prev?.type ?? DEFAULT_ITEM_TYPE,
+ type: (itemType ?? prev?.type ?? DEFAULT_ITEM_TYPE) as Exclude<
+ ItemType,
+ 'calendar_event'
+ >,
};
// if the item isn't in the cache, we can optimistically create a new item
@@ -260,7 +265,7 @@ export function setPreviewOnCreate({
subType,
}: {
itemId: string;
- itemType: ItemType;
+ itemType: Exclude<ItemType, 'calendar_event'>;
name?: string;
fileType?: string;
subType?: { type: 'task' | 'snippet' | 'skill'; is_completed?: boolean };
diff --git a/apps/web/src/lib/queries/preview/types.ts b/apps/web/src/lib/queries/preview/types.ts
index 4b28dc09b2..1251899c42 100644
--- a/apps/web/src/lib/queries/preview/types.ts
+++ b/apps/web/src/lib/queries/preview/types.ts
@@ -5,6 +5,7 @@ import type {
ApiChannelContextMessage,
ItemType,
} from '@service-storage/client';
+import type { CalendarMentionEvent } from '@service-storage/generated/schemas/calendarMentionEvent';
import type { FileType } from '@service-storage/generated/schemas/fileType';
type AccessType = 'access' | 'no_access' | 'does_not_exist';
@@ -32,7 +33,9 @@ type PreviewItemAccess = {
fileType?: FileType;
subType?: SubType;
channelType?: never;
-} & BasePreviewItem<Exclude<ItemType, 'project' | 'document' | 'channel'>>;
+} & BasePreviewItem<
+ Exclude<ItemType, 'project' | 'document' | 'channel' | 'calendar_event'>
+>;
type PreviewProjectAccess = {
access: Extract<AccessType, 'access'>;
@@ -67,11 +70,24 @@ export type PreviewChannelAccess = {
messageContext?: MessageContext | undefined;
} & BasePreviewItem<'channel'>;
+export type PreviewCalendarEventAccess = {
+ access: Extract<AccessType, 'access'>;
+ loading: false;
+ rawName: string;
+ name: string;
+ fileType?: never;
+ subType?: never;
+ channelType?: never;
+ /** The requester-relative meeting preview served by the calendar API. */
+ event: CalendarMentionEvent;
+} & BasePreviewItem<'calendar_event'>;
+
export type AccessiblePreviewItem =
| PreviewItemAccess
| PreviewProjectAccess
| PreviewDocumentAccess
- | PreviewChannelAccess;
+ | PreviewChannelAccess
+ | PreviewCalendarEventAccess;
export type PreviewItem =
| PreviewItemLoading
@@ -111,3 +127,9 @@ export const isChannelPreviewItem = (
): item is PreviewChannelAccess => {
return isAccessiblePreviewItem(item) && item.type === 'channel';
};
+
+export const isCalendarEventPreviewItem = (
+ item: PreviewItem
+): item is PreviewCalendarEventAccess => {
+ return isAccessiblePreviewItem(item) && item.type === 'calendar_event';
+};
diff --git a/apps/web/src/lib/service-clients/service-storage/client.ts b/apps/web/src/lib/service-clients/service-storage/client.ts
index 386f683f1c..bb7fce682c 100644
--- a/apps/web/src/lib/service-clients/service-storage/client.ts
+++ b/apps/web/src/lib/service-clients/service-storage/client.ts
@@ -43,6 +43,8 @@ import type { ApiThreadReply } from './generated/schemas/apiThreadReply';
import type { Bot } from './generated/schemas/bot';
import type { BotChannel } from './generated/schemas/botChannel';
import type { BotToken } from './generated/schemas/botToken';
+import type { CalendarMentionPreviewRequest } from './generated/schemas/calendarMentionPreviewRequest';
+import type { CalendarMentionPreviewResponse } from './generated/schemas/calendarMentionPreviewResponse';
import type { CalendarOccurrenceResponse } from './generated/schemas/calendarOccurrenceResponse';
import type { CallRecordPreview } from './generated/schemas/callRecordPreview';
import type { ChannelJoinCodeResponse } from './generated/schemas/channelJoinCodeResponse';
@@ -447,6 +449,18 @@ export const storageServiceClient = {
).map((result) => result);
},
+ async getBatchCalendarEventPreviews(args: CalendarMentionPreviewRequest) {
+ return (
+ await dssFetch<CalendarMentionPreviewResponse>(
+ `/calendar-events/preview`,
+ {
+ method: 'POST',
+ body: JSON.stringify(args),
+ }
+ )
+ ).map((result) => result);
+ },
+
async getSoupItems(args: {
params: { cursor?: string | null };
body: PostSoupRequest;
diff --git a/apps/web/src/lib/service-clients/service-storage/generated/schemas/calendarMentionEvent.ts b/apps/web/src/lib/service-clients/service-storage/generated/schemas/calendarMentionEvent.ts
new file mode 100644
index 0000000000..1aa1283149
--- /dev/null
+++ b/apps/web/src/lib/service-clients/service-storage/generated/schemas/calendarMentionEvent.ts
@@ -0,0 +1,45 @@
+/**
+ * Generated by orval v7.21.0 🍺
+ * Do not edit manually.
+ * document_storage_service
+ * OpenAPI spec version: 0.1.0
+ */
+import type { CalendarMentionEventLocation } from './calendarMentionEventLocation';
+import type { CalendarMentionEventOccurrenceKey } from './calendarMentionEventOccurrenceKey';
+import type { CalendarMentionEventOrganizerEmail } from './calendarMentionEventOrganizerEmail';
+import type { CalendarMentionEventOrganizerName } from './calendarMentionEventOrganizerName';
+import type { EventTime } from './eventTime';
+
+/**
+ * Meeting-level fields shown in a calendar event mention preview, taken from
+the requester's own projection of the meeting.
+ */
+export interface CalendarMentionEvent {
+ /**
+ * Number of attendees on the requester's copy.
+ * @minimum 0
+ */
+ attendeeCount: number;
+ /** Whether the event repeats. */
+ isRecurring: boolean;
+ /** Location label, when set. */
+ location?: CalendarMentionEventLocation;
+ /** Key of the previewed instance, absent when no occurrence is
+materialized. */
+ occurrenceKey?: CalendarMentionEventOccurrenceKey;
+ /** Organizer email. */
+ organizerEmail?: CalendarMentionEventOrganizerEmail;
+ /** Organizer display name. */
+ organizerName?: CalendarMentionEventOrganizerName;
+ /** Time of the previewed instance: the requested occurrence when it
+exists, else the next upcoming one, else the latest past one, else the
+series start. */
+ time: EventTime;
+ /** Display title. */
+ title: string;
+ /** Entity update time of the requester's copy. */
+ updatedAt: string;
+ /** The requester's own event entity for the mentioned meeting. Differs
+from the mentioned id when the mention came from another attendee. */
+ viewerEventId: string;
+}
diff --git a/apps/web/src/lib/service-clients/service-storage/generated/schemas/calendarMentionEventLocation.ts b/apps/web/src/lib/service-clients/service-storage/generated/schemas/calendarMentionEventLocation.ts
new file mode 100644
index 0000000000..5701248e41
--- /dev/null
+++ b/apps/web/src/lib/service-clients/service-storage/generated/schemas/calendarMentionEventLocation.ts
@@ -0,0 +1,11 @@
+/**
+ * Generated by orval v7.21.0 🍺
+ * Do not edit manually.
+ * document_storage_service
+ * OpenAPI spec version: 0.1.0
+ */
+
+/**
+ * Location label, when set.
+ */
+export type CalendarMentionEventLocation = string | null;
diff --git a/apps/web/src/lib/service-clients/service-storage/generated/schemas/calendarMentionEventOccurrenceKey.ts b/apps/web/src/lib/service-clients/service-storage/generated/schemas/calendarMentionEventOccurrenceKey.ts
new file mode 100644
index 0000000000..87f521de56
--- /dev/null
+++ b/apps/web/src/lib/service-clients/service-storage/generated/schemas/calendarMentionEventOccurrenceKey.ts
@@ -0,0 +1,12 @@
+/**
+ * Generated by orval v7.21.0 🍺
+ * Do not edit manually.
+ * document_storage_service
+ * OpenAPI spec version: 0.1.0
+ */
+
+/**
+ * Key of the previewed instance, absent when no occurrence is
+materialized.
+ */
+export type CalendarMentionEventOccurrenceKey = string | null;
diff --git a/apps/web/src/lib/service-clients/service-storage/generated/schemas/calendarMentionEventOrganizerEmail.ts b/apps/web/src/lib/service-clients/service-storage/generated/schemas/calendarMentionEventOrganizerEmail.ts
new file mode 100644
index 0000000000..8ddf83ebac
--- /dev/null
+++ b/apps/web/src/lib/service-clients/service-storage/generated/schemas/calendarMentionEventOrganizerEmail.ts
@@ -0,0 +1,11 @@
+/**
+ * Generated by orval v7.21.0 🍺
+ * Do not edit manually.
+ * document_storage_service
+ * OpenAPI spec version: 0.1.0
+ */
+
+/**
+ * Organizer email.
+ */
+export type CalendarMentionEventOrganizerEmail = string | null;
diff --git a/apps/web/src/lib/service-clients/service-storage/generated/schemas/calendarMentionEventOrganizerName.ts b/apps/web/src/lib/service-clients/service-storage/generated/schemas/calendarMentionEventOrganizerName.ts
new file mode 100644
index 0000000000..651523d52e
--- /dev/null
+++ b/apps/web/src/lib/service-clients/service-storage/generated/schemas/calendarMentionEventOrganizerName.ts
@@ -0,0 +1,11 @@
+/**
+ * Generated by orval v7.21.0 🍺
+ * Do not edit manually.
+ * document_storage_service
+ * OpenAPI spec version: 0.1.0
+ */
+
+/**
+ * Organizer display name.
+ */
+export type CalendarMentionEventOrganizerName = string | null;
diff --git a/apps/web/src/lib/service-clients/service-storage/generated/schemas/calendarMentionPreviewItem.ts b/apps/web/src/lib/service-clients/service-storage/generated/schemas/calendarMentionPreviewItem.ts
new file mode 100644
index 0000000000..db09f91f98
--- /dev/null
+++ b/apps/web/src/lib/service-clients/service-storage/generated/schemas/calendarMentionPreviewItem.ts
@@ -0,0 +1,19 @@
+/**
+ * Generated by orval v7.21.0 🍺
+ * Do not edit manually.
+ * document_storage_service
+ * OpenAPI spec version: 0.1.0
+ */
+import type { CalendarMentionPreviewItemEvent } from './calendarMentionPreviewItemEvent';
+import type { CalendarMentionPreviewKind } from './calendarMentionPreviewKind';
+
+/**
+ * Resolution of one mentioned event, in request order.
+ */
+export interface CalendarMentionPreviewItem {
+ event?: CalendarMentionPreviewItemEvent;
+ /** The mentioned event id, echoed from the request. */
+ eventId: string;
+ /** Visibility of the mentioned event to the requester. */
+ type: CalendarMentionPreviewKind;
+}
diff --git a/apps/web/src/lib/service-clients/service-storage/generated/schemas/calendarMentionPreviewItemEvent.ts b/apps/web/src/lib/service-clients/service-storage/generated/schemas/calendarMentionPreviewItemEvent.ts
new file mode 100644
index 0000000000..27fab1059b
--- /dev/null
+++ b/apps/web/src/lib/service-clients/service-storage/generated/schemas/calendarMentionPreviewItemEvent.ts
@@ -0,0 +1,9 @@
+/**
+ * Generated by orval v7.21.0 🍺
+ * Do not edit manually.
+ * document_storage_service
+ * OpenAPI spec version: 0.1.0
+ */
+import type { CalendarMentionEvent } from './calendarMentionEvent';
+
+export type CalendarMentionPreviewItemEvent = null | CalendarMentionEvent;
diff --git a/apps/web/src/lib/service-clients/service-storage/generated/schemas/calendarMentionPreviewKind.ts b/apps/web/src/lib/service-clients/service-storage/generated/schemas/calendarMentionPreviewKind.ts
new file mode 100644
index 0000000000..b63a22f245
--- /dev/null
+++ b/apps/web/src/lib/service-clients/service-storage/generated/schemas/calendarMentionPreviewKind.ts
@@ -0,0 +1,19 @@
+/**
+ * Generated by orval v7.21.0 🍺
+ * Do not edit manually.
+ * document_storage_service
+ * OpenAPI spec version: 0.1.0
+ */
+
+/**
+ * Requester-relative visibility of one mentioned event.
+ */
+export type CalendarMentionPreviewKind =
+ (typeof CalendarMentionPreviewKind)[keyof typeof CalendarMentionPreviewKind];
+
+// eslint-disable-next-line @typescript-eslint/no-redeclare
+export const CalendarMentionPreviewKind = {
+ access: 'access',
+ no_access: 'no_access',
+ does_not_exist: 'does_not_exist',
+} as const;
diff --git a/apps/web/src/lib/service-clients/service-storage/generated/schemas/calendarMentionPreviewRequest.ts b/apps/web/src/lib/service-clients/service-storage/generated/schemas/calendarMentionPreviewRequest.ts
new file mode 100644
index 0000000000..7ba26b21c5
--- /dev/null
+++ b/apps/web/src/lib/service-clients/service-storage/generated/schemas/calendarMentionPreviewRequest.ts
@@ -0,0 +1,15 @@
+/**
+ * Generated by orval v7.21.0 🍺
+ * Do not edit manually.
+ * document_storage_service
+ * OpenAPI spec version: 0.1.0
+ */
+import type { CalendarMentionPreviewRequestItem } from './calendarMentionPreviewRequestItem';
+
+/**
+ * Batch calendar mention preview request.
+ */
+export interface CalendarMentionPreviewRequest {
+ /** Mentioned events to resolve, at most 100. */
+ items: CalendarMentionPreviewRequestItem[];
+}
diff --git a/apps/web/src/lib/service-clients/service-storage/generated/schemas/calendarMentionPreviewRequestItem.ts b/apps/web/src/lib/service-clients/service-storage/generated/schemas/calendarMentionPreviewRequestItem.ts
new file mode 100644
index 0000000000..b9cdd0dcf5
--- /dev/null
+++ b/apps/web/src/lib/service-clients/service-storage/generated/schemas/calendarMentionPreviewRequestItem.ts
@@ -0,0 +1,17 @@
+/**
+ * Generated by orval v7.21.0 🍺
+ * Do not edit manually.
+ * document_storage_service
+ * OpenAPI spec version: 0.1.0
+ */
+import type { CalendarMentionPreviewRequestItemOccurrenceKey } from './calendarMentionPreviewRequestItemOccurrenceKey';
+
+/**
+ * One mentioned event to resolve for the requester.
+ */
+export interface CalendarMentionPreviewRequestItem {
+ /** Mentioned calendar event id. */
+ eventId: string;
+ /** Occurrence the mention points at, when it targets one instance. */
+ occurrenceKey?: CalendarMentionPreviewRequestItemOccurrenceKey;
+}
diff --git a/apps/web/src/lib/service-clients/service-storage/generated/schemas/calendarMentionPreviewRequestItemOccurrenceKey.ts b/apps/web/src/lib/service-clients/service-storage/generated/schemas/calendarMentionPreviewRequestItemOccurrenceKey.ts
new file mode 100644
index 0000000000..5254e8a04b
--- /dev/null
+++ b/apps/web/src/lib/service-clients/service-storage/generated/schemas/calendarMentionPreviewRequestItemOccurrenceKey.ts
@@ -0,0 +1,11 @@
+/**
+ * Generated by orval v7.21.0 🍺
+ * Do not edit manually.
+ * document_storage_service
+ * OpenAPI spec version: 0.1.0
+ */
+
+/**
+ * Occurrence the mention points at, when it targets one instance.
+ */
+export type CalendarMentionPreviewRequestItemOccurrenceKey = string | null;
diff --git a/apps/web/src/lib/service-clients/service-storage/generated/schemas/calendarMentionPreviewResponse.ts b/apps/web/src/lib/service-clients/service-storage/generated/schemas/calendarMentionPreviewResponse.ts
new file mode 100644
index 0000000000..767520f6a7
--- /dev/null
+++ b/apps/web/src/lib/service-clients/service-storage/generated/schemas/calendarMentionPreviewResponse.ts
@@ -0,0 +1,14 @@
+/**
+ * Generated by orval v7.21.0 🍺
+ * Do not edit manually.
+ * document_storage_service
+ * OpenAPI spec version: 0.1.0
+ */
+import type { CalendarMentionPreviewItem } from './calendarMentionPreviewItem';
+
+/**
+ * Batch calendar mention preview response.
+ */
+export interface CalendarMentionPreviewResponse {
+ items: CalendarMentionPreviewItem[];
+}
diff --git a/apps/web/src/lib/service-clients/service-storage/generated/schemas/index.ts b/apps/web/src/lib/service-clients/service-storage/generated/schemas/index.ts
index 4943e2b534..36a4d06b4f 100644
--- a/apps/web/src/lib/service-clients/service-storage/generated/schemas/index.ts
+++ b/apps/web/src/lib/service-clients/service-storage/generated/schemas/index.ts
@@ -175,6 +175,18 @@ export * from './calendarEventFiltersStartsBefore';
export * from './calendarEventLocation';
export * from './calendarEventOrganizerEmail';
export * from './calendarEventOrganizerName';
+export * from './calendarMentionEvent';
+export * from './calendarMentionEventLocation';
+export * from './calendarMentionEventOccurrenceKey';
+export * from './calendarMentionEventOrganizerEmail';
+export * from './calendarMentionEventOrganizerName';
+export * from './calendarMentionPreviewItem';
+export * from './calendarMentionPreviewItemEvent';
+export * from './calendarMentionPreviewKind';
+export * from './calendarMentionPreviewRequest';
+export * from './calendarMentionPreviewRequestItem';
+export * from './calendarMentionPreviewRequestItemOccurrenceKey';
+export * from './calendarMentionPreviewResponse';
export * from './calendarOccurrence';
export * from './calendarOccurrenceItem';
export * from './calendarOccurrenceRecurrenceId';
diff --git a/apps/web/src/lib/service-clients/service-storage/generated/zod.ts b/apps/web/src/lib/service-clients/service-storage/generated/zod.ts
index 9d4b9106fc..de93ffb747 100644
--- a/apps/web/src/lib/service-clients/service-storage/generated/zod.ts
+++ b/apps/web/src/lib/service-clients/service-storage/generated/zod.ts
@@ -1027,6 +1027,129 @@ export const listOccurrencesResponse = zod
})
.describe('Paginated calendar occurrence viewport response.');
+/**
+ * @summary Resolve mentioned calendar events to the requester's own projections.
+ */
+export const mentionPreviewsBody = zod
+ .object({
+ items: zod
+ .array(
+ zod
+ .object({
+ eventId: zod.uuid().describe('Mentioned calendar event id.'),
+ occurrenceKey: zod
+ .string()
+ .nullish()
+ .describe(
+ 'Occurrence the mention points at, when it targets one instance.'
+ ),
+ })
+ .describe('One mentioned event to resolve for the requester.')
+ )
+ .describe('Mentioned events to resolve, at most 100.'),
+ })
+ .describe('Batch calendar mention preview request.');
+
+export const mentionPreviewsResponseItemsItemEventAttendeeCountMin = 0;
+
+export const mentionPreviewsResponse = zod
+ .object({
+ items: zod.array(
+ zod
+ .object({
+ event: zod
+ .union([
+ zod.null(),
+ zod
+ .object({
+ attendeeCount: zod
+ .number()
+ .min(mentionPreviewsResponseItemsItemEventAttendeeCountMin)
+ .describe("Number of attendees on the requester's copy."),
+ isRecurring: zod
+ .boolean()
+ .describe('Whether the event repeats.'),
+ location: zod
+ .string()
+ .nullish()
+ .describe('Location label, when set.'),
+ occurrenceKey: zod
+ .string()
+ .nullish()
+ .describe(
+ 'Key of the previewed instance, absent when no occurrence is\nmaterialized.'
+ ),
+ organizerEmail: zod
+ .string()
+ .nullish()
+ .describe('Organizer email.'),
+ organizerName: zod
+ .string()
+ .nullish()
+ .describe('Organizer display name.'),
+ time: zod
+ .union([
+ zod
+ .object({
+ endsAt: zod.iso
+ .datetime({})
+ .describe('Exclusive end instant.'),
+ kind: zod.enum(['timed']),
+ startsAt: zod.iso
+ .datetime({})
+ .describe('Inclusive start instant.'),
+ timeZone: zod
+ .string()
+ .nullish()
+ .describe(
+ 'Original IANA time-zone identifier, when supplied.'
+ ),
+ })
+ .describe('An event with absolute instants.'),
+ zod
+ .object({
+ endDate: zod.iso
+ .date()
+ .describe('Exclusive local end date.'),
+ kind: zod.enum(['allDay']),
+ startDate: zod.iso
+ .date()
+ .describe('Inclusive local start date.'),
+ })
+ .describe(
+ "An all-day event using RFC 5545's exclusive end date."
+ ),
+ ])
+ .describe(
+ 'The mutually exclusive time shape of a calendar event.\n\nFields are renamed per variant rather than with `rename_all_fields`\nbecause utoipa only honors variant-level serde renames when it\nderives the OpenAPI schema.'
+ ),
+ title: zod.string().describe('Display title.'),
+ updatedAt: zod.iso
+ .datetime({})
+ .describe("Entity update time of the requester's copy."),
+ viewerEventId: zod
+ .uuid()
+ .describe(
+ "The requester's own event entity for the mentioned meeting. Differs\nfrom the mentioned id when the mention came from another attendee."
+ ),
+ })
+ .describe(
+ "Meeting-level fields shown in a calendar event mention preview, taken from\nthe requester's own projection of the meeting."
+ ),
+ ])
+ .optional(),
+ eventId: zod
+ .uuid()
+ .describe('The mentioned event id, echoed from the request.'),
+ type: zod
+ .enum(['access', 'no_access', 'does_not_exist'])
+ .describe('Requester-relative visibility of one mentioned event.'),
+ })
+ .describe('Resolution of one mentioned event, in request order.')
+ ),
+ })
+ .describe('Batch calendar mention preview response.');
+
/**
* Batch-fetches lightweight previews for a list of call ids. Mirrors the
`POST /documents/preview` endpoint: no per-id access checks, duplicate
diff --git a/apps/web/src/lib/service-clients/service-storage/openapi.json b/apps/web/src/lib/service-clients/service-storage/openapi.json
index 5739185e6e..7569f3c864 100644
--- a/apps/web/src/lib/service-clients/service-storage/openapi.json
+++ b/apps/web/src/lib/service-clients/service-storage/openapi.json
@@ -798,6 +798,44 @@
}
}
},
+ "/calendar-events/preview": {
+ "post": {
+ "tags": ["calendar_events"],
+ "summary": "Resolve mentioned calendar events to the requester's own projections.",
+ "operationId": "mention_previews",
+ "requestBody": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/CalendarMentionPreviewRequest"
+ }
+ }
+ },
+ "required": true
+ },
+ "responses": {
+ "200": {
+ "description": "Requester-relative previews for the mentioned events",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/CalendarMentionPreviewResponse"
+ }
+ }
+ }
+ },
+ "400": {
+ "description": "Too many events in one request"
+ },
+ "401": {
+ "description": "Authentication required"
+ },
+ "500": {
+ "description": "Calendar query failed"
+ }
+ }
+ }
+ },
"/call/record/preview": {
"post": {
"tags": ["call::inbound::axum_router"],
@@ -12948,6 +12986,138 @@
}
}
},
+ "CalendarMentionEvent": {
+ "type": "object",
+ "description": "Meeting-level fields shown in a calendar event mention preview, taken from\nthe requester's own projection of the meeting.",
+ "required": [
+ "viewerEventId",
+ "title",
+ "time",
+ "isRecurring",
+ "attendeeCount",
+ "updatedAt"
+ ],
+ "properties": {
+ "attendeeCount": {
+ "type": "integer",
+ "description": "Number of attendees on the requester's copy.",
+ "minimum": 0
+ },
+ "isRecurring": {
+ "type": "boolean",
+ "description": "Whether the event repeats."
+ },
+ "location": {
+ "type": ["string", "null"],
+ "description": "Location label, when set."
+ },
+ "occurrenceKey": {
+ "type": ["string", "null"],
+ "description": "Key of the previewed instance, absent when no occurrence is\nmaterialized."
+ },
+ "organizerEmail": {
+ "type": ["string", "null"],
+ "description": "Organizer email."
+ },
+ "organizerName": {
+ "type": ["string", "null"],
+ "description": "Organizer display name."
+ },
+ "time": {
+ "$ref": "#/components/schemas/EventTime",
+ "description": "Time of the previewed instance: the requested occurrence when it\nexists, else the next upcoming one, else the latest past one, else the\nseries start."
+ },
+ "title": {
+ "type": "string",
+ "description": "Display title."
+ },
+ "updatedAt": {
+ "type": "string",
+ "format": "date-time",
+ "description": "Entity update time of the requester's copy."
+ },
+ "viewerEventId": {
+ "type": "string",
+ "format": "uuid",
+ "description": "The requester's own event entity for the mentioned meeting. Differs\nfrom the mentioned id when the mention came from another attendee."
+ }
+ }
+ },
+ "CalendarMentionPreviewItem": {
+ "type": "object",
+ "description": "Resolution of one mentioned event, in request order.",
+ "required": ["eventId", "type"],
+ "properties": {
+ "event": {
+ "oneOf": [
+ {
+ "type": "null"
+ },
+ {
+ "$ref": "#/components/schemas/CalendarMentionEvent",
+ "description": "Preview of the requester's own copy, present only with access."
+ }
+ ]
+ },
+ "eventId": {
+ "type": "string",
+ "format": "uuid",
+ "description": "The mentioned event id, echoed from the request."
+ },
+ "type": {
+ "$ref": "#/components/schemas/CalendarMentionPreviewKind",
+ "description": "Visibility of the mentioned event to the requester."
+ }
+ }
+ },
+ "CalendarMentionPreviewKind": {
+ "type": "string",
+ "description": "Requester-relative visibility of one mentioned event.",
+ "enum": ["access", "no_access", "does_not_exist"]
+ },
+ "CalendarMentionPreviewRequest": {
+ "type": "object",
+ "description": "Batch calendar mention preview request.",
+ "required": ["items"],
+ "properties": {
+ "items": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/CalendarMentionPreviewRequestItem"
+ },
+ "description": "Mentioned events to resolve, at most 100."
+ }
+ }
+ },
+ "CalendarMentionPreviewRequestItem": {
+ "type": "object",
+ "description": "One mentioned event to resolve for the requester.",
+ "required": ["eventId"],
+ "properties": {
+ "eventId": {
+ "type": "string",
+ "format": "uuid",
+ "description": "Mentioned calendar event id."
+ },
+ "occurrenceKey": {
+ "type": ["string", "null"],
+ "description": "Occurrence the mention points at, when it targets one instance."
+ }
+ }
+ },
+ "CalendarMentionPreviewResponse": {
+ "type": "object",
+ "description": "Batch calendar mention preview response.",
+ "required": ["items"],
+ "properties": {
+ "items": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/CalendarMentionPreviewItem"
+ }
+ }
+ }
+ },
"CalendarOccurrence": {
"type": "object",
"description": "A materialized recurrence instance optimized for range queries.",
diff --git a/crates/calendar_events/src/domain/models.rs b/crates/calendar_events/src/domain/models.rs
index 434387125c..da5861f7da 100644
--- a/crates/calendar_events/src/domain/models.rs
+++ b/crates/calendar_events/src/domain/models.rs
@@ -581,6 +581,62 @@ impl CalendarOccurrenceCursor {
}
}
+/// One mentioned event to resolve for a requester's mention preview.
+#[derive(Clone, Debug, PartialEq, Eq)]
+pub struct CalendarMentionRequestItem {
+ /// Mentioned calendar event entity id, possibly another user's projection.
+ pub event_id: Uuid,
+ /// Occurrence the mention points at, when it targets one instance.
+ pub occurrence_key: Option<String>,
+}
+
+/// Resolution of one mentioned calendar event for a requester.
+///
+/// Event entities are per-owner projections of a meeting, so a mention from
+/// another attendee resolves through the shared iCalendar UID to the
+/// requester's own copy — the preview never exposes another user's row.
+#[derive(Clone, Debug, PartialEq, Eq)]
+pub enum CalendarMentionPreview {
+ /// The requester holds a live copy of the meeting on a visible calendar.
+ Accessible(Box<CalendarMentionEvent>),
+ /// The event exists but is on no calendar the requester can see.
+ NoAccess,
+ /// No live event has this id.
+ DoesNotExist,
+}
+
+/// Meeting-level fields shown in a calendar event mention preview, taken from
+/// the requester's own projection of the meeting.
+#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
+#[cfg_attr(feature = "schema", derive(utoipa::ToSchema))]
+#[serde(rename_all = "camelCase")]
+pub struct CalendarMentionEvent {
+ /// The requester's own event entity for the mentioned meeting. Differs
+ /// from the mentioned id when the mention came from another attendee.
+ pub viewer_event_id: Uuid,
+ /// Display title.
+ pub title: String,
+ /// Time of the previewed instance: the requested occurrence when it
+ /// exists, else the next upcoming one, else the latest past one, else the
+ /// series start.
+ pub time: EventTime,
+ /// Key of the previewed instance, absent when no occurrence is
+ /// materialized.
+ pub occurrence_key: Option<String>,
+ /// Whether the event repeats.
+ pub is_recurring: bool,
+ /// Location label, when set.
+ pub location: Option<String>,
+ /// Organizer email.
+ pub organizer_email: Option<String>,
+ /// Organizer display name.
+ pub organizer_name: Option<String>,
+ /// Number of attendees on the requester's copy.
+ pub attendee_count: usize,
+ /// Entity update time of the requester's copy.
+ pub updated_at: DateTime<Utc>,
+}
+
/// Inclusive/exclusive viewport range for occurrence queries.
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
diff --git a/crates/calendar_events/src/domain/mutations/test.rs b/crates/calendar_events/src/domain/mutations/test.rs
index 756665f1fb..7db95b84ed 100644
--- a/crates/calendar_events/src/domain/mutations/test.rs
+++ b/crates/calendar_events/src/domain/mutations/test.rs
@@ -171,6 +171,15 @@ impl CalendarRepository for FakeRepo {
unreachable!()
}
+ async fn mention_previews(
+ &self,
+ _requester_id: &str,
+ _items: Vec<crate::domain::models::CalendarMentionRequestItem>,
+ _now: chrono::DateTime<chrono::Utc>,
+ ) -> Result<Vec<crate::domain::models::CalendarMentionPreview>, rootcause::Report> {
+ unreachable!()
+ }
+
async fn upsert_google_calendar(
&self,
_key: CalendarBackfillJobKey,
diff --git a/crates/calendar_events/src/domain/ports.rs b/crates/calendar_events/src/domain/ports.rs
index da9b3f58de..3db4bd1f4c 100644
--- a/crates/calendar_events/src/domain/ports.rs
+++ b/crates/calendar_events/src/domain/ports.rs
@@ -11,12 +11,12 @@ use super::models::{
CalendarBackfillFailureDisposition, CalendarBackfillFailureOutcome, CalendarBackfillJobKey,
CalendarCreationTarget, CalendarEvent, CalendarEventDraft, CalendarEventMutationTarget,
CalendarEventPatch, CalendarEventUpsert, CalendarGrantIntent, CalendarLinkTokenIdentity,
- CalendarOccurrence, CalendarOccurrenceCursor, CalendarReminderDeliveryOutcome,
- CalendarReminderDispatchMessage, CalendarReminderFiring, CalendarReminderSweepSummary,
- CalendarSyncStatus, DisconnectedGoogleCalendar, DueCalendarReminder,
- GoogleCalendarSyncSnapshot, GoogleCalendarTarget, GoogleEventSyncBatch, GoogleScopeSet,
- GoogleSyncPlan, GoogleWatchChannel, GoogleWatchConfig, OccurrenceRange, ProviderCalendar,
- StoredGoogleCalendar, VisibleCalendar,
+ CalendarMentionPreview, CalendarMentionRequestItem, CalendarOccurrence,
+ CalendarOccurrenceCursor, CalendarReminderDeliveryOutcome, CalendarReminderDispatchMessage,
+ CalendarReminderFiring, CalendarReminderSweepSummary, CalendarSyncStatus,
+ DisconnectedGoogleCalendar, DueCalendarReminder, GoogleCalendarSyncSnapshot,
+ GoogleCalendarTarget, GoogleEventSyncBatch, GoogleScopeSet, GoogleSyncPlan, GoogleWatchChannel,
+ GoogleWatchConfig, OccurrenceRange, ProviderCalendar, StoredGoogleCalendar, VisibleCalendar,
};
/// Classification supplied by provider adapters to backfill policy.
@@ -310,6 +310,14 @@ pub trait CalendarOccurrenceService: Send + Sync + 'static {
&self,
requester_id: &str,
) -> impl Future<Output = Result<CalendarSyncStatus, Report>> + Send;
+
+ /// Resolve mentioned events to the requester's own projections, one
+ /// result per requested item in order.
+ fn mention_previews(
+ &self,
+ requester_id: &str,
+ items: Vec<CalendarMentionRequestItem>,
+ ) -> impl Future<Output = Result<Vec<CalendarMentionPreview>, Report>> + Send;
}
/// Persistence operations used by calendar business logic.
@@ -359,6 +367,16 @@ pub trait CalendarRepository: Send + Sync + 'static {
requester_id: &str,
) -> impl Future<Output = Result<CalendarSyncStatus, Report>> + Send;
+ /// Resolve mentioned events to the requester's own projections, one
+ /// result per requested item in order. `now` anchors which occurrence a
+ /// series previews when the mention names no instance.
+ fn mention_previews(
+ &self,
+ requester_id: &str,
+ items: Vec<CalendarMentionRequestItem>,
+ now: DateTime<Utc>,
+ ) -> impl Future<Output = Result<Vec<CalendarMentionPreview>, Report>> + Send;
+
/// Upsert one provider calendar while holding the current backfill fence.
fn upsert_google_calendar(
&self,
diff --git a/crates/calendar_events/src/domain/service.rs b/crates/calendar_events/src/domain/service.rs
index f1a9fbfc2b..ea0787d06d 100644
--- a/crates/calendar_events/src/domain/service.rs
+++ b/crates/calendar_events/src/domain/service.rs
@@ -36,8 +36,14 @@ pub enum CalendarValidationError {
/// A page size was outside the supported bound.
#[error("calendar repository query limit must be between 1 and 2001")]
InvalidLimit,
+ /// A mention preview batch exceeded the supported size.
+ #[error("calendar mention previews accept at most {MENTION_PREVIEWS_MAX} events per request")]
+ TooManyMentions,
}
+/// The most mentioned events one preview request resolves.
+pub const MENTION_PREVIEWS_MAX: usize = 100;
+
/// Calendar use cases with provider and persistence details behind ports.
pub struct CalendarService<R> {
repository: R,
@@ -100,6 +106,24 @@ where
self.repository.sync_status(requester_id).await
}
+ /// Resolve mentioned events to the requester's own projections.
+ #[tracing::instrument(skip(self, requester_id, items), err)]
+ pub async fn mention_previews(
+ &self,
+ requester_id: &str,
+ items: Vec<super::models::CalendarMentionRequestItem>,
+ ) -> Result<Vec<super::models::CalendarMentionPreview>, Report> {
+ if items.len() > MENTION_PREVIEWS_MAX {
+ return Err(rootcause::report!(CalendarValidationError::TooManyMentions).into());
+ }
+ if items.is_empty() {
+ return Ok(Vec::new());
+ }
+ self.repository
+ .mention_previews(requester_id, items, Utc::now())
+ .await
+ }
+
/// Re-arm the watched inbox's sync job for a push notification whose
/// channel token the adapter already verified. Returns whether the
/// notification matched an active channel.
@@ -151,6 +175,15 @@ where
) -> impl Future<Output = Result<super::models::CalendarSyncStatus, Report>> + Send {
CalendarService::sync_status(self, requester_id)
}
+
+ fn mention_previews(
+ &self,
+ requester_id: &str,
+ items: Vec<super::models::CalendarMentionRequestItem>,
+ ) -> impl Future<Output = Result<Vec<super::models::CalendarMentionPreview>, Report>> + Send
+ {
+ CalendarService::mention_previews(self, requester_id, items)
+ }
}
/// Orchestrates a Google account backfill while keeping HTTP and SQL behind ports.
diff --git a/crates/calendar_events/src/domain/service/test.rs b/crates/calendar_events/src/domain/service/test.rs
index dbb8d53756..7ed71580b1 100644
--- a/crates/calendar_events/src/domain/service/test.rs
+++ b/crates/calendar_events/src/domain/service/test.rs
@@ -67,6 +67,18 @@ impl CalendarRepository for FakeRepo {
Ok(CalendarSyncStatus::Ready)
}
+ async fn mention_previews(
+ &self,
+ _requester_id: &str,
+ items: Vec<crate::domain::models::CalendarMentionRequestItem>,
+ _now: chrono::DateTime<Utc>,
+ ) -> Result<Vec<crate::domain::models::CalendarMentionPreview>, Report> {
+ Ok(items
+ .iter()
+ .map(|_| crate::domain::models::CalendarMentionPreview::DoesNotExist)
+ .collect())
+ }
+
async fn get_event_mutation_target(
&self,
_requester_id: &str,
diff --git a/crates/calendar_events/src/inbound/axum_router.rs b/crates/calendar_events/src/inbound/axum_router.rs
index 2a534ca1b2..0d4b90dc8b 100644
--- a/crates/calendar_events/src/inbound/axum_router.rs
+++ b/crates/calendar_events/src/inbound/axum_router.rs
@@ -10,7 +10,7 @@ use axum::{
extract::{FromRef, Query, State},
http::StatusCode,
response::{IntoResponse, Response},
- routing::get,
+ routing::{get, post},
};
use chrono::{DateTime, NaiveDate, NaiveTime, Utc};
use macro_authorization::{
@@ -18,11 +18,12 @@ use macro_authorization::{
};
use models_pagination::Base64Str;
use serde::{Deserialize, Serialize};
+use uuid::Uuid;
use crate::domain::{
models::{
- CalendarEvent, CalendarOccurrence, CalendarOccurrenceCursor, CalendarSyncStatus,
- OccurrenceRange,
+ CalendarEvent, CalendarMentionEvent, CalendarMentionPreview, CalendarMentionRequestItem,
+ CalendarOccurrence, CalendarOccurrenceCursor, CalendarSyncStatus, OccurrenceRange,
},
ports::CalendarOccurrenceService,
service::CalendarValidationError,
@@ -69,6 +70,10 @@ where
Router::new()
.route("/calendar-events", get(list_occurrences::<S, Auth>))
.route("/calendar-events/", get(list_occurrences::<S, Auth>))
+ .route(
+ "/calendar-events/preview",
+ post(mention_previews::<S, Auth>),
+ )
.with_state(state)
}
@@ -231,6 +236,150 @@ where
}))
}
+/// One mentioned event to resolve for the requester.
+#[derive(Debug, Deserialize, utoipa::ToSchema)]
+#[serde(rename_all = "camelCase")]
+pub struct CalendarMentionPreviewRequestItem {
+ /// Mentioned calendar event id.
+ event_id: Uuid,
+ /// Occurrence the mention points at, when it targets one instance.
+ occurrence_key: Option<String>,
+}
+
+/// Batch calendar mention preview request.
+#[derive(Debug, Deserialize, utoipa::ToSchema)]
+#[serde(rename_all = "camelCase")]
+pub struct CalendarMentionPreviewRequest {
+ /// Mentioned events to resolve, at most 100.
+ items: Vec<CalendarMentionPreviewRequestItem>,
+}
+
+/// Requester-relative visibility of one mentioned event.
+#[derive(Serialize, utoipa::ToSchema)]
+#[serde(rename_all = "snake_case")]
+pub enum CalendarMentionPreviewKind {
+ /// The requester holds a copy of the meeting on a visible calendar.
+ Access,
+ /// The event exists but is on no calendar the requester can see.
+ NoAccess,
+ /// No live event has this id.
+ DoesNotExist,
+}
+
+/// Resolution of one mentioned event, in request order.
+#[derive(Serialize, utoipa::ToSchema)]
+#[serde(rename_all = "camelCase")]
+pub struct CalendarMentionPreviewItem {
+ /// The mentioned event id, echoed from the request.
+ event_id: Uuid,
+ /// Visibility of the mentioned event to the requester.
+ #[serde(rename = "type")]
+ kind: CalendarMentionPreviewKind,
+ /// Preview of the requester's own copy, present only with access.
+ #[serde(skip_serializing_if = "Option::is_none")]
+ event: Option<CalendarMentionEvent>,
+}
+
+/// Batch calendar mention preview response.
+#[derive(Serialize, utoipa::ToSchema)]
+#[serde(rename_all = "camelCase")]
+pub struct CalendarMentionPreviewResponse {
+ items: Vec<CalendarMentionPreviewItem>,
+}
+
+/// Resolve mentioned calendar events to the requester's own projections.
+#[tracing::instrument(skip_all, err)]
+#[utoipa::path(
+ post,
+ path = "/calendar-events/preview",
+ tag = "calendar_events",
+ request_body = CalendarMentionPreviewRequest,
+ responses(
+ (status = 200, description = "Requester-relative previews for the mentioned events", body = CalendarMentionPreviewResponse),
+ (status = 400, description = "Too many events in one request"),
+ (status = 401, description = "Authentication required"),
+ (status = 500, description = "Calendar query failed"),
+ )
+)]
+pub async fn mention_previews<S, Auth>(
+ State(state): State<CalendarRouterState<S, Auth>>,
+ user: MacroAuthorizationExtractor<Auth, UserOrInternal>,
+ Json(request): Json<CalendarMentionPreviewRequest>,
+) -> Result<Json<CalendarMentionPreviewResponse>, CalendarApiError>
+where
+ S: CalendarOccurrenceService,
+ Auth: MacroAuthorizationService,
+{
+ let requested_ids: Vec<Uuid> = request.items.iter().map(|item| item.event_id).collect();
+ let items = request
+ .items
+ .into_iter()
+ .map(|item| CalendarMentionRequestItem {
+ event_id: item.event_id,
+ occurrence_key: item.occurrence_key,
+ })
+ .collect();
+ let previews = state
+ .service
+ .mention_previews(user.authorization.user.macro_user_id.as_ref(), items)
+ .await
+ .map_err(|error| {
+ if error
+ .as_ref()
+ .downcast_current_context::<CalendarValidationError>()
+ .is_some()
+ {
+ return CalendarApiError {
+ status: StatusCode::BAD_REQUEST,
+ message: "calendar mention previews accept at most 100 events per request",
+ };
+ }
+ tracing::error!(error = ?error, "failed to resolve calendar mention previews");
+ CalendarApiError {
+ status: StatusCode::INTERNAL_SERVER_ERROR,
+ message: "unable to resolve calendar mention previews",
+ }
+ })?;
+
+ // Positional pairing is only sound with one preview per requested item,
+ // which the port guarantees — treat any drift as a server error rather
+ // than silently mispairing.
+ if previews.len() != requested_ids.len() {
+ tracing::error!(
+ requested = requested_ids.len(),
+ resolved = previews.len(),
+ "calendar mention preview resolution returned a mismatched item count"
+ );
+ return Err(CalendarApiError {
+ status: StatusCode::INTERNAL_SERVER_ERROR,
+ message: "unable to resolve calendar mention previews",
+ });
+ }
+ let items = requested_ids
+ .into_iter()
+ .zip(previews)
+ .map(|(event_id, preview)| match preview {
+ CalendarMentionPreview::Accessible(event) => CalendarMentionPreviewItem {
+ event_id,
+ kind: CalendarMentionPreviewKind::Access,
+ event: Some(*event),
+ },
+ CalendarMentionPreview::NoAccess => CalendarMentionPreviewItem {
+ event_id,
+ kind: CalendarMentionPreviewKind::NoAccess,
+ event: None,
+ },
+ CalendarMentionPreview::DoesNotExist => CalendarMentionPreviewItem {
+ event_id,
+ kind: CalendarMentionPreviewKind::DoesNotExist,
+ event: None,
+ },
+ })
+ .collect();
+
+ Ok(Json(CalendarMentionPreviewResponse { items }))
+}
+
fn decode_cursor(
cursor: Option<String>,
) -> Result<Option<CalendarOccurrenceCursor>, CalendarApiError> {
diff --git a/crates/calendar_events/src/inbound/axum_router/test.rs b/crates/calendar_events/src/inbound/axum_router/test.rs
index b50418a83f..53ffe7c48c 100644
--- a/crates/calendar_events/src/inbound/axum_router/test.rs
+++ b/crates/calendar_events/src/inbound/axum_router/test.rs
@@ -39,3 +39,54 @@ fn occurrence_cursor_round_trips_equal_start_tie_breakers() {
assert_eq!(decode_cursor(Some(encoded)).unwrap(), Some(cursor));
assert!(decode_cursor(Some("not-base64".to_string())).is_err());
}
+
+#[test]
+fn mention_preview_items_serialize_the_preview_contract() {
+ let event_id = uuid::Uuid::now_v7();
+ let starts_at = Utc.with_ymd_and_hms(2026, 8, 19, 19, 0, 0).unwrap();
+ let accessible = CalendarMentionPreviewItem {
+ event_id,
+ kind: CalendarMentionPreviewKind::Access,
+ event: Some(CalendarMentionEvent {
+ viewer_event_id: event_id,
+ title: "Smart Macro Discussion".to_string(),
+ time: crate::domain::models::EventTime::Timed {
+ starts_at,
+ ends_at: starts_at + chrono::Duration::minutes(90),
+ time_zone: Some("America/New_York".to_string()),
+ },
+ occurrence_key: Some(starts_at.to_rfc3339()),
+ is_recurring: false,
+ location: None,
+ organizer_email: Some("[email protected]".to_string()),
+ organizer_name: None,
+ attendee_count: 3,
+ updated_at: starts_at,
+ }),
+ };
+ let json = serde_json::to_value(&accessible).unwrap();
+ assert_eq!(json["type"], "access");
+ assert_eq!(json["eventId"], event_id.to_string());
+ assert_eq!(json["event"]["viewerEventId"], event_id.to_string());
+ assert_eq!(json["event"]["time"]["kind"], "timed");
+ assert_eq!(json["event"]["attendeeCount"], 3);
+
+ let no_access = CalendarMentionPreviewItem {
+ event_id,
+ kind: CalendarMentionPreviewKind::NoAccess,
+ event: None,
+ };
+ let json = serde_json::to_value(&no_access).unwrap();
+ assert_eq!(json["type"], "no_access");
+ assert!(json.get("event").is_none());
+
+ let deleted = CalendarMentionPreviewItem {
+ event_id,
+ kind: CalendarMentionPreviewKind::DoesNotExist,
+ event: None,
+ };
+ assert_eq!(
+ serde_json::to_value(&deleted).unwrap()["type"],
+ "does_not_exist"
+ );
+}
diff --git a/crates/calendar_events/src/inbound/toolset/test.rs b/crates/calendar_events/src/inbound/toolset/test.rs
index b975fcf7cd..c9336fdf98 100644
--- a/crates/calendar_events/src/inbound/toolset/test.rs
+++ b/crates/calendar_events/src/inbound/toolset/test.rs
@@ -241,6 +241,14 @@ impl CalendarOccurrenceService for MockOccurrences {
) -> Result<CalendarSyncStatus, rootcause::Report> {
Ok(self.status)
}
+
+ async fn mention_previews(
+ &self,
+ _requester_id: &str,
+ _items: Vec<crate::domain::models::CalendarMentionRequestItem>,
+ ) -> Result<Vec<crate::domain::models::CalendarMentionPreview>, rootcause::Report> {
+ unreachable!("no calendar tool resolves mention previews")
+ }
}
fn context(
diff --git a/crates/calendar_events/src/outbound/pg.rs b/crates/calendar_events/src/outbound/pg.rs
index 8ff3ce88d4..794cb2c7fd 100644
--- a/crates/calendar_events/src/outbound/pg.rs
+++ b/crates/calendar_events/src/outbound/pg.rs
@@ -15,7 +15,8 @@ use crate::domain::{
CalendarBackfillFailureDisposition, CalendarBackfillFailureOutcome, CalendarBackfillJob,
CalendarBackfillJobKey, CalendarBackfillKind, CalendarCreationTarget, CalendarEvent,
CalendarEventMutationTarget, CalendarEventOverride, CalendarEventSource,
- CalendarEventUpsert, CalendarGrantIntent, CalendarLinkTokenIdentity, CalendarOccurrence,
+ CalendarEventUpsert, CalendarGrantIntent, CalendarLinkTokenIdentity, CalendarMentionEvent,
+ CalendarMentionPreview, CalendarMentionRequestItem, CalendarOccurrence,
CalendarOccurrenceCursor, CalendarReminderFiring, CalendarSyncStatus, CalendarWatchRelease,
ConferenceProvider, DisconnectedGoogleCalendar, DueCalendarReminder, EventReminderOverride,
EventReminders, EventStart, EventStatus, EventTime, EventTransparency, EventVisibility,
@@ -305,6 +306,28 @@ struct OccurrenceJoinRow {
updated_at: DateTime<Utc>,
}
+struct MentionPreviewRow {
+ mention_exists: bool,
+ viewer_event_id: Option<Uuid>,
+ title: Option<String>,
+ location: Option<String>,
+ organizer_email: Option<String>,
+ organizer_name: Option<String>,
+ recurrence_lines: Option<Vec<String>>,
+ event_starts_at: Option<DateTime<Utc>>,
+ event_ends_at: Option<DateTime<Utc>>,
+ event_start_date: Option<NaiveDate>,
+ event_end_date: Option<NaiveDate>,
+ time_zone: Option<String>,
+ updated_at: Option<DateTime<Utc>>,
+ occurrence_key: Option<String>,
+ occurrence_starts_at: Option<DateTime<Utc>>,
+ occurrence_ends_at: Option<DateTime<Utc>>,
+ occurrence_start_date: Option<NaiveDate>,
+ occurrence_end_date: Option<NaiveDate>,
+ attendee_count: Option<i64>,
+}
+
struct OverrideAttendeeRow {
event_id: Uuid,
recurrence_id: String,
@@ -949,6 +972,128 @@ impl CalendarRepository for PgCalendarRepository {
.collect()
}
+ #[tracing::instrument(skip(self, requester_id, items), err)]
+ async fn mention_previews(
+ &self,
+ requester_id: &str,
+ items: Vec<CalendarMentionRequestItem>,
+ now: DateTime<Utc>,
+ ) -> Result<Vec<CalendarMentionPreview>, Report> {
+ let event_ids: Vec<Uuid> = items.iter().map(|item| item.event_id).collect();
+ let occurrence_keys: Vec<Option<String>> = items
+ .iter()
+ .map(|item| item.occurrence_key.clone())
+ .collect();
+ // The viewer lateral resolves the mentioned meeting to the
+ // requester's own projection through the shared iCalendar UID,
+ // preferring an owned copy over a delegated one and the mentioned
+ // row itself among ties, so the preview only ever reads rows the
+ // requester could already see on their calendar.
+ let rows = sqlx::query_as!(
+ MentionPreviewRow,
+ r#"
+ SELECT
+ (mentioned.id IS NOT NULL) AS "mention_exists!",
+ viewer_event.id AS "viewer_event_id?",
+ viewer_event.title AS "title?",
+ viewer_event.location AS "location?",
+ viewer_event.organizer_email AS "organizer_email?",
+ viewer_event.organizer_name AS "organizer_name?",
+ viewer_event.recurrence_lines AS "recurrence_lines?",
+ viewer_event.starts_at AS "event_starts_at?",
+ viewer_event.ends_at AS "event_ends_at?",
+ viewer_event.start_date AS "event_start_date?",
+ viewer_event.end_date AS "event_end_date?",
+ viewer_event.time_zone AS "time_zone?",
+ viewer_event.updated_at AS "updated_at?",
+ occurrence.occurrence_key AS "occurrence_key?",
+ occurrence.starts_at AS "occurrence_starts_at?",
+ occurrence.ends_at AS "occurrence_ends_at?",
+ occurrence.start_date AS "occurrence_start_date?",
+ occurrence.end_date AS "occurrence_end_date?",
+ attendees.attendee_count AS "attendee_count?"
+ FROM unnest($2::uuid[], $3::text[])
+ WITH ORDINALITY AS requested(event_id, occurrence_key, ord)
+ LEFT JOIN calendar_events mentioned
+ ON mentioned.id = requested.event_id
+ AND mentioned.status <> 'cancelled'
+ LEFT JOIN LATERAL (
+ SELECT
+ candidate.id,
+ candidate.title,
+ candidate.location,
+ candidate.organizer_email,
+ candidate.organizer_name,
+ candidate.recurrence_lines,
+ candidate.starts_at,
+ candidate.ends_at,
+ candidate.start_date,
+ candidate.end_date,
+ candidate.time_zone,
+ candidate.updated_at
+ FROM calendar_events candidate
+ WHERE candidate.ical_uid = mentioned.ical_uid
+ AND candidate.status <> 'cancelled'
+ AND (
+ candidate.owner_id = $1
+ OR EXISTS (
+ SELECT 1
+ FROM macro_user_links link
+ WHERE link.link_id = candidate.source_link_id
+ AND link.primary_macro_id = $1
+ )
+ )
+ ORDER BY
+ (candidate.owner_id = $1) DESC,
+ (candidate.id = mentioned.id) DESC,
+ candidate.updated_at DESC,
+ candidate.id
+ LIMIT 1
+ ) viewer_event ON true
+ LEFT JOIN LATERAL (
+ SELECT
+ instance.occurrence_key,
+ instance.starts_at,
+ instance.ends_at,
+ instance.start_date,
+ instance.end_date
+ FROM calendar_event_occurrences instance
+ CROSS JOIN LATERAL (
+ SELECT COALESCE(
+ instance.starts_at,
+ instance.start_date::timestamp AT TIME ZONE 'UTC'
+ ) AS at
+ ) instance_start
+ WHERE instance.event_id = viewer_event.id
+ AND NOT instance.is_cancelled
+ ORDER BY
+ (instance.occurrence_key
+ IS NOT DISTINCT FROM requested.occurrence_key) DESC,
+ (instance_start.at >= $4) DESC,
+ CASE WHEN instance_start.at >= $4 THEN instance_start.at END ASC,
+ instance_start.at DESC,
+ instance.occurrence_key
+ LIMIT 1
+ ) occurrence ON true
+ LEFT JOIN LATERAL (
+ SELECT count(*) AS attendee_count
+ FROM calendar_event_attendees attendee
+ WHERE attendee.event_id = viewer_event.id
+ ) attendees ON true
+ ORDER BY requested.ord
+ "#,
+ requester_id,
+ &event_ids,
+ &occurrence_keys as &[Option<String>],
+ now,
+ )
+ .fetch_all(&self.pool)
+ .await
+ .map_err(report)?;
+
+ rows.into_iter().map(mention_preview_from_row).collect()
+ }
+
#[tracing::instrument(skip(self, requester_id), err)]
async fn sync_status(&self, requester_id: &str) -> Result<CalendarSyncStatus, Report> {
let is_syncing = sqlx::query_scalar!(
@@ -2988,6 +3133,49 @@ fn row_time(
}
}
+fn mention_preview_from_row(row: MentionPreviewRow) -> Result<CalendarMentionPreview, Report> {
+ if !row.mention_exists {
+ return Ok(CalendarMentionPreview::DoesNotExist);
+ }
+ let Some(viewer_event_id) = row.viewer_event_id else {
+ return Ok(CalendarMentionPreview::NoAccess);
+ };
+ let time = if row.occurrence_key.is_some() {
+ row_time(
+ row.occurrence_starts_at,
+ row.occurrence_ends_at,
+ row.occurrence_start_date,
+ row.occurrence_end_date,
+ row.time_zone,
+ )?
+ } else {
+ // No materialized instance (the event sits outside the maintained
+ // window) — the series' own span still gives the preview a time.
+ row_time(
+ row.event_starts_at,
+ row.event_ends_at,
+ row.event_start_date,
+ row.event_end_date,
+ row.time_zone,
+ )?
+ };
+ Ok(CalendarMentionPreview::Accessible(Box::new(
+ CalendarMentionEvent {
+ viewer_event_id,
+ title: row.title.unwrap_or_default(),
+ time,
+ occurrence_key: row.occurrence_key,
+ is_recurring: !row.recurrence_lines.unwrap_or_default().is_empty(),
+ location: row.location,
+ organizer_email: row.organizer_email,
+ organizer_name: row.organizer_name,
+ attendee_count: usize::try_from(row.attendee_count.unwrap_or_default())
+ .unwrap_or_default(),
+ updated_at: row.updated_at.unwrap_or(DateTime::<Utc>::MIN_UTC),
+ },
+ )))
+}
+
fn event_from_join(
row: OccurrenceJoinRow,
attendees: Vec<CalendarAttendee>,
diff --git a/crates/calendar_events/src/outbound/pg/test.rs b/crates/calendar_events/src/outbound/pg/test.rs
index 6dd4163173..f220b2bd22 100644
--- a/crates/calendar_events/src/outbound/pg/test.rs
+++ b/crates/calendar_events/src/outbound/pg/test.rs
@@ -3285,3 +3285,191 @@ async fn only_the_owner_can_disconnect_an_inbox_calendar(pool: PgPool) {
1
);
}
+
+#[sqlx::test(migrator = "MACRO_DB_MIGRATIONS")]
+async fn mention_previews_resolve_through_the_shared_uid(pool: PgPool) {
+ let author_id = "macro|[email protected]";
+ let attendee_id = "macro|[email protected]";
+ let author_link = insert_link(&pool, author_id).await;
+ let attendee_link = insert_link(&pool, attendee_id).await;
+ let repo = PgCalendarRepository::new(pool.clone());
+ let author_provider = provider_ids(&repo, author_link).await;
+ let attendee_provider = provider_ids(&repo, attendee_link).await;
+
+ let author_copy = timed_upsert(
+ author_id,
+ author_link,
+ author_provider,
+ "Smart Macro Discussion",
+ 1,
+ );
+ let author_event_id = author_copy.event.id;
+ repo.upsert_event_fixture(author_copy).await.unwrap();
+ let attendee_copy = timed_upsert(
+ attendee_id,
+ attendee_link,
+ attendee_provider,
+ "Smart Macro Discussion",
+ 1,
+ );
+ let attendee_event_id = attendee_copy.event.id;
+ repo.upsert_event_fixture(attendee_copy).await.unwrap();
+ let private_copy = timed_upsert(
+ author_id,
+ author_link,
+ author_provider,
+ "Author only",
+ 1,
+ );
+ let private_event_id = private_copy.event.id;
+ repo.upsert_event_fixture(private_copy).await.unwrap();
+ let mut cancelled_copy = timed_upsert(
+ author_id,
+ author_link,
+ author_provider,
+ "Cancelled",
+ 1,
+ );
+ cancelled_copy.event.status = EventStatus::Cancelled;
+ let cancelled_event_id = cancelled_copy.event.id;
+ repo.upsert_event_fixture(cancelled_copy).await.unwrap();
+
+ let now = Utc.with_ymd_and_hms(2026, 7, 23, 0, 0, 0).unwrap();
+ let request = |event_id| CalendarMentionRequestItem {
+ event_id,
+ occurrence_key: None,
+ };
+
+ let previews = repo
+ .mention_previews(
+ author_id,
+ vec![request(author_event_id), request(Uuid::now_v7())],
+ now,
+ )
+ .await
+ .unwrap();
+ let CalendarMentionPreview::Accessible(own) = &previews[0] else {
+ panic!("author preview should be accessible: {:?}", previews[0]);
+ };
+ assert_eq!(own.viewer_event_id, author_event_id);
+ assert_eq!(own.title, "Smart Macro Discussion");
+ assert!(own.is_recurring);
+ assert_eq!(own.attendee_count, 1);
+ assert_eq!(previews[1], CalendarMentionPreview::DoesNotExist);
+
+ // The attendee resolves the author's row to their own projection, and
+ // never sees the author-only or cancelled meetings.
+ let previews = repo
+ .mention_previews(
+ attendee_id,
+ vec![
+ request(author_event_id),
+ request(private_event_id),
+ request(cancelled_event_id),
+ ],
+ now,
+ )
+ .await
+ .unwrap();
+ let CalendarMentionPreview::Accessible(resolved) = &previews[0] else {
+ panic!("attendee preview should be accessible: {:?}", previews[0]);
+ };
+ assert_eq!(resolved.viewer_event_id, attendee_event_id);
+ assert_eq!(previews[1], CalendarMentionPreview::NoAccess);
+ assert_eq!(previews[2], CalendarMentionPreview::DoesNotExist);
+}
+
+#[sqlx::test(migrator = "MACRO_DB_MIGRATIONS")]
+async fn mention_preview_picks_the_requested_or_nearest_occurrence(pool: PgPool) {
+ let owner_id = "macro|[email protected]";
+ let link_id = insert_link(&pool, owner_id).await;
+ let repo = PgCalendarRepository::new(pool.clone());
+ let provider = provider_ids(&repo, link_id).await;
+ let upsert = timed_upsert(
+ owner_id,
+ link_id,
+ provider,
+ "Series",
+ 1,
+ );
+ let event_id = upsert.event.id;
+ let first_start = Utc.with_ymd_and_hms(2026, 7, 24, 14, 0, 0).unwrap();
+ let second_start = first_start + Duration::days(1);
+ repo.upsert_event_fixture(upsert).await.unwrap();
+
+ let preview_time = |preview: &CalendarMentionPreview| match preview {
+ CalendarMentionPreview::Accessible(event) => {
+ (event.time.clone(), event.occurrence_key.clone())
+ }
+ other => panic!("expected an accessible preview: {other:?}"),
+ };
+
+ // Before the series: the next upcoming instance.
+ let before = Utc.with_ymd_and_hms(2026, 7, 23, 0, 0, 0).unwrap();
+ let previews = repo
+ .mention_previews(
+ owner_id,
+ vec![CalendarMentionRequestItem {
+ event_id,
+ occurrence_key: None,
+ }],
+ before,
+ )
+ .await
+ .unwrap();
+ let (time, key) = preview_time(&previews[0]);
+ assert_eq!(key.as_deref(), Some(first_start.to_rfc3339().as_str()));
+ assert!(matches!(time, EventTime::Timed { starts_at, .. } if starts_at == first_start));
+
+ // Between instances: still the next upcoming one.
+ let between = Utc.with_ymd_and_hms(2026, 7, 24, 18, 0, 0).unwrap();
+ let previews = repo
+ .mention_previews(
+ owner_id,
+ vec![CalendarMentionRequestItem {
+ event_id,
+ occurrence_key: None,
+ }],
+ between,
+ )
+ .await
+ .unwrap();
+ let (_, key) = preview_time(&previews[0]);
+ assert_eq!(key.as_deref(), Some(second_start.to_rfc3339().as_str()));
+
+ // After the series: the latest past instance.
+ let after = Utc.with_ymd_and_hms(2026, 8, 1, 0, 0, 0).unwrap();
+ let previews = repo
+ .mention_previews(
+ owner_id,
+ vec![CalendarMentionRequestItem {
+ event_id,
+ occurrence_key: None,
+ }],
+ after,
+ )
+ .await
+ .unwrap();
+ let (_, key) = preview_time(&previews[0]);
+ assert_eq!(key.as_deref(), Some(second_start.to_rfc3339().as_str()));
+
+ // A requested instance wins regardless of the clock.
+ let previews = repo
+ .mention_previews(
+ owner_id,
+ vec![CalendarMentionRequestItem {
+ event_id,
+ occurrence_key: Some(first_start.to_rfc3339()),
+ }],
+ after,
+ )
+ .await
+ .unwrap();
+ let (_, key) = preview_time(&previews[0]);
+ assert_eq!(key.as_deref(), Some(first_start.to_rfc3339().as_str()));
+}
diff --git a/crates/macro_db_client/migrations/20260818203925_calendar_events_ical_uid_index.sql b/crates/macro_db_client/migrations/20260818203925_calendar_events_ical_uid_index.sql
new file mode 100644
index 0000000000..a900c5b13a
--- /dev/null
+++ b/crates/macro_db_client/migrations/20260818203925_calendar_events_ical_uid_index.sql
@@ -0,0 +1,9 @@
+-- no-transaction
+-- Mention previews resolve a mentioned event to the requester's own
+-- projection of the same meeting through the shared iCalendar UID. The
+-- existing unique index leads with owner_id, so UID lookups need their own.
+-- Must stay a single statement: sqlx sends no-transaction migrations with
+-- multiple statements as one batch, which wraps them in an implicit
+-- transaction that CONCURRENTLY forbids.
+CREATE INDEX CONCURRENTLY IF NOT EXISTS "calendar_events_ical_uid_idx"
+ ON "calendar_events" ("ical_uid");
diff --git a/crates/prompt/src/mentions.rs b/crates/prompt/src/mentions.rs
index e70ac4685c..9f5f464a26 100644
--- a/crates/prompt/src/mentions.rs
+++ b/crates/prompt/src/mentions.rs
@@ -15,12 +15,11 @@
use crate::types::StaticPrompt;
-static TITLE: &str =
- "Mentioning documents, channels, channel messages, chats, projects, and email threads";
+static TITLE: &str = "Mentioning documents, channels, channel messages, chats, projects, email threads, and calendar events";
static INSTRUCTIONS: &str = r##"These rules apply everywhere you author Markdown in Macro: your own conversational replies, `SendChannelMessage` content, `SendEmail` bodies, and `CreateDocument`/`EditDocument` content for Markdown (`.md`) documents. They do NOT apply to non-Markdown documents created via `CreateDocument` (e.g. PDF, CSV, PNG, XLSX, DOCX) — those are raw file bytes, never parsed as Markdown, and must never contain mention tags or Markdown syntax.
-When referencing a document, channel, chat, project, or email thread, use XML mention tags with a JSON payload.
+When referencing a document, channel, chat, project, email thread, or calendar event, use XML mention tags with a JSON payload.
The AI does not need to know the name — an empty string is fine and the frontend will resolve it.
- Document mention: `<m-document-mention>{"documentId":"{id}","documentName":"","blockName":"md","blockParams":{}}</m-document-mention>`
@@ -30,8 +29,11 @@ The AI does not need to know the name — an empty string is fine and the fronte
- Project mention: `<m-document-mention>{"documentId":"{id}","documentName":"","blockName":"project","blockParams":{}}</m-document-mention>`
- Task mention: `<m-document-mention>{"documentId":"{id}","documentName":"","blockName":"task","blockParams":{}}</m-document-mention>`
- Email thread mention: `<m-document-mention>{"documentId":"{thread_id}","documentName":"","blockName":"email","blockParams":{}}</m-document-mention>`
+- Calendar event mention: `<m-document-mention>{"documentId":"{event_id}","documentName":"","blockName":"calendar","blockParams":{}}</m-document-mention>`
+- Calendar event occurrence mention: `<m-document-mention>{"documentId":"{event_id}","documentName":"","blockName":"calendar","blockParams":{"occurrenceKey":"{recurrence_id}"}}</m-document-mention>`
The `blockName` for an email thread is always exactly `email` — never `thread` or `email_thread`, which the frontend cannot resolve.
+The `blockName` for a calendar event is always exactly `calendar` — never `calendar_event`, which the frontend cannot resolve. `documentId` is the `eventId` a calendar tool returned. To point at one instance of a recurring event, pass that occurrence's `recurrenceId` from ListCalendarEvents as the `occurrenceKey` block param; otherwise omit it and the mention previews the nearest instance. A calendar event mention resolves only for users who have that event on their own calendar.
When a tool returns both a channel id and a channel message id, link the specific message using the channel message mention format. Do not link only the channel unless you are referring to the whole channel.
### Example Response
@@ -42,7 +44,8 @@ If no inline or node ids are present:
static INTENT: &str = "Entities and channel messages are referenced with correctly formatted \
<m-document-mention> XML tags using the right blockName and blockParams for each entity type, \
-including exactly \"email\" for email threads and channel_message_id for specific channel messages, \
+including exactly \"email\" for email threads, exactly \"calendar\" for calendar events, and \
+channel_message_id for specific channel messages, \
across every Markdown surface (replies, channel messages, email bodies, and Markdown documents) — \
never inside non-Markdown documents.";
diff --git a/crates/prompt/tests/compose.rs b/crates/prompt/tests/compose.rs
index 3ab6d24060..093711201b 100644
--- a/crates/prompt/tests/compose.rs
+++ b/crates/prompt/tests/compose.rs
@@ -6,7 +6,7 @@ const BASE_TITLES: [&str; 6] = [
"# Tone and Style",
"# Math Rendering Rules",
"# Citation Rules",
- "# Mentioning documents, channels, channel messages, chats, projects, and email threads",
+ "# Mentioning documents, channels, channel messages, chats, projects, email threads, and calendar events",
"# Do Not Rules",
"# Terms",
];
diff --git a/packages/lexical-core/tests/channel-mentions.test.ts b/packages/lexical-core/tests/channel-mentions.test.ts
index dd288534ec..b87624331e 100644
--- a/packages/lexical-core/tests/channel-mentions.test.ts
+++ b/packages/lexical-core/tests/channel-mentions.test.ts
@@ -26,6 +26,7 @@ describe('extractChannelMentionsFromMarkdown', () => {
['chat', 'chat'],
['email', 'thread'],
['call', 'call'],
+ ['calendar', 'calendar_event'],
['automation', 'automation'],
['company', 'crm_company'],
['contact', 'crm_contact'],
diff --git a/packages/lexical-core/utils/mentions.ts b/packages/lexical-core/utils/mentions.ts
index daae8ce19a..8cd6eec334 100644
--- a/packages/lexical-core/utils/mentions.ts
+++ b/packages/lexical-core/utils/mentions.ts
@@ -94,6 +94,8 @@ function documentMentionEntityType(blockName: string): string {
return 'thread';
case 'call':
return 'call';
+ case 'calendar':
+ return 'calendar_event';
case 'automation':
return 'automation';
case 'company':
diff --git a/packages/sdk/generated/storage/index.ts b/packages/sdk/generated/storage/index.ts
index 48fda18e8a..6c68697a97 100644
--- a/packages/sdk/generated/storage/index.ts
+++ b/packages/sdk/generated/storage/index.ts
@@ -1,4 +1,4 @@
// This file is auto-generated by @hey-api/openapi-ts
export { type Options, Sdk } from './sdk.gen';
-export type { AccessLevel, ActivityType, AddFavoriteData, AddFavoriteError, AddFavoriteErrors, AddFavoriteRequest, AddFavoriteResponse, AddFavoriteResponses, AddParticipantsData, AddParticipantsError, AddParticipantsErrors, AddParticipantsRequest, AddParticipantsResponses, AddPinHandlerData, AddPinHandlerError, AddPinHandlerErrors, AddPinHandlerResponse, AddPinHandlerResponses, AddPinRequest, Anchor, AnchorId, AnchorRequest, AnchorResponse, AnnotationIncrementalUpdate, ApiActivity, ApiAttachmentChannelReference, ApiAttachmentEntityReference, ApiAttachmentGenericReference, ApiChannelAttachment, ApiChannelAttachmentsPage, ApiChannelContextMessage, ApiChannelDetail, ApiChannelListMessage, ApiChannelListPage, ApiChannelListParticipant, ApiChannelListType, ApiChannelMessage, ApiChannelMessageKind, ApiChannelMessagesPage, ApiChannelParticipant, ApiChannelWithLatest, ApiCountedReaction, ApiEntityFilterAst, ApiGroupByField, ApiGroupMeta, ApiMessageAttachment, ApiMessageSender, ApiMessageSenderType, ApiParticipantListRole, ApiParticipantRole, ApiPropertyEntityType, ApiResolvedChannelMessage, ApiThreadInfo, ApiThreadReply, AttendeeResponseStatus, BasicDocument, BasicDocumentSubType, BomPart, Bot, BotChannel, BotChannelType, BotId, BotKind, BotOwner, BotToken, BranchNameResponse, BTreeMap, BulkWakeupRequest, BulkWakeupResponse, BulkWakeupSyncServiceDocumentsData, BulkWakeupSyncServiceDocumentsErrors, BulkWakeupSyncServiceDocumentsResponse, BulkWakeupSyncServiceDocumentsResponses, CalendarAttendee, CalendarEvent, CalendarEventFilters, CalendarOccurrence, CalendarOccurrenceItem, CalendarOccurrenceResponse, CalendarSyncStatus, CallActiveResponse, CallFilters, CallRecord, CallRecordParticipant, CallRecordPreview, CallRecordPreviewData, CallRecordTranscriptSegment, CallStatus, CallTokenResponse, CallWebhookData, CallWebhookError, CallWebhookErrors, CallWebhookResponses, Channel, ChannelCreatedMetadata, ChannelDeletedMetadata, ChannelEventAttachment, ChannelFilters, ChannelJoinCodeResponse, ChannelMentionedMetadata, ChannelMessage, ChannelMessageAttachmentCreatedMetadata, ChannelMessageAttachmentRemovedMetadata, ChannelMessageDeletedMetadata, ChannelMessageFilters, ChannelMessagePatchedMetadata, ChannelMessagePostedMetadata, ChannelParticipant, ChannelParticipantAddedMetadata, ChannelParticipantRemovedMetadata, ChannelPreview, ChannelPreviewData, ChannelSender, ChannelSharePermission, ChannelThreadFilters, ChannelTopicEvent, ChannelType, ChannelUpdatedMetadata, ChannelWebhookRequest, ChannelWebhookResponse, ChannelWithParticipants, Chat, ChatFilters, CheckActiveCallData, CheckActiveCallError, CheckActiveCallErrors, CheckActiveCallResponse, CheckActiveCallResponses, ClientOptions, CloudStorageItemType, Comment, CommentThread, ConferenceProvider, CopyDocumentData, CopyDocumentError, CopyDocumentErrors, CopyDocumentQueryParams, CopyDocumentRequest, CopyDocumentResponse, CopyDocumentResponse2, CopyDocumentResponses, CreateAnchorData, CreateAnchorError, CreateAnchorErrors, CreateAnchorResponse, CreateAnchorResponses, CreateBulkDocumentResponse, CreateBulkDocumentResponseData, CreateChannelData, CreateChannelError, CreateChannelErrors, CreateChannelRequest, CreateChannelResponse, CreateChannelResponse2, CreateChannelResponses, CreateChannelScopedBotData, CreateChannelScopedBotError, CreateChannelScopedBotErrors, CreateChannelScopedBotRequest, CreateChannelScopedBotResponse, CreateChannelScopedBotResponse2, CreateChannelScopedBotResponses, CreateCommentData, CreateCommentError, CreateCommentErrors, CreateCommentRequest, CreateCommentResponse, CreateCommentResponse2, CreateCommentResponses, CreateCrmCommentData, CreateCrmCommentError, CreateCrmCommentErrors, CreateCrmCommentRequest, CreateCrmCommentResponse, CreateCrmCommentResponses, CreateCrmCompanyData, CreateCrmCompanyError, CreateCrmCompanyErrors, CreateCrmCompanyRequest, CreateCrmCompanyResponse, CreateCrmCompanyResponses, CreateCrmContactData, CreateCrmContactError, CreateCrmContactErrors, CreateCrmContactRequest, CreateCrmContactResponse, CreateCrmContactResponses, CreateDocumentData, CreateDocumentError, CreateDocumentErrors, CreateDocumentRequest, CreateDocumentResponse, CreateDocumentResponseData, CreateDocumentResponses, CreateEntityMentionData, CreateEntityMentionError, CreateEntityMentionErrors, CreateEntityMentionRequest, CreateEntityMentionResponse, CreateEntityMentionResponse2, CreateEntityMentionResponses, CreateInstructionsDocumentResponse, CreateInstructionsHandlerData, CreateInstructionsHandlerError, CreateInstructionsHandlerErrors, CreateInstructionsHandlerResponse, CreateInstructionsHandlerResponses, CreateMarkdownDocumentRequest, CreateMarkdownDocumentResponse, CreateMarkdownHandlerData, CreateMarkdownHandlerError, CreateMarkdownHandlerErrors, CreateMarkdownHandlerResponse, CreateMarkdownHandlerResponses, CreateProjectHandlerData, CreateProjectHandlerError, CreateProjectHandlerErrors, CreateProjectHandlerResponse, CreateProjectHandlerResponses, CreateProjectRequest, CreateProjectResponse, CreateReminderData, CreateReminderError, CreateReminderErrors, CreateReminderRequest, CreateReminderResponse, CreateReminderResponses, CreateSkillHandlerData, CreateSkillHandlerError, CreateSkillHandlerErrors, CreateSkillHandlerResponse, CreateSkillHandlerResponses, CreateSkillRequest, CreateSkillResponse, CreateSnippetHandlerData, CreateSnippetHandlerError, CreateSnippetHandlerErrors, CreateSnippetHandlerResponse, CreateSnippetHandlerResponses, CreateSnippetRequest, CreateSnippetResponse, CreateTaskHandlerData, CreateTaskHandlerError, CreateTaskHandlerErrors, CreateTaskHandlerResponse, CreateTaskHandlerResponses, CreateTaskRequest, CreateTaskResponse, CreateUnthreadedAnchorRequest, CreateUnthreadedAnchorResponse, CreateUnthreadedPdfAnchorRequest, CreateViewHandlerData, CreateViewHandlerError, CreateViewHandlerErrors, CreateViewHandlerResponse, CreateViewHandlerResponses, CreateViewRequest, CreateWebhookData, CreateWebhookError, CreateWebhookErrors, CreateWebhookRequest, CreateWebhookResponse, CreateWebhookResponse2, CreateWebhookResponses, CrmComment, CrmCommentEntityType, CrmCommentThread, CrmCompanyFilters, CrmCompanyResponse, CrmContactResponse, CrmDomainResponse, CrmPermissionRole, CrmTeamSettingsResponse, CrmThread, CustomSpeakerAssignment, DataType, DeleteAnchorData, DeleteAnchorError, DeleteAnchorErrors, DeleteAnchorInfo, DeleteAnchorResponse, DeleteAnchorResponses, DeleteCallRecordData, DeleteCallRecordError, DeleteCallRecordErrors, DeleteCallRecordResponse, DeleteCallRecordResponses, DeleteChannelData, DeleteChannelError, DeleteChannelErrors, DeleteChannelResponse, DeleteChannelResponses, DeleteCommentData, DeleteCommentError, DeleteCommentErrors, DeleteCommentRequest, DeleteCommentResponse, DeleteCommentResponse2, DeleteCommentResponses, DeleteCrmCommentData, DeleteCrmCommentError, DeleteCrmCommentErrors, DeleteCrmCommentResponse, DeleteCrmCommentResponses, DeleteCrmCommentResult, DeleteDocumentData, DeleteDocumentError, DeleteDocumentErrors, DeleteDocumentResponse, DeleteDocumentResponses, DeleteEntityMentionData, DeleteEntityMentionError, DeleteEntityMentionErrors, DeleteEntityMentionResponse, DeleteEntityMentionResponse2, DeleteEntityMentionResponses, DeleteHistoryHandlerData, DeleteHistoryHandlerError, DeleteHistoryHandlerErrors, DeleteHistoryHandlerResponse, DeleteHistoryHandlerResponses, DeleteMessageData, DeleteMessageError, DeleteMessageErrors, DeleteMessageQuery, DeleteMessageResponse, DeleteMessageResponses, DeleteProjectHandlerData, DeleteProjectHandlerError, DeleteProjectHandlerErrors, DeleteProjectHandlerResponse, DeleteProjectHandlerResponses, DeleteReminderData, DeleteReminderError, DeleteReminderErrors, DeleteReminderResponse, DeleteReminderResponses, DeleteThreadInfo, DeleteUnthreadedAnchorRequest, DeleteUnthreadedAnchorResponse, DeleteUnthreadedPdfAnchorRequest, DeleteUserDocumentViewLocationData, DeleteUserDocumentViewLocationError, DeleteUserDocumentViewLocationErrors, DeleteUserDocumentViewLocationResponse, DeleteUserDocumentViewLocationResponses, DeleteViewHandlerData, DeleteViewHandlerError, DeleteViewHandlerErrors, DeleteViewHandlerResponses, DeleteWebhookData, DeleteWebhookError, DeleteWebhookErrors, DeleteWebhookResponse, DeleteWebhookResponses, DocumentBasic, DocumentContent, DocumentContentLocation, DocumentContentState, DocumentContentUploadedMetadata, DocumentCopiedMetadata, DocumentCreatedMetadata, DocumentDeletedMetadata, DocumentFilters, DocumentInteractionMetadata, DocumentMetadata, DocumentMetadataWithContent, DocumentPermissionsToken, DocumentPermissionsTokenRequest, DocumentPermissionsTokenResponse, DocumentPreview, DocumentPreviewData, DocumentPreviewDataSubType, DocumentPurgedMetadata, DocumentResponse, DocumentResponseMetadata, DocumentResponseMetadataWithContent, DocumentStorageServiceApiVersion, DocumentSubType, DocumentSyncContentUpdatedMetadata, DocumentTeamShareResponse, DocumentTopicEvent, DocumentUpdatedMetadata, EditAnchorData, EditAnchorError, EditAnchorErrors, EditAnchorRequest, EditAnchorResponse, EditAnchorResponse2, EditAnchorResponses, EditCallRecordData, EditCallRecordError, EditCallRecordErrors, EditCallRecordRequest, EditCallRecordResponse, EditCallRecordResponses, EditCallTranscriptData, EditCallTranscriptError, EditCallTranscriptErrors, EditCallTranscriptRequest, EditCallTranscriptResponse, EditCallTranscriptResponses, EditCommentData, EditCommentError, EditCommentErrors, EditCommentRequest, EditCommentResponse, EditCommentResponse2, EditCommentResponses, EditCrmCommentData, EditCrmCommentError, EditCrmCommentErrors, EditCrmCommentRequest, EditCrmCommentResponse, EditCrmCommentResponses, EditDocumentData, EditDocumentError, EditDocumentErrors, EditDocumentResponse, EditDocumentResponse2, EditDocumentResponses, EditDocumentServiceArgs, EditPdfAnchorRequest, EditPdfPlaceableCommentAnchorRequest, EditProjectV2Data, EditProjectV2Error, EditProjectV2Errors, EditProjectV2Response, EditProjectV2Responses, EditThreadV2Data, EditThreadV2Error, EditThreadV2Errors, EditThreadV2Response, EditThreadV2Responses, EmailFilters, EmptyResponse, EntityFilters, EntityPermission, EntityPermissionResponse, EntityReference, EntityType, ErrorResponse, EventReminderOverride, EventReminders, EventStatus, EventTime, EventTransparency, EventVisibility, ExcludedDefaultView, ExcludeDefaultViewHandlerData, ExcludeDefaultViewHandlerError, ExcludeDefaultViewHandlerErrors, ExcludeDefaultViewHandlerResponses, ExcludeDefaultViewRequest, ExportDocumentData, ExportDocumentError, ExportDocumentErrors, ExportDocumentResponse, ExportDocumentResponse2, ExportDocumentResponses, Favorite, FavoriteEntityRef, FavoritesList, FileSystemNodeWithIds, FileType, FileTypeUpdate, FolderItem, ForeignEntity, ForeignEntityFilters, GenericErrorResponse, GenericResponse, GenericSuccessResponse, GetActivityData, GetActivityError, GetActivityErrors, GetActivityResponse, GetActivityResponses, GetAttachmentReferencesData, GetAttachmentReferencesError, GetAttachmentReferencesErrors, GetAttachmentReferencesResponse, GetAttachmentReferencesResponse2, GetAttachmentReferencesResponses, GetBatchCallRecordPreviewData, GetBatchCallRecordPreviewError, GetBatchCallRecordPreviewErrors, GetBatchCallRecordPreviewRequest, GetBatchCallRecordPreviewResponse, GetBatchCallRecordPreviewResponse2, GetBatchCallRecordPreviewResponses, GetBatchChannelPreviewData, GetBatchChannelPreviewError, GetBatchChannelPreviewErrors, GetBatchChannelPreviewRequest, GetBatchChannelPreviewResponse, GetBatchChannelPreviewResponse2, GetBatchChannelPreviewResponses, GetBatchPreviewHandlerData, GetBatchPreviewHandlerError, GetBatchPreviewHandlerErrors, GetBatchPreviewHandlerResponse, GetBatchPreviewHandlerResponses, GetBatchPreviewRequest, GetBatchPreviewResponse, GetBatchProjectPreviewData, GetBatchProjectPreviewError, GetBatchProjectPreviewErrors, GetBatchProjectPreviewRequest, GetBatchProjectPreviewResponse, GetBatchProjectPreviewResponse2, GetBatchProjectPreviewResponses, GetCallRecordData, GetCallRecordError, GetCallRecordErrors, GetCallRecordResponse, GetCallRecordResponses, GetChannelAttachmentsData, GetChannelAttachmentsError, GetChannelAttachmentsErrors, GetChannelAttachmentsResponse, GetChannelAttachmentsResponses, GetChannelData, GetChannelError, GetChannelErrors, GetChannelJoinLinkData, GetChannelJoinLinkError, GetChannelJoinLinkErrors, GetChannelJoinLinkResponse, GetChannelJoinLinkResponses, GetChannelMessagesData, GetChannelMessagesError, GetChannelMessagesErrors, GetChannelMessagesResponse, GetChannelMessagesResponses, GetChannelParticipantsData, GetChannelParticipantsError, GetChannelParticipantsErrors, GetChannelParticipantsResponse, GetChannelParticipantsResponses, GetChannelResponse, GetChannelResponses, GetChannelsData, GetChannelsError, GetChannelsErrors, GetChannelsResponse, GetChannelsResponses, GetCompanyData, GetCompanyError, GetCompanyErrors, GetCompanyResponse, GetCompanyResponses, GetContactData, GetContactError, GetContactErrors, GetContactResponse, GetContactResponses, GetCrmTeamSettingsData, GetCrmTeamSettingsError, GetCrmTeamSettingsErrors, GetCrmTeamSettingsResponse, GetCrmTeamSettingsResponses, GetDocumentAnchorsData, GetDocumentAnchorsError, GetDocumentAnchorsErrors, GetDocumentAnchorsResponse, GetDocumentAnchorsResponses, GetDocumentBranchNameData, GetDocumentBranchNameError, GetDocumentBranchNameErrors, GetDocumentBranchNameResponse, GetDocumentBranchNameResponses, GetDocumentByTeamSlugData, GetDocumentByTeamSlugError, GetDocumentByTeamSlugErrors, GetDocumentByTeamSlugResponse, GetDocumentByTeamSlugResponses, GetDocumentCommentsData, GetDocumentCommentsError, GetDocumentCommentsErrors, GetDocumentCommentsResponse, GetDocumentCommentsResponses, GetDocumentData, GetDocumentError, GetDocumentErrors, GetDocumentGithubPullRequestsData, GetDocumentGithubPullRequestsError, GetDocumentGithubPullRequestsErrors, GetDocumentGithubPullRequestsResponse, GetDocumentGithubPullRequestsResponses, GetDocumentKeyResponse, GetDocumentKeyResponseData, GetDocumentListHandlerData, GetDocumentListHandlerError, GetDocumentListHandlerErrors, GetDocumentListHandlerResponse, GetDocumentListHandlerResponses, GetDocumentListResult, GetDocumentLocationV3Data, GetDocumentLocationV3Error, GetDocumentLocationV3Errors, GetDocumentLocationV3Response, GetDocumentLocationV3Responses, GetDocumentPermissionsResponseDataV2, GetDocumentPermissionsTokenData, GetDocumentPermissionsTokenError, GetDocumentPermissionsTokenErrors, GetDocumentPermissionsTokenResponse, GetDocumentPermissionsTokenResponses, GetDocumentPermissionsV2Data, GetDocumentPermissionsV2Error, GetDocumentPermissionsV2Errors, GetDocumentPermissionsV2Response, GetDocumentPermissionsV2Responses, GetDocumentProcessingResult, GetDocumentProcessingResultData, GetDocumentProcessingResultError, GetDocumentProcessingResultErrors, GetDocumentProcessingResultResponse, GetDocumentProcessingResultResponse2, GetDocumentProcessingResultResponses, GetDocumentResponse, GetDocumentResponse2, GetDocumentResponseData, GetDocumentResponses, GetDocumentSearchResponse, GetDocumentShortIdData, GetDocumentShortIdError, GetDocumentShortIdErrors, GetDocumentShortIdResponse, GetDocumentShortIdResponses, GetDocumentsResponse, GetDocumentTeamShareData, GetDocumentTeamShareError, GetDocumentTeamShareErrors, GetDocumentTeamShareResponse, GetDocumentTeamShareResponses, GetDocumentUserAccessLevelResponse, GetDocumentVersionData, GetDocumentVersionError, GetDocumentVersionErrors, GetDocumentVersionResponse, GetDocumentVersionResponses, GetDocumentViewsHandlerData, GetDocumentViewsHandlerError, GetDocumentViewsHandlerErrors, GetDocumentViewsHandlerResponse, GetDocumentViewsHandlerResponses, GetEntityPermissionData, GetEntityPermissionErrors, GetEntityPermissionResponse, GetEntityPermissionResponses, GetForeignEntityData, GetForeignEntityError, GetForeignEntityErrors, GetForeignEntityResponse, GetForeignEntityResponses, GetHistoryHandlerData, GetHistoryHandlerError, GetHistoryHandlerErrors, GetHistoryHandlerResponse, GetHistoryHandlerResponses, GetInstructionsDocumentResponse, GetInstructionsHandlerData, GetInstructionsHandlerError, GetInstructionsHandlerErrors, GetInstructionsHandlerResponse, GetInstructionsHandlerResponses, GetItemsSoupData, GetItemsSoupError, GetItemsSoupErrors, GetItemsSoupResponse, GetItemsSoupResponses, GetLocationHandlerData, GetLocationHandlerError, GetLocationHandlerErrors, GetLocationHandlerResponse, GetLocationHandlerResponses, GetMessageWithContextData, GetMessageWithContextError, GetMessageWithContextErrors, GetMessageWithContextResponse, GetMessageWithContextResponse2, GetMessageWithContextResponses, GetOrCreateAction, GetOrCreateCallData, GetOrCreateCallError, GetOrCreateCallErrors, GetOrCreateCallResponse, GetOrCreateCallResponses, GetOrCreateChannelResponse, GetOrCreateDmData, GetOrCreateDmError, GetOrCreateDmErrors, GetOrCreateDmRequest, GetOrCreateDmResponse, GetOrCreateDmResponses, GetOrCreatePrivateData, GetOrCreatePrivateError, GetOrCreatePrivateErrors, GetOrCreatePrivateRequest, GetOrCreatePrivateResponse, GetOrCreatePrivateResponses, GetPendingProjectsHandlerData, GetPendingProjectsHandlerError, GetPendingProjectsHandlerErrors, GetPendingProjectsHandlerResponse, GetPendingProjectsHandlerResponses, GetPinsHandlerData, GetPinsHandlerError, GetPinsHandlerErrors, GetPinsHandlerResponse, GetPinsHandlerResponses, GetPinsResponse, GetProjectContentHandlerData, GetProjectContentHandlerError, GetProjectContentHandlerErrors, GetProjectContentHandlerResponse, GetProjectContentHandlerResponses, GetProjectContentResponse, GetProjectHandlerData, GetProjectHandlerError, GetProjectHandlerErrors, GetProjectHandlerResponse, GetProjectHandlerResponses, GetProjectPermissionsV2Data, GetProjectPermissionsV2Error, GetProjectPermissionsV2Errors, GetProjectPermissionsV2Response, GetProjectPermissionsV2Responses, GetProjectResponse, GetProjectResponseData, GetProjectsHandlerData, GetProjectsHandlerError, GetProjectsHandlerErrors, GetProjectsHandlerResponse, GetProjectsHandlerResponses, GetProjectsResponse, GetProjectUserAccessLevelData, GetProjectUserAccessLevelError, GetProjectUserAccessLevelErrors, GetProjectUserAccessLevelResponse, GetProjectUserAccessLevelResponses, GetReminderData, GetReminderError, GetReminderErrors, GetReminderResponse, GetReminderResponses, GetRingStatusData, GetRingStatusError, GetRingStatusErrors, GetRingStatusResponse, GetRingStatusResponses, GetSelfBotData, GetSelfBotError, GetSelfBotErrors, GetSelfBotResponse, GetSelfBotResponses, GetSystemSkillsHandlerData, GetSystemSkillsHandlerError, GetSystemSkillsHandlerErrors, GetSystemSkillsHandlerResponse, GetSystemSkillsHandlerResponses, GetThreadRepliesData, GetThreadRepliesError, GetThreadRepliesErrors, GetThreadRepliesResponse, GetThreadRepliesResponses, GetUserDocumentsHandlerData, GetUserDocumentsHandlerError, GetUserDocumentsHandlerErrors, GetUserDocumentsHandlerResponse, GetUserDocumentsHandlerResponses, GetUserDocumentViewLocationData, GetUserDocumentViewLocationError, GetUserDocumentViewLocationErrors, GetUserDocumentViewLocationResponse, GetUserDocumentViewLocationResponses, GetUserHistoryResponse, GetViewsHandlerData, GetViewsHandlerError, GetViewsHandlerErrors, GetViewsHandlerResponse, GetViewsHandlerResponses, GetWebhookData, GetWebhookError, GetWebhookErrors, GetWebhookResponse, GetWebhookResponses, GithubPullRequest, GithubPullRequestCheckRun, GithubPullRequestComment, GithubPullRequestsResponse, GroupedInitialParams, GroupedPageParams, GroupedSoupGroupPage, GroupedSoupInitialPage, GroupedSoupPage, GroupedSoupSort, HandlerData, HandlerError, HandlerErrors, HandlerResponse, HandlerResponses, HashMap, HealthHandlerData, HealthHandlerResponse, HealthHandlerResponses, HighlightType, IngestTranscriptData, IngestTranscriptError, IngestTranscriptErrors, IngestTranscriptResponses, InitializeUserDocumentsData, InitializeUserDocumentsError, InitializeUserDocumentsErrors, InitializeUserDocumentsResponse, InitializeUserDocumentsResponses, InstallSyncData, InstallSyncErrors, InteractionReason, Item, ItemWithUserAccessLevel, JobProcessingResultHandlerData, JobProcessingResultHandlerError, JobProcessingResultHandlerErrors, JobProcessingResultHandlerResponse, JobProcessingResultHandlerResponses, JoinChannelByCodeData, JoinChannelByCodeError, JoinChannelByCodeErrors, JoinChannelByCodeResponses, JoinChannelData, JoinChannelError, JoinChannelErrors, JoinChannelResponses, LatestMessage, LeaveCallResponse, LeaveChannelData, LeaveChannelError, LeaveChannelErrors, LeaveChannelResponses, LeaveOrEndCallData, LeaveOrEndCallError, LeaveOrEndCallErrors, LeaveOrEndCallResponse, LeaveOrEndCallResponses, LinkShare, ListBotChannelsData, ListBotChannelsError, ListBotChannelsErrors, ListBotChannelsResponse, ListBotChannelsResponses, ListCompanyContactsData, ListCompanyContactsError, ListCompanyContactsErrors, ListCompanyContactsResponse, ListCompanyContactsResponses, ListCrmCommentsData, ListCrmCommentsError, ListCrmCommentsErrors, ListCrmCommentsResponse, ListCrmCommentsResponses, ListFavoritesData, ListFavoritesError, ListFavoritesErrors, ListFavoritesResponse, ListFavoritesResponses, ListOccurrencesData, ListOccurrencesErrors, ListOccurrencesResponse, ListOccurrencesResponses, ListRemindersData, ListRemindersError, ListRemindersErrors, ListRemindersResponse, ListRemindersResponses, ListWebhooksData, ListWebhooksError, ListWebhooksErrors, ListWebhooksResponse, ListWebhooksResponse2, ListWebhooksResponses, LocationResponseData, LocationResponseV3, MacroUserIdStr, Mentions, NewChannelAttachment, NotificationFilters, Params, ParticipantRole, PatchChannelData, PatchChannelError, PatchChannelErrors, PatchChannelRequest, PatchChannelResponse, PatchChannelResponses, PatchMessageData, PatchMessageError, PatchMessageErrors, PatchMessageRequest, PatchMessageResponse, PatchMessageResponses, PatchProjectRequestV2, PatchThreadRequestV2, PatchViewHandlerData, PatchViewHandlerError, PatchViewHandlerErrors, PatchViewHandlerResponses, PatchWebhookData, PatchWebhookError, PatchWebhookErrors, PatchWebhookRequest, PatchWebhookResponse, PatchWebhookResponses, PdfAnchor, PdfAnchorId, PdfAnchorRequest, PdfHighlightAnchor, PdfHighlightAnchorRequest, PdfHighlightRect, PdfHighlightRectAnchorRequest, PdfPlaceableCommentAnchor, PdfPlaceableCommentAnchorRequest, PermanentlyDeleteDocumentData, PermanentlyDeleteDocumentError, PermanentlyDeleteDocumentErrors, PermanentlyDeleteDocumentResponse, PermanentlyDeleteDocumentResponses, PermanentlyDeleteProjectData, PermanentlyDeleteProjectError, PermanentlyDeleteProjectErrors, PermanentlyDeleteProjectResponse, PermanentlyDeleteProjectResponses, PinnedItem, PinRequest, PostActivityData, PostActivityError, PostActivityErrors, PostActivityRequest, PostActivityResponse, PostActivityResponses, PostChannelBotWebhookData, PostChannelBotWebhookError, PostChannelBotWebhookErrors, PostChannelBotWebhookResponse, PostChannelBotWebhookResponses, PostChannelMessagesData, PostChannelMessagesError, PostChannelMessagesErrors, PostChannelMessagesResponse, PostChannelMessagesResponses, PostGroupedSoupAstGroupPageRequest, PostGroupedSoupAstInitialRequest, PostGroupedSoupAstRequest, PostItemsSoupAstData, PostItemsSoupAstError, PostItemsSoupAstErrors, PostItemsSoupAstGroupedData, PostItemsSoupAstGroupedError, PostItemsSoupAstGroupedErrors, PostItemsSoupAstGroupedResponse, PostItemsSoupAstGroupedResponses, PostItemsSoupAstResponse, PostItemsSoupAstResponses, PostItemsSoupData, PostItemsSoupError, PostItemsSoupErrors, PostItemsSoupResponse, PostItemsSoupResponses, PostMessageData, PostMessageError, PostMessageErrors, PostMessageRequest, PostMessageResponse, PostMessageResponse2, PostMessageResponses, PostReactionData, PostReactionError, PostReactionErrors, PostReactionRequest, PostReactionResponse, PostReactionResponses, PostSoupAstRequest, PostSoupRequest, PostTypingData, PostTypingError, PostTypingErrors, PostTypingRequest, PostTypingResponse, PostTypingResponses, PresaveDocumentHandlerData, PresaveDocumentHandlerError, PresaveDocumentHandlerErrors, PresaveDocumentHandlerResponse, PresaveDocumentHandlerResponses, PreSaveDocumentRequest, PreSaveDocumentResponse, PreSaveDocumentResponseData, PresignedUrl, Project, ProjectDeleteResponseData, ProjectDocumentStatus, ProjectFilters, ProjectPreview, ProjectPreviewData, PropertyDefinition, PropertyFilter, PropertyInput, PropertyOwner, PropertyValue, PutCrmTeamSettingsData, PutCrmTeamSettingsError, PutCrmTeamSettingsErrors, PutCrmTeamSettingsResponse, PutCrmTeamSettingsResponses, ReactionAction, RecentlyDeletedData, RecentlyDeletedError, RecentlyDeletedErrors, RecentlyDeletedResponse, RecentlyDeletedResponseData, RecentlyDeletedResponses, Reminder, ReminderFilters, ReminderSchedule, RemindersList, RemoveBotFromChannelByBotData, RemoveBotFromChannelByBotError, RemoveBotFromChannelByBotErrors, RemoveBotFromChannelByBotResponse, RemoveBotFromChannelByBotResponses, RemoveFavoriteByEntityData, RemoveFavoriteByEntityError, RemoveFavoriteByEntityErrors, RemoveFavoriteByEntityResponses, RemoveParticipantsData, RemoveParticipantsError, RemoveParticipantsErrors, RemoveParticipantsRequest, RemoveParticipantsResponses, RemovePinHandlerData, RemovePinHandlerError, RemovePinHandlerErrors, RemovePinHandlerResponse, RemovePinHandlerResponses, ReorderFavoritesData, ReorderFavoritesError, ReorderFavoritesErrors, ReorderFavoritesRequest, ReorderFavoritesResponses, ReorderPinRequest, ReorderPinsHandlerData, ReorderPinsHandlerError, ReorderPinsHandlerErrors, ReorderPinsHandlerResponse, ReorderPinsHandlerResponses, ResolveChannelMessageData, ResolveChannelMessageError, ResolveChannelMessageErrors, ResolveChannelMessageResponse, ResolveChannelMessageResponses, RevertDeleteDocumentData, RevertDeleteDocumentError, RevertDeleteDocumentErrors, RevertDeleteDocumentResponse, RevertDeleteDocumentResponses, RevertDeleteProjectData, RevertDeleteProjectError, RevertDeleteProjectErrors, RevertDeleteProjectResponse, RevertDeleteProjectResponses, RingStatus, RingStatusResponse, S3ObjectInfo, SaveBomPart, SaveDocumentHandlerData, SaveDocumentHandlerError, SaveDocumentHandlerErrors, SaveDocumentHandlerResponse, SaveDocumentHandlerResponses, SaveDocumentRequest, SaveDocumentResponse, SaveDocumentResponseData, SetCompanyHiddenData, SetCompanyHiddenError, SetCompanyHiddenErrors, SetCompanyHiddenRequest, SetCompanyHiddenResponse, SetCompanyHiddenResponses, SetCompanyNameRequest, SetContactHiddenData, SetContactHiddenError, SetContactHiddenErrors, SetContactHiddenRequest, SetContactHiddenResponse, SetContactHiddenResponses, SetContactNameRequest, SetCrmCompanyNameData, SetCrmCompanyNameError, SetCrmCompanyNameErrors, SetCrmCompanyNameResponse, SetCrmCompanyNameResponses, SetCrmContactNameData, SetCrmContactNameError, SetCrmContactNameErrors, SetCrmContactNameResponse, SetCrmContactNameResponses, SetDocumentTeamShareData, SetDocumentTeamShareError, SetDocumentTeamShareErrors, SetDocumentTeamShareRequest, SetDocumentTeamShareResponse, SetDocumentTeamShareResponses, SetEmailSyncData, SetEmailSyncError, SetEmailSyncErrors, SetEmailSyncRequest, SetEmailSyncResponse, SetEmailSyncResponses, SetPropertyValue, SharedEmailFilter, SharePermissionV2, ShortIdResponse, SimpleMention, SimpleSaveData, SimpleSaveError, SimpleSaveErrors, SimpleSaveResponse, SimpleSaveResponses, SoupApiItem, SoupApiSort, SoupApiSortDirection, SoupAttachment, SoupCalendarEventSoupPropertiesField, SoupCalendarEventTime, SoupCallRecordParticipant, SoupCallRecordSoupPropertiesField, SoupChannel, SoupChannelThread, SoupChatSoupPropertiesField, SoupContact, SoupCountedReaction, SoupCrmCompanySoupPropertiesField, SoupCrmDomain, SoupDocumentSoupPropertiesField, SoupDocumentSubType, SoupEmailThreadPreview, SoupEnrichedEmailThreadPreviewSoupPropertiesField, SoupForeignEntity, SoupItem, SoupLabel, SoupLabelListVisibility, SoupLabelType, SoupMessageAttachment, SoupMessageListVisibility, SoupMessageSender, SoupMessageSenderType, SoupPage, SoupProjectSoupPropertiesField, SoupPropertiesField, SoupProperty, SoupReminderReference, SoupReminderSchedule, SoupReminderSoupPropertiesField, SoupThreadInfo, SoupThreadReply, StarterDocumentsResponse, String, SuccessResponse, SyncServiceVersionId, SystemSkillSummary, TagFilterMode, TaskFilters, TeamRole, Thread, ThreadResponse, ToggleShareWithTeamData, ToggleShareWithTeamError, ToggleShareWithTeamErrors, ToggleShareWithTeamResponse, ToggleShareWithTeamResponses, TranscriptSegmentRequest, TypedSuccessResponse, TypedSuccessResponseGetDocumentResponseData, TypingAction, UnthreadedPdfUuidRequest, UpdateChannelSharePermission, UpdateCrmTeamSettingsRequest, UpdateOperation, UpdateReminderData, UpdateReminderError, UpdateReminderErrors, UpdateReminderRequest, UpdateReminderResponse, UpdateReminderResponses, UpdateSharePermissionRequestV2, UploadDocumentStatus, UploadExtractFolderHandlerData, UploadExtractFolderHandlerError, UploadExtractFolderHandlerErrors, UploadExtractFolderHandlerResponse, UploadExtractFolderHandlerResponses, UploadExtractFolderRequest, UploadFolderHandlerData, UploadFolderHandlerError, UploadFolderHandlerErrors, UploadFolderHandlerResponse, UploadFolderHandlerResponses, UploadFolderRequest, UpsertHistoryHandlerData, UpsertHistoryHandlerError, UpsertHistoryHandlerErrors, UpsertHistoryHandlerResponse, UpsertHistoryHandlerResponses, UpsertUserDocumentViewLocationData, UpsertUserDocumentViewLocationError, UpsertUserDocumentViewLocationErrors, UpsertUserDocumentViewLocationRequest, UpsertUserDocumentViewLocationResponse, UpsertUserDocumentViewLocationResponses, UserDocumentsResponse, UserDocumentViewLocation, UserDocumentViewLocationResponse, UserPinsResponse, UserViewsResponse, ValidateDocumentPermissionsTokenData, ValidateDocumentPermissionsTokenError, ValidateDocumentPermissionsTokenErrors, ValidateDocumentPermissionsTokenResponse, ValidateDocumentPermissionsTokenResponses, ValidateWebhookData, ValidateWebhookError, ValidateWebhookErrors, ValidateWebhookResponse, ValidateWebhookResponse2, ValidateWebhookResponses, Vec, View, ViewPatch, ViewsResponse, Webhook, WebhookEvent, WebhookFilter, WebhookScope, WebhookStatus, WebhookValidationTestEvent, WithCallId, WithChannelId, WithDocumentId, WithProjectId } from './types.gen';
+export type { AccessLevel, ActivityType, AddFavoriteData, AddFavoriteError, AddFavoriteErrors, AddFavoriteRequest, AddFavoriteResponse, AddFavoriteResponses, AddParticipantsData, AddParticipantsError, AddParticipantsErrors, AddParticipantsRequest, AddParticipantsResponses, AddPinHandlerData, AddPinHandlerError, AddPinHandlerErrors, AddPinHandlerResponse, AddPinHandlerResponses, AddPinRequest, Anchor, AnchorId, AnchorRequest, AnchorResponse, AnnotationIncrementalUpdate, ApiActivity, ApiAttachmentChannelReference, ApiAttachmentEntityReference, ApiAttachmentGenericReference, ApiChannelAttachment, ApiChannelAttachmentsPage, ApiChannelContextMessage, ApiChannelDetail, ApiChannelListMessage, ApiChannelListPage, ApiChannelListParticipant, ApiChannelListType, ApiChannelMessage, ApiChannelMessageKind, ApiChannelMessagesPage, ApiChannelParticipant, ApiChannelWithLatest, ApiCountedReaction, ApiEntityFilterAst, ApiGroupByField, ApiGroupMeta, ApiMessageAttachment, ApiMessageSender, ApiMessageSenderType, ApiParticipantListRole, ApiParticipantRole, ApiPropertyEntityType, ApiResolvedChannelMessage, ApiThreadInfo, ApiThreadReply, AttendeeResponseStatus, BasicDocument, BasicDocumentSubType, BomPart, Bot, BotChannel, BotChannelType, BotId, BotKind, BotOwner, BotToken, BranchNameResponse, BTreeMap, BulkWakeupRequest, BulkWakeupResponse, BulkWakeupSyncServiceDocumentsData, BulkWakeupSyncServiceDocumentsErrors, BulkWakeupSyncServiceDocumentsResponse, BulkWakeupSyncServiceDocumentsResponses, CalendarAttendee, CalendarEvent, CalendarEventFilters, CalendarMentionEvent, CalendarMentionPreviewItem, CalendarMentionPreviewKind, CalendarMentionPreviewRequest, CalendarMentionPreviewRequestItem, CalendarMentionPreviewResponse, CalendarOccurrence, CalendarOccurrenceItem, CalendarOccurrenceResponse, CalendarSyncStatus, CallActiveResponse, CallFilters, CallRecord, CallRecordParticipant, CallRecordPreview, CallRecordPreviewData, CallRecordTranscriptSegment, CallStatus, CallTokenResponse, CallWebhookData, CallWebhookError, CallWebhookErrors, CallWebhookResponses, Channel, ChannelCreatedMetadata, ChannelDeletedMetadata, ChannelEventAttachment, ChannelFilters, ChannelJoinCodeResponse, ChannelMentionedMetadata, ChannelMessage, ChannelMessageAttachmentCreatedMetadata, ChannelMessageAttachmentRemovedMetadata, ChannelMessageDeletedMetadata, ChannelMessageFilters, ChannelMessagePatchedMetadata, ChannelMessagePostedMetadata, ChannelParticipant, ChannelParticipantAddedMetadata, ChannelParticipantRemovedMetadata, ChannelPreview, ChannelPreviewData, ChannelSender, ChannelSharePermission, ChannelThreadFilters, ChannelTopicEvent, ChannelType, ChannelUpdatedMetadata, ChannelWebhookRequest, ChannelWebhookResponse, ChannelWithParticipants, Chat, ChatFilters, CheckActiveCallData, CheckActiveCallError, CheckActiveCallErrors, CheckActiveCallResponse, CheckActiveCallResponses, ClientOptions, CloudStorageItemType, Comment, CommentThread, ConferenceProvider, CopyDocumentData, CopyDocumentError, CopyDocumentErrors, CopyDocumentQueryParams, CopyDocumentRequest, CopyDocumentResponse, CopyDocumentResponse2, CopyDocumentResponses, CreateAnchorData, CreateAnchorError, CreateAnchorErrors, CreateAnchorResponse, CreateAnchorResponses, CreateBulkDocumentResponse, CreateBulkDocumentResponseData, CreateChannelData, CreateChannelError, CreateChannelErrors, CreateChannelRequest, CreateChannelResponse, CreateChannelResponse2, CreateChannelResponses, CreateChannelScopedBotData, CreateChannelScopedBotError, CreateChannelScopedBotErrors, CreateChannelScopedBotRequest, CreateChannelScopedBotResponse, CreateChannelScopedBotResponse2, CreateChannelScopedBotResponses, CreateCommentData, CreateCommentError, CreateCommentErrors, CreateCommentRequest, CreateCommentResponse, CreateCommentResponse2, CreateCommentResponses, CreateCrmCommentData, CreateCrmCommentError, CreateCrmCommentErrors, CreateCrmCommentRequest, CreateCrmCommentResponse, CreateCrmCommentResponses, CreateCrmCompanyData, CreateCrmCompanyError, CreateCrmCompanyErrors, CreateCrmCompanyRequest, CreateCrmCompanyResponse, CreateCrmCompanyResponses, CreateCrmContactData, CreateCrmContactError, CreateCrmContactErrors, CreateCrmContactRequest, CreateCrmContactResponse, CreateCrmContactResponses, CreateDocumentData, CreateDocumentError, CreateDocumentErrors, CreateDocumentRequest, CreateDocumentResponse, CreateDocumentResponseData, CreateDocumentResponses, CreateEntityMentionData, CreateEntityMentionError, CreateEntityMentionErrors, CreateEntityMentionRequest, CreateEntityMentionResponse, CreateEntityMentionResponse2, CreateEntityMentionResponses, CreateInstructionsDocumentResponse, CreateInstructionsHandlerData, CreateInstructionsHandlerError, CreateInstructionsHandlerErrors, CreateInstructionsHandlerResponse, CreateInstructionsHandlerResponses, CreateMarkdownDocumentRequest, CreateMarkdownDocumentResponse, CreateMarkdownHandlerData, CreateMarkdownHandlerError, CreateMarkdownHandlerErrors, CreateMarkdownHandlerResponse, CreateMarkdownHandlerResponses, CreateProjectHandlerData, CreateProjectHandlerError, CreateProjectHandlerErrors, CreateProjectHandlerResponse, CreateProjectHandlerResponses, CreateProjectRequest, CreateProjectResponse, CreateReminderData, CreateReminderError, CreateReminderErrors, CreateReminderRequest, CreateReminderResponse, CreateReminderResponses, CreateSkillHandlerData, CreateSkillHandlerError, CreateSkillHandlerErrors, CreateSkillHandlerResponse, CreateSkillHandlerResponses, CreateSkillRequest, CreateSkillResponse, CreateSnippetHandlerData, CreateSnippetHandlerError, CreateSnippetHandlerErrors, CreateSnippetHandlerResponse, CreateSnippetHandlerResponses, CreateSnippetRequest, CreateSnippetResponse, CreateTaskHandlerData, CreateTaskHandlerError, CreateTaskHandlerErrors, CreateTaskHandlerResponse, CreateTaskHandlerResponses, CreateTaskRequest, CreateTaskResponse, CreateUnthreadedAnchorRequest, CreateUnthreadedAnchorResponse, CreateUnthreadedPdfAnchorRequest, CreateViewHandlerData, CreateViewHandlerError, CreateViewHandlerErrors, CreateViewHandlerResponse, CreateViewHandlerResponses, CreateViewRequest, CreateWebhookData, CreateWebhookError, CreateWebhookErrors, CreateWebhookRequest, CreateWebhookResponse, CreateWebhookResponse2, CreateWebhookResponses, CrmComment, CrmCommentEntityType, CrmCommentThread, CrmCompanyFilters, CrmCompanyResponse, CrmContactResponse, CrmDomainResponse, CrmPermissionRole, CrmTeamSettingsResponse, CrmThread, CustomSpeakerAssignment, DataType, DeleteAnchorData, DeleteAnchorError, DeleteAnchorErrors, DeleteAnchorInfo, DeleteAnchorResponse, DeleteAnchorResponses, DeleteCallRecordData, DeleteCallRecordError, DeleteCallRecordErrors, DeleteCallRecordResponse, DeleteCallRecordResponses, DeleteChannelData, DeleteChannelError, DeleteChannelErrors, DeleteChannelResponse, DeleteChannelResponses, DeleteCommentData, DeleteCommentError, DeleteCommentErrors, DeleteCommentRequest, DeleteCommentResponse, DeleteCommentResponse2, DeleteCommentResponses, DeleteCrmCommentData, DeleteCrmCommentError, DeleteCrmCommentErrors, DeleteCrmCommentResponse, DeleteCrmCommentResponses, DeleteCrmCommentResult, DeleteDocumentData, DeleteDocumentError, DeleteDocumentErrors, DeleteDocumentResponse, DeleteDocumentResponses, DeleteEntityMentionData, DeleteEntityMentionError, DeleteEntityMentionErrors, DeleteEntityMentionResponse, DeleteEntityMentionResponse2, DeleteEntityMentionResponses, DeleteHistoryHandlerData, DeleteHistoryHandlerError, DeleteHistoryHandlerErrors, DeleteHistoryHandlerResponse, DeleteHistoryHandlerResponses, DeleteMessageData, DeleteMessageError, DeleteMessageErrors, DeleteMessageQuery, DeleteMessageResponse, DeleteMessageResponses, DeleteProjectHandlerData, DeleteProjectHandlerError, DeleteProjectHandlerErrors, DeleteProjectHandlerResponse, DeleteProjectHandlerResponses, DeleteReminderData, DeleteReminderError, DeleteReminderErrors, DeleteReminderResponse, DeleteReminderResponses, DeleteThreadInfo, DeleteUnthreadedAnchorRequest, DeleteUnthreadedAnchorResponse, DeleteUnthreadedPdfAnchorRequest, DeleteUserDocumentViewLocationData, DeleteUserDocumentViewLocationError, DeleteUserDocumentViewLocationErrors, DeleteUserDocumentViewLocationResponse, DeleteUserDocumentViewLocationResponses, DeleteViewHandlerData, DeleteViewHandlerError, DeleteViewHandlerErrors, DeleteViewHandlerResponses, DeleteWebhookData, DeleteWebhookError, DeleteWebhookErrors, DeleteWebhookResponse, DeleteWebhookResponses, DocumentBasic, DocumentContent, DocumentContentLocation, DocumentContentState, DocumentContentUploadedMetadata, DocumentCopiedMetadata, DocumentCreatedMetadata, DocumentDeletedMetadata, DocumentFilters, DocumentInteractionMetadata, DocumentMetadata, DocumentMetadataWithContent, DocumentPermissionsToken, DocumentPermissionsTokenRequest, DocumentPermissionsTokenResponse, DocumentPreview, DocumentPreviewData, DocumentPreviewDataSubType, DocumentPurgedMetadata, DocumentResponse, DocumentResponseMetadata, DocumentResponseMetadataWithContent, DocumentStorageServiceApiVersion, DocumentSubType, DocumentSyncContentUpdatedMetadata, DocumentTeamShareResponse, DocumentTopicEvent, DocumentUpdatedMetadata, EditAnchorData, EditAnchorError, EditAnchorErrors, EditAnchorRequest, EditAnchorResponse, EditAnchorResponse2, EditAnchorResponses, EditCallRecordData, EditCallRecordError, EditCallRecordErrors, EditCallRecordRequest, EditCallRecordResponse, EditCallRecordResponses, EditCallTranscriptData, EditCallTranscriptError, EditCallTranscriptErrors, EditCallTranscriptRequest, EditCallTranscriptResponse, EditCallTranscriptResponses, EditCommentData, EditCommentError, EditCommentErrors, EditCommentRequest, EditCommentResponse, EditCommentResponse2, EditCommentResponses, EditCrmCommentData, EditCrmCommentError, EditCrmCommentErrors, EditCrmCommentRequest, EditCrmCommentResponse, EditCrmCommentResponses, EditDocumentData, EditDocumentError, EditDocumentErrors, EditDocumentResponse, EditDocumentResponse2, EditDocumentResponses, EditDocumentServiceArgs, EditPdfAnchorRequest, EditPdfPlaceableCommentAnchorRequest, EditProjectV2Data, EditProjectV2Error, EditProjectV2Errors, EditProjectV2Response, EditProjectV2Responses, EditThreadV2Data, EditThreadV2Error, EditThreadV2Errors, EditThreadV2Response, EditThreadV2Responses, EmailFilters, EmptyResponse, EntityFilters, EntityPermission, EntityPermissionResponse, EntityReference, EntityType, ErrorResponse, EventReminderOverride, EventReminders, EventStatus, EventTime, EventTransparency, EventVisibility, ExcludedDefaultView, ExcludeDefaultViewHandlerData, ExcludeDefaultViewHandlerError, ExcludeDefaultViewHandlerErrors, ExcludeDefaultViewHandlerResponses, ExcludeDefaultViewRequest, ExportDocumentData, ExportDocumentError, ExportDocumentErrors, ExportDocumentResponse, ExportDocumentResponse2, ExportDocumentResponses, Favorite, FavoriteEntityRef, FavoritesList, FileSystemNodeWithIds, FileType, FileTypeUpdate, FolderItem, ForeignEntity, ForeignEntityFilters, GenericErrorResponse, GenericResponse, GenericSuccessResponse, GetActivityData, GetActivityError, GetActivityErrors, GetActivityResponse, GetActivityResponses, GetAttachmentReferencesData, GetAttachmentReferencesError, GetAttachmentReferencesErrors, GetAttachmentReferencesResponse, GetAttachmentReferencesResponse2, GetAttachmentReferencesResponses, GetBatchCallRecordPreviewData, GetBatchCallRecordPreviewError, GetBatchCallRecordPreviewErrors, GetBatchCallRecordPreviewRequest, GetBatchCallRecordPreviewResponse, GetBatchCallRecordPreviewResponse2, GetBatchCallRecordPreviewResponses, GetBatchChannelPreviewData, GetBatchChannelPreviewError, GetBatchChannelPreviewErrors, GetBatchChannelPreviewRequest, GetBatchChannelPreviewResponse, GetBatchChannelPreviewResponse2, GetBatchChannelPreviewResponses, GetBatchPreviewHandlerData, GetBatchPreviewHandlerError, GetBatchPreviewHandlerErrors, GetBatchPreviewHandlerResponse, GetBatchPreviewHandlerResponses, GetBatchPreviewRequest, GetBatchPreviewResponse, GetBatchProjectPreviewData, GetBatchProjectPreviewError, GetBatchProjectPreviewErrors, GetBatchProjectPreviewRequest, GetBatchProjectPreviewResponse, GetBatchProjectPreviewResponse2, GetBatchProjectPreviewResponses, GetCallRecordData, GetCallRecordError, GetCallRecordErrors, GetCallRecordResponse, GetCallRecordResponses, GetChannelAttachmentsData, GetChannelAttachmentsError, GetChannelAttachmentsErrors, GetChannelAttachmentsResponse, GetChannelAttachmentsResponses, GetChannelData, GetChannelError, GetChannelErrors, GetChannelJoinLinkData, GetChannelJoinLinkError, GetChannelJoinLinkErrors, GetChannelJoinLinkResponse, GetChannelJoinLinkResponses, GetChannelMessagesData, GetChannelMessagesError, GetChannelMessagesErrors, GetChannelMessagesResponse, GetChannelMessagesResponses, GetChannelParticipantsData, GetChannelParticipantsError, GetChannelParticipantsErrors, GetChannelParticipantsResponse, GetChannelParticipantsResponses, GetChannelResponse, GetChannelResponses, GetChannelsData, GetChannelsError, GetChannelsErrors, GetChannelsResponse, GetChannelsResponses, GetCompanyData, GetCompanyError, GetCompanyErrors, GetCompanyResponse, GetCompanyResponses, GetContactData, GetContactError, GetContactErrors, GetContactResponse, GetContactResponses, GetCrmTeamSettingsData, GetCrmTeamSettingsError, GetCrmTeamSettingsErrors, GetCrmTeamSettingsResponse, GetCrmTeamSettingsResponses, GetDocumentAnchorsData, GetDocumentAnchorsError, GetDocumentAnchorsErrors, GetDocumentAnchorsResponse, GetDocumentAnchorsResponses, GetDocumentBranchNameData, GetDocumentBranchNameError, GetDocumentBranchNameErrors, GetDocumentBranchNameResponse, GetDocumentBranchNameResponses, GetDocumentByTeamSlugData, GetDocumentByTeamSlugError, GetDocumentByTeamSlugErrors, GetDocumentByTeamSlugResponse, GetDocumentByTeamSlugResponses, GetDocumentCommentsData, GetDocumentCommentsError, GetDocumentCommentsErrors, GetDocumentCommentsResponse, GetDocumentCommentsResponses, GetDocumentData, GetDocumentError, GetDocumentErrors, GetDocumentGithubPullRequestsData, GetDocumentGithubPullRequestsError, GetDocumentGithubPullRequestsErrors, GetDocumentGithubPullRequestsResponse, GetDocumentGithubPullRequestsResponses, GetDocumentKeyResponse, GetDocumentKeyResponseData, GetDocumentListHandlerData, GetDocumentListHandlerError, GetDocumentListHandlerErrors, GetDocumentListHandlerResponse, GetDocumentListHandlerResponses, GetDocumentListResult, GetDocumentLocationV3Data, GetDocumentLocationV3Error, GetDocumentLocationV3Errors, GetDocumentLocationV3Response, GetDocumentLocationV3Responses, GetDocumentPermissionsResponseDataV2, GetDocumentPermissionsTokenData, GetDocumentPermissionsTokenError, GetDocumentPermissionsTokenErrors, GetDocumentPermissionsTokenResponse, GetDocumentPermissionsTokenResponses, GetDocumentPermissionsV2Data, GetDocumentPermissionsV2Error, GetDocumentPermissionsV2Errors, GetDocumentPermissionsV2Response, GetDocumentPermissionsV2Responses, GetDocumentProcessingResult, GetDocumentProcessingResultData, GetDocumentProcessingResultError, GetDocumentProcessingResultErrors, GetDocumentProcessingResultResponse, GetDocumentProcessingResultResponse2, GetDocumentProcessingResultResponses, GetDocumentResponse, GetDocumentResponse2, GetDocumentResponseData, GetDocumentResponses, GetDocumentSearchResponse, GetDocumentShortIdData, GetDocumentShortIdError, GetDocumentShortIdErrors, GetDocumentShortIdResponse, GetDocumentShortIdResponses, GetDocumentsResponse, GetDocumentTeamShareData, GetDocumentTeamShareError, GetDocumentTeamShareErrors, GetDocumentTeamShareResponse, GetDocumentTeamShareResponses, GetDocumentUserAccessLevelResponse, GetDocumentVersionData, GetDocumentVersionError, GetDocumentVersionErrors, GetDocumentVersionResponse, GetDocumentVersionResponses, GetDocumentViewsHandlerData, GetDocumentViewsHandlerError, GetDocumentViewsHandlerErrors, GetDocumentViewsHandlerResponse, GetDocumentViewsHandlerResponses, GetEntityPermissionData, GetEntityPermissionErrors, GetEntityPermissionResponse, GetEntityPermissionResponses, GetForeignEntityData, GetForeignEntityError, GetForeignEntityErrors, GetForeignEntityResponse, GetForeignEntityResponses, GetHistoryHandlerData, GetHistoryHandlerError, GetHistoryHandlerErrors, GetHistoryHandlerResponse, GetHistoryHandlerResponses, GetInstructionsDocumentResponse, GetInstructionsHandlerData, GetInstructionsHandlerError, GetInstructionsHandlerErrors, GetInstructionsHandlerResponse, GetInstructionsHandlerResponses, GetItemsSoupData, GetItemsSoupError, GetItemsSoupErrors, GetItemsSoupResponse, GetItemsSoupResponses, GetLocationHandlerData, GetLocationHandlerError, GetLocationHandlerErrors, GetLocationHandlerResponse, GetLocationHandlerResponses, GetMessageWithContextData, GetMessageWithContextError, GetMessageWithContextErrors, GetMessageWithContextResponse, GetMessageWithContextResponse2, GetMessageWithContextResponses, GetOrCreateAction, GetOrCreateCallData, GetOrCreateCallError, GetOrCreateCallErrors, GetOrCreateCallResponse, GetOrCreateCallResponses, GetOrCreateChannelResponse, GetOrCreateDmData, GetOrCreateDmError, GetOrCreateDmErrors, GetOrCreateDmRequest, GetOrCreateDmResponse, GetOrCreateDmResponses, GetOrCreatePrivateData, GetOrCreatePrivateError, GetOrCreatePrivateErrors, GetOrCreatePrivateRequest, GetOrCreatePrivateResponse, GetOrCreatePrivateResponses, GetPendingProjectsHandlerData, GetPendingProjectsHandlerError, GetPendingProjectsHandlerErrors, GetPendingProjectsHandlerResponse, GetPendingProjectsHandlerResponses, GetPinsHandlerData, GetPinsHandlerError, GetPinsHandlerErrors, GetPinsHandlerResponse, GetPinsHandlerResponses, GetPinsResponse, GetProjectContentHandlerData, GetProjectContentHandlerError, GetProjectContentHandlerErrors, GetProjectContentHandlerResponse, GetProjectContentHandlerResponses, GetProjectContentResponse, GetProjectHandlerData, GetProjectHandlerError, GetProjectHandlerErrors, GetProjectHandlerResponse, GetProjectHandlerResponses, GetProjectPermissionsV2Data, GetProjectPermissionsV2Error, GetProjectPermissionsV2Errors, GetProjectPermissionsV2Response, GetProjectPermissionsV2Responses, GetProjectResponse, GetProjectResponseData, GetProjectsHandlerData, GetProjectsHandlerError, GetProjectsHandlerErrors, GetProjectsHandlerResponse, GetProjectsHandlerResponses, GetProjectsResponse, GetProjectUserAccessLevelData, GetProjectUserAccessLevelError, GetProjectUserAccessLevelErrors, GetProjectUserAccessLevelResponse, GetProjectUserAccessLevelResponses, GetReminderData, GetReminderError, GetReminderErrors, GetReminderResponse, GetReminderResponses, GetRingStatusData, GetRingStatusError, GetRingStatusErrors, GetRingStatusResponse, GetRingStatusResponses, GetSelfBotData, GetSelfBotError, GetSelfBotErrors, GetSelfBotResponse, GetSelfBotResponses, GetSystemSkillsHandlerData, GetSystemSkillsHandlerError, GetSystemSkillsHandlerErrors, GetSystemSkillsHandlerResponse, GetSystemSkillsHandlerResponses, GetThreadRepliesData, GetThreadRepliesError, GetThreadRepliesErrors, GetThreadRepliesResponse, GetThreadRepliesResponses, GetUserDocumentsHandlerData, GetUserDocumentsHandlerError, GetUserDocumentsHandlerErrors, GetUserDocumentsHandlerResponse, GetUserDocumentsHandlerResponses, GetUserDocumentViewLocationData, GetUserDocumentViewLocationError, GetUserDocumentViewLocationErrors, GetUserDocumentViewLocationResponse, GetUserDocumentViewLocationResponses, GetUserHistoryResponse, GetViewsHandlerData, GetViewsHandlerError, GetViewsHandlerErrors, GetViewsHandlerResponse, GetViewsHandlerResponses, GetWebhookData, GetWebhookError, GetWebhookErrors, GetWebhookResponse, GetWebhookResponses, GithubPullRequest, GithubPullRequestCheckRun, GithubPullRequestComment, GithubPullRequestsResponse, GroupedInitialParams, GroupedPageParams, GroupedSoupGroupPage, GroupedSoupInitialPage, GroupedSoupPage, GroupedSoupSort, HandlerData, HandlerError, HandlerErrors, HandlerResponse, HandlerResponses, HashMap, HealthHandlerData, HealthHandlerResponse, HealthHandlerResponses, HighlightType, IngestTranscriptData, IngestTranscriptError, IngestTranscriptErrors, IngestTranscriptResponses, InitializeUserDocumentsData, InitializeUserDocumentsError, InitializeUserDocumentsErrors, InitializeUserDocumentsResponse, InitializeUserDocumentsResponses, InstallSyncData, InstallSyncErrors, InteractionReason, Item, ItemWithUserAccessLevel, JobProcessingResultHandlerData, JobProcessingResultHandlerError, JobProcessingResultHandlerErrors, JobProcessingResultHandlerResponse, JobProcessingResultHandlerResponses, JoinChannelByCodeData, JoinChannelByCodeError, JoinChannelByCodeErrors, JoinChannelByCodeResponses, JoinChannelData, JoinChannelError, JoinChannelErrors, JoinChannelResponses, LatestMessage, LeaveCallResponse, LeaveChannelData, LeaveChannelError, LeaveChannelErrors, LeaveChannelResponses, LeaveOrEndCallData, LeaveOrEndCallError, LeaveOrEndCallErrors, LeaveOrEndCallResponse, LeaveOrEndCallResponses, LinkShare, ListBotChannelsData, ListBotChannelsError, ListBotChannelsErrors, ListBotChannelsResponse, ListBotChannelsResponses, ListCompanyContactsData, ListCompanyContactsError, ListCompanyContactsErrors, ListCompanyContactsResponse, ListCompanyContactsResponses, ListCrmCommentsData, ListCrmCommentsError, ListCrmCommentsErrors, ListCrmCommentsResponse, ListCrmCommentsResponses, ListFavoritesData, ListFavoritesError, ListFavoritesErrors, ListFavoritesResponse, ListFavoritesResponses, ListOccurrencesData, ListOccurrencesErrors, ListOccurrencesResponse, ListOccurrencesResponses, ListRemindersData, ListRemindersError, ListRemindersErrors, ListRemindersResponse, ListRemindersResponses, ListWebhooksData, ListWebhooksError, ListWebhooksErrors, ListWebhooksResponse, ListWebhooksResponse2, ListWebhooksResponses, LocationResponseData, LocationResponseV3, MacroUserIdStr, MentionPreviewsData, MentionPreviewsErrors, MentionPreviewsResponse, MentionPreviewsResponses, Mentions, NewChannelAttachment, NotificationFilters, Params, ParticipantRole, PatchChannelData, PatchChannelError, PatchChannelErrors, PatchChannelRequest, PatchChannelResponse, PatchChannelResponses, PatchMessageData, PatchMessageError, PatchMessageErrors, PatchMessageRequest, PatchMessageResponse, PatchMessageResponses, PatchProjectRequestV2, PatchThreadRequestV2, PatchViewHandlerData, PatchViewHandlerError, PatchViewHandlerErrors, PatchViewHandlerResponses, PatchWebhookData, PatchWebhookError, PatchWebhookErrors, PatchWebhookRequest, PatchWebhookResponse, PatchWebhookResponses, PdfAnchor, PdfAnchorId, PdfAnchorRequest, PdfHighlightAnchor, PdfHighlightAnchorRequest, PdfHighlightRect, PdfHighlightRectAnchorRequest, PdfPlaceableCommentAnchor, PdfPlaceableCommentAnchorRequest, PermanentlyDeleteDocumentData, PermanentlyDeleteDocumentError, PermanentlyDeleteDocumentErrors, PermanentlyDeleteDocumentResponse, PermanentlyDeleteDocumentResponses, PermanentlyDeleteProjectData, PermanentlyDeleteProjectError, PermanentlyDeleteProjectErrors, PermanentlyDeleteProjectResponse, PermanentlyDeleteProjectResponses, PinnedItem, PinRequest, PostActivityData, PostActivityError, PostActivityErrors, PostActivityRequest, PostActivityResponse, PostActivityResponses, PostChannelBotWebhookData, PostChannelBotWebhookError, PostChannelBotWebhookErrors, PostChannelBotWebhookResponse, PostChannelBotWebhookResponses, PostChannelMessagesData, PostChannelMessagesError, PostChannelMessagesErrors, PostChannelMessagesResponse, PostChannelMessagesResponses, PostGroupedSoupAstGroupPageRequest, PostGroupedSoupAstInitialRequest, PostGroupedSoupAstRequest, PostItemsSoupAstData, PostItemsSoupAstError, PostItemsSoupAstErrors, PostItemsSoupAstGroupedData, PostItemsSoupAstGroupedError, PostItemsSoupAstGroupedErrors, PostItemsSoupAstGroupedResponse, PostItemsSoupAstGroupedResponses, PostItemsSoupAstResponse, PostItemsSoupAstResponses, PostItemsSoupData, PostItemsSoupError, PostItemsSoupErrors, PostItemsSoupResponse, PostItemsSoupResponses, PostMessageData, PostMessageError, PostMessageErrors, PostMessageRequest, PostMessageResponse, PostMessageResponse2, PostMessageResponses, PostReactionData, PostReactionError, PostReactionErrors, PostReactionRequest, PostReactionResponse, PostReactionResponses, PostSoupAstRequest, PostSoupRequest, PostTypingData, PostTypingError, PostTypingErrors, PostTypingRequest, PostTypingResponse, PostTypingResponses, PresaveDocumentHandlerData, PresaveDocumentHandlerError, PresaveDocumentHandlerErrors, PresaveDocumentHandlerResponse, PresaveDocumentHandlerResponses, PreSaveDocumentRequest, PreSaveDocumentResponse, PreSaveDocumentResponseData, PresignedUrl, Project, ProjectDeleteResponseData, ProjectDocumentStatus, ProjectFilters, ProjectPreview, ProjectPreviewData, PropertyDefinition, PropertyFilter, PropertyInput, PropertyOwner, PropertyValue, PutCrmTeamSettingsData, PutCrmTeamSettingsError, PutCrmTeamSettingsErrors, PutCrmTeamSettingsResponse, PutCrmTeamSettingsResponses, ReactionAction, RecentlyDeletedData, RecentlyDeletedError, RecentlyDeletedErrors, RecentlyDeletedResponse, RecentlyDeletedResponseData, RecentlyDeletedResponses, Reminder, ReminderFilters, ReminderSchedule, RemindersList, RemoveBotFromChannelByBotData, RemoveBotFromChannelByBotError, RemoveBotFromChannelByBotErrors, RemoveBotFromChannelByBotResponse, RemoveBotFromChannelByBotResponses, RemoveFavoriteByEntityData, RemoveFavoriteByEntityError, RemoveFavoriteByEntityErrors, RemoveFavoriteByEntityResponses, RemoveParticipantsData, RemoveParticipantsError, RemoveParticipantsErrors, RemoveParticipantsRequest, RemoveParticipantsResponses, RemovePinHandlerData, RemovePinHandlerError, RemovePinHandlerErrors, RemovePinHandlerResponse, RemovePinHandlerResponses, ReorderFavoritesData, ReorderFavoritesError, ReorderFavoritesErrors, ReorderFavoritesRequest, ReorderFavoritesResponses, ReorderPinRequest, ReorderPinsHandlerData, ReorderPinsHandlerError, ReorderPinsHandlerErrors, ReorderPinsHandlerResponse, ReorderPinsHandlerResponses, ResolveChannelMessageData, ResolveChannelMessageError, ResolveChannelMessageErrors, ResolveChannelMessageResponse, ResolveChannelMessageResponses, RevertDeleteDocumentData, RevertDeleteDocumentError, RevertDeleteDocumentErrors, RevertDeleteDocumentResponse, RevertDeleteDocumentResponses, RevertDeleteProjectData, RevertDeleteProjectError, RevertDeleteProjectErrors, RevertDeleteProjectResponse, RevertDeleteProjectResponses, RingStatus, RingStatusResponse, S3ObjectInfo, SaveBomPart, SaveDocumentHandlerData, SaveDocumentHandlerError, SaveDocumentHandlerErrors, SaveDocumentHandlerResponse, SaveDocumentHandlerResponses, SaveDocumentRequest, SaveDocumentResponse, SaveDocumentResponseData, SetCompanyHiddenData, SetCompanyHiddenError, SetCompanyHiddenErrors, SetCompanyHiddenRequest, SetCompanyHiddenResponse, SetCompanyHiddenResponses, SetCompanyNameRequest, SetContactHiddenData, SetContactHiddenError, SetContactHiddenErrors, SetContactHiddenRequest, SetContactHiddenResponse, SetContactHiddenResponses, SetContactNameRequest, SetCrmCompanyNameData, SetCrmCompanyNameError, SetCrmCompanyNameErrors, SetCrmCompanyNameResponse, SetCrmCompanyNameResponses, SetCrmContactNameData, SetCrmContactNameError, SetCrmContactNameErrors, SetCrmContactNameResponse, SetCrmContactNameResponses, SetDocumentTeamShareData, SetDocumentTeamShareError, SetDocumentTeamShareErrors, SetDocumentTeamShareRequest, SetDocumentTeamShareResponse, SetDocumentTeamShareResponses, SetEmailSyncData, SetEmailSyncError, SetEmailSyncErrors, SetEmailSyncRequest, SetEmailSyncResponse, SetEmailSyncResponses, SetPropertyValue, SharedEmailFilter, SharePermissionV2, ShortIdResponse, SimpleMention, SimpleSaveData, SimpleSaveError, SimpleSaveErrors, SimpleSaveResponse, SimpleSaveResponses, SoupApiItem, SoupApiSort, SoupApiSortDirection, SoupAttachment, SoupCalendarEventSoupPropertiesField, SoupCalendarEventTime, SoupCallRecordParticipant, SoupCallRecordSoupPropertiesField, SoupChannel, SoupChannelThread, SoupChatSoupPropertiesField, SoupContact, SoupCountedReaction, SoupCrmCompanySoupPropertiesField, SoupCrmDomain, SoupDocumentSoupPropertiesField, SoupDocumentSubType, SoupEmailThreadPreview, SoupEnrichedEmailThreadPreviewSoupPropertiesField, SoupForeignEntity, SoupItem, SoupLabel, SoupLabelListVisibility, SoupLabelType, SoupMessageAttachment, SoupMessageListVisibility, SoupMessageSender, SoupMessageSenderType, SoupPage, SoupProjectSoupPropertiesField, SoupPropertiesField, SoupProperty, SoupReminderReference, SoupReminderSchedule, SoupReminderSoupPropertiesField, SoupThreadInfo, SoupThreadReply, StarterDocumentsResponse, String, SuccessResponse, SyncServiceVersionId, SystemSkillSummary, TagFilterMode, TaskFilters, TeamRole, Thread, ThreadResponse, ToggleShareWithTeamData, ToggleShareWithTeamError, ToggleShareWithTeamErrors, ToggleShareWithTeamResponse, ToggleShareWithTeamResponses, TranscriptSegmentRequest, TypedSuccessResponse, TypedSuccessResponseGetDocumentResponseData, TypingAction, UnthreadedPdfUuidRequest, UpdateChannelSharePermission, UpdateCrmTeamSettingsRequest, UpdateOperation, UpdateReminderData, UpdateReminderError, UpdateReminderErrors, UpdateReminderRequest, UpdateReminderResponse, UpdateReminderResponses, UpdateSharePermissionRequestV2, UploadDocumentStatus, UploadExtractFolderHandlerData, UploadExtractFolderHandlerError, UploadExtractFolderHandlerErrors, UploadExtractFolderHandlerResponse, UploadExtractFolderHandlerResponses, UploadExtractFolderRequest, UploadFolderHandlerData, UploadFolderHandlerError, UploadFolderHandlerErrors, UploadFolderHandlerResponse, UploadFolderHandlerResponses, UploadFolderRequest, UpsertHistoryHandlerData, UpsertHistoryHandlerError, UpsertHistoryHandlerErrors, UpsertHistoryHandlerResponse, UpsertHistoryHandlerResponses, UpsertUserDocumentViewLocationData, UpsertUserDocumentViewLocationError, UpsertUserDocumentViewLocationErrors, UpsertUserDocumentViewLocationRequest, UpsertUserDocumentViewLocationResponse, UpsertUserDocumentViewLocationResponses, UserDocumentsResponse, UserDocumentViewLocation, UserDocumentViewLocationResponse, UserPinsResponse, UserViewsResponse, ValidateDocumentPermissionsTokenData, ValidateDocumentPermissionsTokenError, ValidateDocumentPermissionsTokenErrors, ValidateDocumentPermissionsTokenResponse, ValidateDocumentPermissionsTokenResponses, ValidateWebhookData, ValidateWebhookError, ValidateWebhookErrors, ValidateWebhookResponse, ValidateWebhookResponse2, ValidateWebhookResponses, Vec, View, ViewPatch, ViewsResponse, Webhook, WebhookEvent, WebhookFilter, WebhookScope, WebhookStatus, WebhookValidationTestEvent, WithCallId, WithChannelId, WithDocumentId, WithProjectId } from './types.gen';
diff --git a/packages/sdk/generated/storage/sdk.gen.ts b/packages/sdk/generated/storage/sdk.gen.ts
index 006946ee41..29832db8f4 100644
--- a/packages/sdk/generated/storage/sdk.gen.ts
+++ b/packages/sdk/generated/storage/sdk.gen.ts
@@ -2,7 +2,7 @@
import type { Client, ClientMeta, Options as Options2, RequestResult, TDataShape } from './client';
import { client } from './client.gen';
-import type { AddFavoriteData, AddFavoriteErrors, AddFavoriteResponses, AddParticipantsData, AddParticipantsErrors, AddParticipantsResponses, AddPinHandlerData, AddPinHandlerErrors, AddPinHandlerResponses, BulkWakeupSyncServiceDocumentsData, BulkWakeupSyncServiceDocumentsErrors, BulkWakeupSyncServiceDocumentsResponses, CallWebhookData, CallWebhookErrors, CallWebhookResponses, CheckActiveCallData, CheckActiveCallErrors, CheckActiveCallResponses, CopyDocumentData, CopyDocumentErrors, CopyDocumentResponses, CreateAnchorData, CreateAnchorErrors, CreateAnchorResponses, CreateChannelData, CreateChannelErrors, CreateChannelResponses, CreateChannelScopedBotData, CreateChannelScopedBotErrors, CreateChannelScopedBotResponses, CreateCommentData, CreateCommentErrors, CreateCommentResponses, CreateCrmCommentData, CreateCrmCommentErrors, CreateCrmCommentResponses, CreateCrmCompanyData, CreateCrmCompanyErrors, CreateCrmCompanyResponses, CreateCrmContactData, CreateCrmContactErrors, CreateCrmContactResponses, CreateDocumentData, CreateDocumentErrors, CreateDocumentResponses, CreateEntityMentionData, CreateEntityMentionErrors, CreateEntityMentionResponses, CreateInstructionsHandlerData, CreateInstructionsHandlerErrors, CreateInstructionsHandlerResponses, CreateMarkdownHandlerData, CreateMarkdownHandlerErrors, CreateMarkdownHandlerResponses, CreateProjectHandlerData, CreateProjectHandlerErrors, CreateProjectHandlerResponses, CreateReminderData, CreateReminderErrors, CreateReminderResponses, CreateSkillHandlerData, CreateSkillHandlerErrors, CreateSkillHandlerResponses, CreateSnippetHandlerData, CreateSnippetHandlerErrors, CreateSnippetHandlerResponses, CreateTaskHandlerData, CreateTaskHandlerErrors, CreateTaskHandlerResponses, CreateViewHandlerData, CreateViewHandlerErrors, CreateViewHandlerResponses, CreateWebhookData, CreateWebhookErrors, CreateWebhookResponses, DeleteAnchorData, DeleteAnchorErrors, DeleteAnchorResponses, DeleteCallRecordData, DeleteCallRecordErrors, DeleteCallRecordResponses, DeleteChannelData, DeleteChannelErrors, DeleteChannelResponses, DeleteCommentData, DeleteCommentErrors, DeleteCommentResponses, DeleteCrmCommentData, DeleteCrmCommentErrors, DeleteCrmCommentResponses, DeleteDocumentData, DeleteDocumentErrors, DeleteDocumentResponses, DeleteEntityMentionData, DeleteEntityMentionErrors, DeleteEntityMentionResponses, DeleteHistoryHandlerData, DeleteHistoryHandlerErrors, DeleteHistoryHandlerResponses, DeleteMessageData, DeleteMessageErrors, DeleteMessageResponses, DeleteProjectHandlerData, DeleteProjectHandlerErrors, DeleteProjectHandlerResponses, DeleteReminderData, DeleteReminderErrors, DeleteReminderResponses, DeleteUserDocumentViewLocationData, DeleteUserDocumentViewLocationErrors, DeleteUserDocumentViewLocationResponses, DeleteViewHandlerData, DeleteViewHandlerErrors, DeleteViewHandlerResponses, DeleteWebhookData, DeleteWebhookErrors, DeleteWebhookResponses, EditAnchorData, EditAnchorErrors, EditAnchorResponses, EditCallRecordData, EditCallRecordErrors, EditCallRecordResponses, EditCallTranscriptData, EditCallTranscriptErrors, EditCallTranscriptResponses, EditCommentData, EditCommentErrors, EditCommentResponses, EditCrmCommentData, EditCrmCommentErrors, EditCrmCommentResponses, EditDocumentData, EditDocumentErrors, EditDocumentResponses, EditProjectV2Data, EditProjectV2Errors, EditProjectV2Responses, EditThreadV2Data, EditThreadV2Errors, EditThreadV2Responses, ExcludeDefaultViewHandlerData, ExcludeDefaultViewHandlerErrors, ExcludeDefaultViewHandlerResponses, ExportDocumentData, ExportDocumentErrors, ExportDocumentResponses, GetActivityData, GetActivityErrors, GetActivityResponses, GetAttachmentReferencesData, GetAttachmentReferencesErrors, GetAttachmentReferencesResponses, GetBatchCallRecordPreviewData, GetBatchCallRecordPreviewErrors, GetBatchCallRecordPreviewResponses, GetBatchChannelPreviewData, GetBatchChannelPreviewErrors, GetBatchChannelPreviewResponses, GetBatchPreviewHandlerData, GetBatchPreviewHandlerErrors, GetBatchPreviewHandlerResponses, GetBatchProjectPreviewData, GetBatchProjectPreviewErrors, GetBatchProjectPreviewResponses, GetCallRecordData, GetCallRecordErrors, GetCallRecordResponses, GetChannelAttachmentsData, GetChannelAttachmentsErrors, GetChannelAttachmentsResponses, GetChannelData, GetChannelErrors, GetChannelJoinLinkData, GetChannelJoinLinkErrors, GetChannelJoinLinkResponses, GetChannelMessagesData, GetChannelMessagesErrors, GetChannelMessagesResponses, GetChannelParticipantsData, GetChannelParticipantsErrors, GetChannelParticipantsResponses, GetChannelResponses, GetChannelsData, GetChannelsErrors, GetChannelsResponses, GetCompanyData, GetCompanyErrors, GetCompanyResponses, GetContactData, GetContactErrors, GetContactResponses, GetCrmTeamSettingsData, GetCrmTeamSettingsErrors, GetCrmTeamSettingsResponses, GetDocumentAnchorsData, GetDocumentAnchorsErrors, GetDocumentAnchorsResponses, GetDocumentBranchNameData, GetDocumentBranchNameErrors, GetDocumentBranchNameResponses, GetDocumentByTeamSlugData, GetDocumentByTeamSlugErrors, GetDocumentByTeamSlugResponses, GetDocumentCommentsData, GetDocumentCommentsErrors, GetDocumentCommentsResponses, GetDocumentData, GetDocumentErrors, GetDocumentGithubPullRequestsData, GetDocumentGithubPullRequestsErrors, GetDocumentGithubPullRequestsResponses, GetDocumentListHandlerData, GetDocumentListHandlerErrors, GetDocumentListHandlerResponses, GetDocumentLocationV3Data, GetDocumentLocationV3Errors, GetDocumentLocationV3Responses, GetDocumentPermissionsTokenData, GetDocumentPermissionsTokenErrors, GetDocumentPermissionsTokenResponses, GetDocumentPermissionsV2Data, GetDocumentPermissionsV2Errors, GetDocumentPermissionsV2Responses, GetDocumentProcessingResultData, GetDocumentProcessingResultErrors, GetDocumentProcessingResultResponses, GetDocumentResponses, GetDocumentShortIdData, GetDocumentShortIdErrors, GetDocumentShortIdResponses, GetDocumentTeamShareData, GetDocumentTeamShareErrors, GetDocumentTeamShareResponses, GetDocumentVersionData, GetDocumentVersionErrors, GetDocumentVersionResponses, GetDocumentViewsHandlerData, GetDocumentViewsHandlerErrors, GetDocumentViewsHandlerResponses, GetEntityPermissionData, GetEntityPermissionErrors, GetEntityPermissionResponses, GetForeignEntityData, GetForeignEntityErrors, GetForeignEntityResponses, GetHistoryHandlerData, GetHistoryHandlerErrors, GetHistoryHandlerResponses, GetInstructionsHandlerData, GetInstructionsHandlerErrors, GetInstructionsHandlerResponses, GetItemsSoupData, GetItemsSoupErrors, GetItemsSoupResponses, GetLocationHandlerData, GetLocationHandlerErrors, GetLocationHandlerResponses, GetMessageWithContextData, GetMessageWithContextErrors, GetMessageWithContextResponses, GetOrCreateCallData, GetOrCreateCallErrors, GetOrCreateCallResponses, GetOrCreateDmData, GetOrCreateDmErrors, GetOrCreateDmResponses, GetOrCreatePrivateData, GetOrCreatePrivateErrors, GetOrCreatePrivateResponses, GetPendingProjectsHandlerData, GetPendingProjectsHandlerErrors, GetPendingProjectsHandlerResponses, GetPinsHandlerData, GetPinsHandlerErrors, GetPinsHandlerResponses, GetProjectContentHandlerData, GetProjectContentHandlerErrors, GetProjectContentHandlerResponses, GetProjectHandlerData, GetProjectHandlerErrors, GetProjectHandlerResponses, GetProjectPermissionsV2Data, GetProjectPermissionsV2Errors, GetProjectPermissionsV2Responses, GetProjectsHandlerData, GetProjectsHandlerErrors, GetProjectsHandlerResponses, GetProjectUserAccessLevelData, GetProjectUserAccessLevelErrors, GetProjectUserAccessLevelResponses, GetReminderData, GetReminderErrors, GetReminderResponses, GetRingStatusData, GetRingStatusErrors, GetRingStatusResponses, GetSelfBotData, GetSelfBotErrors, GetSelfBotResponses, GetSystemSkillsHandlerData, GetSystemSkillsHandlerErrors, GetSystemSkillsHandlerResponses, GetThreadRepliesData, GetThreadRepliesErrors, GetThreadRepliesResponses, GetUserDocumentsHandlerData, GetUserDocumentsHandlerErrors, GetUserDocumentsHandlerResponses, GetUserDocumentViewLocationData, GetUserDocumentViewLocationErrors, GetUserDocumentViewLocationResponses, GetViewsHandlerData, GetViewsHandlerErrors, GetViewsHandlerResponses, GetWebhookData, GetWebhookErrors, GetWebhookResponses, HandlerData, HandlerErrors, HandlerResponses, HealthHandlerData, HealthHandlerResponses, IngestTranscriptData, IngestTranscriptErrors, IngestTranscriptResponses, InitializeUserDocumentsData, InitializeUserDocumentsErrors, InitializeUserDocumentsResponses, InstallSyncData, InstallSyncErrors, JobProcessingResultHandlerData, JobProcessingResultHandlerErrors, JobProcessingResultHandlerResponses, JoinChannelByCodeData, JoinChannelByCodeErrors, JoinChannelByCodeResponses, JoinChannelData, JoinChannelErrors, JoinChannelResponses, LeaveChannelData, LeaveChannelErrors, LeaveChannelResponses, LeaveOrEndCallData, LeaveOrEndCallErrors, LeaveOrEndCallResponses, ListBotChannelsData, ListBotChannelsErrors, ListBotChannelsResponses, ListCompanyContactsData, ListCompanyContactsErrors, ListCompanyContactsResponses, ListCrmCommentsData, ListCrmCommentsErrors, ListCrmCommentsResponses, ListFavoritesData, ListFavoritesErrors, ListFavoritesResponses, ListOccurrencesData, ListOccurrencesErrors, ListOccurrencesResponses, ListRemindersData, ListRemindersErrors, ListRemindersResponses, ListWebhooksData, ListWebhooksErrors, ListWebhooksResponses, PatchChannelData, PatchChannelErrors, PatchChannelResponses, PatchMessageData, PatchMessageErrors, PatchMessageResponses, PatchViewHandlerData, PatchViewHandlerErrors, PatchViewHandlerResponses, PatchWebhookData, PatchWebhookErrors, PatchWebhookResponses, PermanentlyDeleteDocumentData, PermanentlyDeleteDocumentErrors, PermanentlyDeleteDocumentResponses, PermanentlyDeleteProjectData, PermanentlyDeleteProjectErrors, PermanentlyDeleteProjectResponses, PostActivityData, PostActivityErrors, PostActivityResponses, PostChannelBotWebhookData, PostChannelBotWebhookErrors, PostChannelBotWebhookResponses, PostChannelMessagesData, PostChannelMessagesErrors, PostChannelMessagesResponses, PostItemsSoupAstData, PostItemsSoupAstErrors, PostItemsSoupAstGroupedData, PostItemsSoupAstGroupedErrors, PostItemsSoupAstGroupedResponses, PostItemsSoupAstResponses, PostItemsSoupData, PostItemsSoupErrors, PostItemsSoupResponses, PostMessageData, PostMessageErrors, PostMessageResponses, PostReactionData, PostReactionErrors, PostReactionResponses, PostTypingData, PostTypingErrors, PostTypingResponses, PresaveDocumentHandlerData, PresaveDocumentHandlerErrors, PresaveDocumentHandlerResponses, PutCrmTeamSettingsData, PutCrmTeamSettingsErrors, PutCrmTeamSettingsResponses, RecentlyDeletedData, RecentlyDeletedErrors, RecentlyDeletedResponses, RemoveBotFromChannelByBotData, RemoveBotFromChannelByBotErrors, RemoveBotFromChannelByBotResponses, RemoveFavoriteByEntityData, RemoveFavoriteByEntityErrors, RemoveFavoriteByEntityResponses, RemoveParticipantsData, RemoveParticipantsErrors, RemoveParticipantsResponses, RemovePinHandlerData, RemovePinHandlerErrors, RemovePinHandlerResponses, ReorderFavoritesData, ReorderFavoritesErrors, ReorderFavoritesResponses, ReorderPinsHandlerData, ReorderPinsHandlerErrors, ReorderPinsHandlerResponses, ResolveChannelMessageData, ResolveChannelMessageErrors, ResolveChannelMessageResponses, RevertDeleteDocumentData, RevertDeleteDocumentErrors, RevertDeleteDocumentResponses, RevertDeleteProjectData, RevertDeleteProjectErrors, RevertDeleteProjectResponses, SaveDocumentHandlerData, SaveDocumentHandlerErrors, SaveDocumentHandlerResponses, SetCompanyHiddenData, SetCompanyHiddenErrors, SetCompanyHiddenResponses, SetContactHiddenData, SetContactHiddenErrors, SetContactHiddenResponses, SetCrmCompanyNameData, SetCrmCompanyNameErrors, SetCrmCompanyNameResponses, SetCrmContactNameData, SetCrmContactNameErrors, SetCrmContactNameResponses, SetDocumentTeamShareData, SetDocumentTeamShareErrors, SetDocumentTeamShareResponses, SetEmailSyncData, SetEmailSyncErrors, SetEmailSyncResponses, SimpleSaveData, SimpleSaveErrors, SimpleSaveResponses, ToggleShareWithTeamData, ToggleShareWithTeamErrors, ToggleShareWithTeamResponses, UpdateReminderData, UpdateReminderErrors, UpdateReminderResponses, UploadExtractFolderHandlerData, UploadExtractFolderHandlerErrors, UploadExtractFolderHandlerResponses, UploadFolderHandlerData, UploadFolderHandlerErrors, UploadFolderHandlerResponses, UpsertHistoryHandlerData, UpsertHistoryHandlerErrors, UpsertHistoryHandlerResponses, UpsertUserDocumentViewLocationData, UpsertUserDocumentViewLocationErrors, UpsertUserDocumentViewLocationResponses, ValidateDocumentPermissionsTokenData, ValidateDocumentPermissionsTokenErrors, ValidateDocumentPermissionsTokenResponses, ValidateWebhookData, ValidateWebhookErrors, ValidateWebhookResponses } from './types.gen';
+import type { AddFavoriteData, AddFavoriteErrors, AddFavoriteResponses, AddParticipantsData, AddParticipantsErrors, AddParticipantsResponses, AddPinHandlerData, AddPinHandlerErrors, AddPinHandlerResponses, BulkWakeupSyncServiceDocumentsData, BulkWakeupSyncServiceDocumentsErrors, BulkWakeupSyncServiceDocumentsResponses, CallWebhookData, CallWebhookErrors, CallWebhookResponses, CheckActiveCallData, CheckActiveCallErrors, CheckActiveCallResponses, CopyDocumentData, CopyDocumentErrors, CopyDocumentResponses, CreateAnchorData, CreateAnchorErrors, CreateAnchorResponses, CreateChannelData, CreateChannelErrors, CreateChannelResponses, CreateChannelScopedBotData, CreateChannelScopedBotErrors, CreateChannelScopedBotResponses, CreateCommentData, CreateCommentErrors, CreateCommentResponses, CreateCrmCommentData, CreateCrmCommentErrors, CreateCrmCommentResponses, CreateCrmCompanyData, CreateCrmCompanyErrors, CreateCrmCompanyResponses, CreateCrmContactData, CreateCrmContactErrors, CreateCrmContactResponses, CreateDocumentData, CreateDocumentErrors, CreateDocumentResponses, CreateEntityMentionData, CreateEntityMentionErrors, CreateEntityMentionResponses, CreateInstructionsHandlerData, CreateInstructionsHandlerErrors, CreateInstructionsHandlerResponses, CreateMarkdownHandlerData, CreateMarkdownHandlerErrors, CreateMarkdownHandlerResponses, CreateProjectHandlerData, CreateProjectHandlerErrors, CreateProjectHandlerResponses, CreateReminderData, CreateReminderErrors, CreateReminderResponses, CreateSkillHandlerData, CreateSkillHandlerErrors, CreateSkillHandlerResponses, CreateSnippetHandlerData, CreateSnippetHandlerErrors, CreateSnippetHandlerResponses, CreateTaskHandlerData, CreateTaskHandlerErrors, CreateTaskHandlerResponses, CreateViewHandlerData, CreateViewHandlerErrors, CreateViewHandlerResponses, CreateWebhookData, CreateWebhookErrors, CreateWebhookResponses, DeleteAnchorData, DeleteAnchorErrors, DeleteAnchorResponses, DeleteCallRecordData, DeleteCallRecordErrors, DeleteCallRecordResponses, DeleteChannelData, DeleteChannelErrors, DeleteChannelResponses, DeleteCommentData, DeleteCommentErrors, DeleteCommentResponses, DeleteCrmCommentData, DeleteCrmCommentErrors, DeleteCrmCommentResponses, DeleteDocumentData, DeleteDocumentErrors, DeleteDocumentResponses, DeleteEntityMentionData, DeleteEntityMentionErrors, DeleteEntityMentionResponses, DeleteHistoryHandlerData, DeleteHistoryHandlerErrors, DeleteHistoryHandlerResponses, DeleteMessageData, DeleteMessageErrors, DeleteMessageResponses, DeleteProjectHandlerData, DeleteProjectHandlerErrors, DeleteProjectHandlerResponses, DeleteReminderData, DeleteReminderErrors, DeleteReminderResponses, DeleteUserDocumentViewLocationData, DeleteUserDocumentViewLocationErrors, DeleteUserDocumentViewLocationResponses, DeleteViewHandlerData, DeleteViewHandlerErrors, DeleteViewHandlerResponses, DeleteWebhookData, DeleteWebhookErrors, DeleteWebhookResponses, EditAnchorData, EditAnchorErrors, EditAnchorResponses, EditCallRecordData, EditCallRecordErrors, EditCallRecordResponses, EditCallTranscriptData, EditCallTranscriptErrors, EditCallTranscriptResponses, EditCommentData, EditCommentErrors, EditCommentResponses, EditCrmCommentData, EditCrmCommentErrors, EditCrmCommentResponses, EditDocumentData, EditDocumentErrors, EditDocumentResponses, EditProjectV2Data, EditProjectV2Errors, EditProjectV2Responses, EditThreadV2Data, EditThreadV2Errors, EditThreadV2Responses, ExcludeDefaultViewHandlerData, ExcludeDefaultViewHandlerErrors, ExcludeDefaultViewHandlerResponses, ExportDocumentData, ExportDocumentErrors, ExportDocumentResponses, GetActivityData, GetActivityErrors, GetActivityResponses, GetAttachmentReferencesData, GetAttachmentReferencesErrors, GetAttachmentReferencesResponses, GetBatchCallRecordPreviewData, GetBatchCallRecordPreviewErrors, GetBatchCallRecordPreviewResponses, GetBatchChannelPreviewData, GetBatchChannelPreviewErrors, GetBatchChannelPreviewResponses, GetBatchPreviewHandlerData, GetBatchPreviewHandlerErrors, GetBatchPreviewHandlerResponses, GetBatchProjectPreviewData, GetBatchProjectPreviewErrors, GetBatchProjectPreviewResponses, GetCallRecordData, GetCallRecordErrors, GetCallRecordResponses, GetChannelAttachmentsData, GetChannelAttachmentsErrors, GetChannelAttachmentsResponses, GetChannelData, GetChannelErrors, GetChannelJoinLinkData, GetChannelJoinLinkErrors, GetChannelJoinLinkResponses, GetChannelMessagesData, GetChannelMessagesErrors, GetChannelMessagesResponses, GetChannelParticipantsData, GetChannelParticipantsErrors, GetChannelParticipantsResponses, GetChannelResponses, GetChannelsData, GetChannelsErrors, GetChannelsResponses, GetCompanyData, GetCompanyErrors, GetCompanyResponses, GetContactData, GetContactErrors, GetContactResponses, GetCrmTeamSettingsData, GetCrmTeamSettingsErrors, GetCrmTeamSettingsResponses, GetDocumentAnchorsData, GetDocumentAnchorsErrors, GetDocumentAnchorsResponses, GetDocumentBranchNameData, GetDocumentBranchNameErrors, GetDocumentBranchNameResponses, GetDocumentByTeamSlugData, GetDocumentByTeamSlugErrors, GetDocumentByTeamSlugResponses, GetDocumentCommentsData, GetDocumentCommentsErrors, GetDocumentCommentsResponses, GetDocumentData, GetDocumentErrors, GetDocumentGithubPullRequestsData, GetDocumentGithubPullRequestsErrors, GetDocumentGithubPullRequestsResponses, GetDocumentListHandlerData, GetDocumentListHandlerErrors, GetDocumentListHandlerResponses, GetDocumentLocationV3Data, GetDocumentLocationV3Errors, GetDocumentLocationV3Responses, GetDocumentPermissionsTokenData, GetDocumentPermissionsTokenErrors, GetDocumentPermissionsTokenResponses, GetDocumentPermissionsV2Data, GetDocumentPermissionsV2Errors, GetDocumentPermissionsV2Responses, GetDocumentProcessingResultData, GetDocumentProcessingResultErrors, GetDocumentProcessingResultResponses, GetDocumentResponses, GetDocumentShortIdData, GetDocumentShortIdErrors, GetDocumentShortIdResponses, GetDocumentTeamShareData, GetDocumentTeamShareErrors, GetDocumentTeamShareResponses, GetDocumentVersionData, GetDocumentVersionErrors, GetDocumentVersionResponses, GetDocumentViewsHandlerData, GetDocumentViewsHandlerErrors, GetDocumentViewsHandlerResponses, GetEntityPermissionData, GetEntityPermissionErrors, GetEntityPermissionResponses, GetForeignEntityData, GetForeignEntityErrors, GetForeignEntityResponses, GetHistoryHandlerData, GetHistoryHandlerErrors, GetHistoryHandlerResponses, GetInstructionsHandlerData, GetInstructionsHandlerErrors, GetInstructionsHandlerResponses, GetItemsSoupData, GetItemsSoupErrors, GetItemsSoupResponses, GetLocationHandlerData, GetLocationHandlerErrors, GetLocationHandlerResponses, GetMessageWithContextData, GetMessageWithContextErrors, GetMessageWithContextResponses, GetOrCreateCallData, GetOrCreateCallErrors, GetOrCreateCallResponses, GetOrCreateDmData, GetOrCreateDmErrors, GetOrCreateDmResponses, GetOrCreatePrivateData, GetOrCreatePrivateErrors, GetOrCreatePrivateResponses, GetPendingProjectsHandlerData, GetPendingProjectsHandlerErrors, GetPendingProjectsHandlerResponses, GetPinsHandlerData, GetPinsHandlerErrors, GetPinsHandlerResponses, GetProjectContentHandlerData, GetProjectContentHandlerErrors, GetProjectContentHandlerResponses, GetProjectHandlerData, GetProjectHandlerErrors, GetProjectHandlerResponses, GetProjectPermissionsV2Data, GetProjectPermissionsV2Errors, GetProjectPermissionsV2Responses, GetProjectsHandlerData, GetProjectsHandlerErrors, GetProjectsHandlerResponses, GetProjectUserAccessLevelData, GetProjectUserAccessLevelErrors, GetProjectUserAccessLevelResponses, GetReminderData, GetReminderErrors, GetReminderResponses, GetRingStatusData, GetRingStatusErrors, GetRingStatusResponses, GetSelfBotData, GetSelfBotErrors, GetSelfBotResponses, GetSystemSkillsHandlerData, GetSystemSkillsHandlerErrors, GetSystemSkillsHandlerResponses, GetThreadRepliesData, GetThreadRepliesErrors, GetThreadRepliesResponses, GetUserDocumentsHandlerData, GetUserDocumentsHandlerErrors, GetUserDocumentsHandlerResponses, GetUserDocumentViewLocationData, GetUserDocumentViewLocationErrors, GetUserDocumentViewLocationResponses, GetViewsHandlerData, GetViewsHandlerErrors, GetViewsHandlerResponses, GetWebhookData, GetWebhookErrors, GetWebhookResponses, HandlerData, HandlerErrors, HandlerResponses, HealthHandlerData, HealthHandlerResponses, IngestTranscriptData, IngestTranscriptErrors, IngestTranscriptResponses, InitializeUserDocumentsData, InitializeUserDocumentsErrors, InitializeUserDocumentsResponses, InstallSyncData, InstallSyncErrors, JobProcessingResultHandlerData, JobProcessingResultHandlerErrors, JobProcessingResultHandlerResponses, JoinChannelByCodeData, JoinChannelByCodeErrors, JoinChannelByCodeResponses, JoinChannelData, JoinChannelErrors, JoinChannelResponses, LeaveChannelData, LeaveChannelErrors, LeaveChannelResponses, LeaveOrEndCallData, LeaveOrEndCallErrors, LeaveOrEndCallResponses, ListBotChannelsData, ListBotChannelsErrors, ListBotChannelsResponses, ListCompanyContactsData, ListCompanyContactsErrors, ListCompanyContactsResponses, ListCrmCommentsData, ListCrmCommentsErrors, ListCrmCommentsResponses, ListFavoritesData, ListFavoritesErrors, ListFavoritesResponses, ListOccurrencesData, ListOccurrencesErrors, ListOccurrencesResponses, ListRemindersData, ListRemindersErrors, ListRemindersResponses, ListWebhooksData, ListWebhooksErrors, ListWebhooksResponses, MentionPreviewsData, MentionPreviewsErrors, MentionPreviewsResponses, PatchChannelData, PatchChannelErrors, PatchChannelResponses, PatchMessageData, PatchMessageErrors, PatchMessageResponses, PatchViewHandlerData, PatchViewHandlerErrors, PatchViewHandlerResponses, PatchWebhookData, PatchWebhookErrors, PatchWebhookResponses, PermanentlyDeleteDocumentData, PermanentlyDeleteDocumentErrors, PermanentlyDeleteDocumentResponses, PermanentlyDeleteProjectData, PermanentlyDeleteProjectErrors, PermanentlyDeleteProjectResponses, PostActivityData, PostActivityErrors, PostActivityResponses, PostChannelBotWebhookData, PostChannelBotWebhookErrors, PostChannelBotWebhookResponses, PostChannelMessagesData, PostChannelMessagesErrors, PostChannelMessagesResponses, PostItemsSoupAstData, PostItemsSoupAstErrors, PostItemsSoupAstGroupedData, PostItemsSoupAstGroupedErrors, PostItemsSoupAstGroupedResponses, PostItemsSoupAstResponses, PostItemsSoupData, PostItemsSoupErrors, PostItemsSoupResponses, PostMessageData, PostMessageErrors, PostMessageResponses, PostReactionData, PostReactionErrors, PostReactionResponses, PostTypingData, PostTypingErrors, PostTypingResponses, PresaveDocumentHandlerData, PresaveDocumentHandlerErrors, PresaveDocumentHandlerResponses, PutCrmTeamSettingsData, PutCrmTeamSettingsErrors, PutCrmTeamSettingsResponses, RecentlyDeletedData, RecentlyDeletedErrors, RecentlyDeletedResponses, RemoveBotFromChannelByBotData, RemoveBotFromChannelByBotErrors, RemoveBotFromChannelByBotResponses, RemoveFavoriteByEntityData, RemoveFavoriteByEntityErrors, RemoveFavoriteByEntityResponses, RemoveParticipantsData, RemoveParticipantsErrors, RemoveParticipantsResponses, RemovePinHandlerData, RemovePinHandlerErrors, RemovePinHandlerResponses, ReorderFavoritesData, ReorderFavoritesErrors, ReorderFavoritesResponses, ReorderPinsHandlerData, ReorderPinsHandlerErrors, ReorderPinsHandlerResponses, ResolveChannelMessageData, ResolveChannelMessageErrors, ResolveChannelMessageResponses, RevertDeleteDocumentData, RevertDeleteDocumentErrors, RevertDeleteDocumentResponses, RevertDeleteProjectData, RevertDeleteProjectErrors, RevertDeleteProjectResponses, SaveDocumentHandlerData, SaveDocumentHandlerErrors, SaveDocumentHandlerResponses, SetCompanyHiddenData, SetCompanyHiddenErrors, SetCompanyHiddenResponses, SetContactHiddenData, SetContactHiddenErrors, SetContactHiddenResponses, SetCrmCompanyNameData, SetCrmCompanyNameErrors, SetCrmCompanyNameResponses, SetCrmContactNameData, SetCrmContactNameErrors, SetCrmContactNameResponses, SetDocumentTeamShareData, SetDocumentTeamShareErrors, SetDocumentTeamShareResponses, SetEmailSyncData, SetEmailSyncErrors, SetEmailSyncResponses, SimpleSaveData, SimpleSaveErrors, SimpleSaveResponses, ToggleShareWithTeamData, ToggleShareWithTeamErrors, ToggleShareWithTeamResponses, UpdateReminderData, UpdateReminderErrors, UpdateReminderResponses, UploadExtractFolderHandlerData, UploadExtractFolderHandlerErrors, UploadExtractFolderHandlerResponses, UploadFolderHandlerData, UploadFolderHandlerErrors, UploadFolderHandlerResponses, UpsertHistoryHandlerData, UpsertHistoryHandlerErrors, UpsertHistoryHandlerResponses, UpsertUserDocumentViewLocationData, UpsertUserDocumentViewLocationErrors, UpsertUserDocumentViewLocationResponses, ValidateDocumentPermissionsTokenData, ValidateDocumentPermissionsTokenErrors, ValidateDocumentPermissionsTokenResponses, ValidateWebhookData, ValidateWebhookErrors, ValidateWebhookResponses } from './types.gen';
export type Options<TData extends TDataShape = TDataShape, ThrowOnError extends boolean = boolean, TResponse = unknown> = Options2<TData, ThrowOnError, TResponse> & {
/**
@@ -186,6 +186,20 @@ export class Sdk extends HeyApiClient {
return (options.client ?? this.client).get<ListOccurrencesResponses, ListOccurrencesErrors, ThrowOnError>({ url: '/calendar-events', ...options });
}
+ /**
+ * Resolve mentioned calendar events to the requester's own projections.
+ */
+ public mentionPreviews<ThrowOnError extends boolean = false>(options: Options<MentionPreviewsData, ThrowOnError>): RequestResult<MentionPreviewsResponses, MentionPreviewsErrors, ThrowOnError> {
+ return (options.client ?? this.client).post<MentionPreviewsResponses, MentionPreviewsErrors, ThrowOnError>({
+ url: '/calendar-events/preview',
+ ...options,
+ headers: {
+ 'Content-Type': 'application/json',
+ ...options.headers
+ }
+ });
+ }
+
/**
* Handler for `POST /call/record/preview`.
*
diff --git a/packages/sdk/generated/storage/types.gen.ts b/packages/sdk/generated/storage/types.gen.ts
index 6106230d4e..74799c3669 100644
--- a/packages/sdk/generated/storage/types.gen.ts
+++ b/packages/sdk/generated/storage/types.gen.ts
@@ -1314,6 +1314,108 @@ export type CalendarEventFilters = {
statuses?: Array<string>;
};
+/**
+ * Meeting-level fields shown in a calendar event mention preview, taken from
+ * the requester's own projection of the meeting.
+ */
+export type CalendarMentionEvent = {
+ /**
+ * Number of attendees on the requester's copy.
+ */
+ attendeeCount: number;
+ /**
+ * Whether the event repeats.
+ */
+ isRecurring: boolean;
+ /**
+ * Location label, when set.
+ */
+ location?: string | null;
+ /**
+ * Key of the previewed instance, absent when no occurrence is
+ * materialized.
+ */
+ occurrenceKey?: string | null;
+ /**
+ * Organizer email.
+ */
+ organizerEmail?: string | null;
+ /**
+ * Organizer display name.
+ */
+ organizerName?: string | null;
+ /**
+ * Time of the previewed instance: the requested occurrence when it
+ * exists, else the next upcoming one, else the latest past one, else the
+ * series start.
+ */
+ time: EventTime;
+ /**
+ * Display title.
+ */
+ title: string;
+ /**
+ * Entity update time of the requester's copy.
+ */
+ updatedAt: string;
+ /**
+ * The requester's own event entity for the mentioned meeting. Differs
+ * from the mentioned id when the mention came from another attendee.
+ */
+ viewerEventId: string;
+};
+
+/**
+ * Resolution of one mentioned event, in request order.
+ */
+export type CalendarMentionPreviewItem = {
+ event?: null | CalendarMentionEvent;
+ /**
+ * The mentioned event id, echoed from the request.
+ */
+ eventId: string;
+ /**
+ * Visibility of the mentioned event to the requester.
+ */
+ type: CalendarMentionPreviewKind;
+};
+
+/**
+ * Requester-relative visibility of one mentioned event.
+ */
+export type CalendarMentionPreviewKind = 'access' | 'no_access' | 'does_not_exist';
+
+/**
+ * Batch calendar mention preview request.
+ */
+export type CalendarMentionPreviewRequest = {
+ /**
+ * Mentioned events to resolve, at most 100.
+ */
+ items: Array<CalendarMentionPreviewRequestItem>;
+};
+
+/**
+ * One mentioned event to resolve for the requester.
+ */
+export type CalendarMentionPreviewRequestItem = {
+ /**
+ * Mentioned calendar event id.
+ */
+ eventId: string;
+ /**
+ * Occurrence the mention points at, when it targets one instance.
+ */
+ occurrenceKey?: string | null;
+};
+
+/**
+ * Batch calendar mention preview response.
+ */
+export type CalendarMentionPreviewResponse = {
+ items: Array<CalendarMentionPreviewItem>;
+};
+
/**
* A materialized recurrence instance optimized for range queries.
*/
@@ -8562,6 +8664,37 @@ export type ListOccurrencesResponses = {
export type ListOccurrencesResponse = ListOccurrencesResponses[keyof ListOccurrencesResponses];
+export type MentionPreviewsData = {
+ body: CalendarMentionPreviewRequest;
+ path?: never;
+ query?: never;
+ url: '/calendar-events/preview';
+};
+
+export type MentionPreviewsErrors = {
+ /**
+ * Too many events in one request
+ */
+ 400: unknown;
+ /**
+ * Authentication required
+ */
+ 401: unknown;
+ /**
+ * Calendar query failed
+ */
+ 500: unknown;
+};
+
+export type MentionPreviewsResponses = {
+ /**
+ * Requester-relative previews for the mentioned events
+ */
+ 200: CalendarMentionPreviewResponse;
+};
+
+export type MentionPreviewsResponse = MentionPreviewsResponses[keyof MentionPreviewsResponses];
+
export type GetBatchCallRecordPreviewData = {
body: GetBatchCallRecordPreviewRequest;
path?: never;
diff --git a/packages/sdk/specs/storage.json b/packages/sdk/specs/storage.json
index 5739185e6e..7569f3c864 100644
--- a/packages/sdk/specs/storage.json
+++ b/packages/sdk/specs/storage.json
@@ -798,6 +798,44 @@
}
}
},
+ "/calendar-events/preview": {
+ "post": {
+ "tags": ["calendar_events"],
+ "summary": "Resolve mentioned calendar events to the requester's own projections.",
+ "operationId": "mention_previews",
+ "requestBody": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/CalendarMentionPreviewRequest"
+ }
+ }
+ },
+ "required": true
+ },
+ "responses": {
+ "200": {
+ "description": "Requester-relative previews for the mentioned events",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/CalendarMentionPreviewResponse"
+ }
+ }
+ }
+ },
+ "400": {
+ "description": "Too many events in one request"
+ },
+ "401": {
+ "description": "Authentication required"
+ },
+ "500": {
+ "description": "Calendar query failed"
+ }
+ }
+ }
+ },
"/call/record/preview": {
"post": {
"tags": ["call::inbound::axum_router"],
@@ -12948,6 +12986,138 @@
}
}
},
+ "CalendarMentionEvent": {
+ "type": "object",
+ "description": "Meeting-level fields shown in a calendar event mention preview, taken from\nthe requester's own projection of the meeting.",
+ "required": [
+ "viewerEventId",
+ "title",
+ "time",
+ "isRecurring",
+ "attendeeCount",
+ "updatedAt"
+ ],
+ "properties": {
+ "attendeeCount": {
+ "type": "integer",
+ "description": "Number of attendees on the requester's copy.",
+ "minimum": 0
+ },
+ "isRecurring": {
+ "type": "boolean",
+ "description": "Whether the event repeats."
+ },
+ "location": {
+ "type": ["string", "null"],
+ "description": "Location label, when set."
+ },
+ "occurrenceKey": {
+ "type": ["string", "null"],
+ "description": "Key of the previewed instance, absent when no occurrence is\nmaterialized."
+ },
+ "organizerEmail": {
+ "type": ["string", "null"],
+ "description": "Organizer email."
+ },
+ "organizerName": {
+ "type": ["string", "null"],
+ "description": "Organizer display name."
+ },
+ "time": {
+ "$ref": "#/components/schemas/EventTime",
+ "description": "Time of the previewed instance: the requested occurrence when it\nexists, else the next upcoming one, else the latest past one, else the\nseries start."
+ },
+ "title": {
+ "type": "string",
+ "description": "Display title."
+ },
+ "updatedAt": {
+ "type": "string",
+ "format": "date-time",
+ "description": "Entity update time of the requester's copy."
+ },
+ "viewerEventId": {
+ "type": "string",
+ "format": "uuid",
+ "description": "The requester's own event entity for the mentioned meeting. Differs\nfrom the mentioned id when the mention came from another attendee."
+ }
+ }
+ },
+ "CalendarMentionPreviewItem": {
+ "type": "object",
+ "description": "Resolution of one mentioned event, in request order.",
+ "required": ["eventId", "type"],
+ "properties": {
+ "event": {
+ "oneOf": [
+ {
+ "type": "null"
+ },
+ {
+ "$ref": "#/components/schemas/CalendarMentionEvent",
+ "description": "Preview of the requester's own copy, present only with access."
+ }
+ ]
+ },
+ "eventId": {
+ "type": "string",
+ "format": "uuid",
+ "description": "The mentioned event id, echoed from the request."
+ },
+ "type": {
+ "$ref": "#/components/schemas/CalendarMentionPreviewKind",
+ "description": "Visibility of the mentioned event to the requester."
+ }
+ }
+ },
+ "CalendarMentionPreviewKind": {
+ "type": "string",
+ "description": "Requester-relative visibility of one mentioned event.",
+ "enum": ["access", "no_access", "does_not_exist"]
+ },
+ "CalendarMentionPreviewRequest": {
+ "type": "object",
+ "description": "Batch calendar mention preview request.",
+ "required": ["items"],
+ "properties": {
+ "items": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/CalendarMentionPreviewRequestItem"
+ },
+ "description": "Mentioned events to resolve, at most 100."
+ }
+ }
+ },
+ "CalendarMentionPreviewRequestItem": {
+ "type": "object",
+ "description": "One mentioned event to resolve for the requester.",
+ "required": ["eventId"],
+ "properties": {
+ "eventId": {
+ "type": "string",
+ "format": "uuid",
+ "description": "Mentioned calendar event id."
+ },
+ "occurrenceKey": {
+ "type": ["string", "null"],
+ "description": "Occurrence the mention points at, when it targets one instance."
+ }
+ }
+ },
+ "CalendarMentionPreviewResponse": {
+ "type": "object",
+ "description": "Batch calendar mention preview response.",
+ "required": ["items"],
+ "properties": {
+ "items": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/CalendarMentionPreviewItem"
+ }
+ }
+ }
+ },
"CalendarOccurrence": {
"type": "object",
"description": "A materialized recurrence instance optimized for range queries.",
diff --git a/packages/sdk/src/coverage/skipped.ts b/packages/sdk/src/coverage/skipped.ts
index 9910fd2d01..de79873907 100644
--- a/packages/sdk/src/coverage/skipped.ts
+++ b/packages/sdk/src/coverage/skipped.ts
@@ -277,6 +277,7 @@ export const storageExcluded = [
'joinChannelByCode',
'jobProcessingResultHandler',
'leaveOrEndCall',
+ 'mentionPreviews',
'patchViewHandler',
'postChannelMessages',
'postItemsSoup',
diff --git a/services/document_storage_service/src/api/swagger.rs b/services/document_storage_service/src/api/swagger.rs
index 260c65ed17..d3e28afa5e 100644
--- a/services/document_storage_service/src/api/swagger.rs
+++ b/services/document_storage_service/src/api/swagger.rs
@@ -141,6 +141,7 @@ use utoipa::OpenApi;
paths(
health::health_handler,
calendar_events::inbound::axum_router::list_occurrences,
+ calendar_events::inbound::axum_router::mention_previews,
// annotations
annotations::get::get_document_comments_handler,
@@ -427,6 +428,12 @@ use utoipa::OpenApi;
SyncServiceVersionID,
calendar_events::inbound::axum_router::CalendarOccurrenceItem,
calendar_events::inbound::axum_router::CalendarOccurrenceResponse,
+ calendar_events::inbound::axum_router::CalendarMentionPreviewRequest,
+ calendar_events::inbound::axum_router::CalendarMentionPreviewRequestItem,
+ calendar_events::inbound::axum_router::CalendarMentionPreviewResponse,
+ calendar_events::inbound::axum_router::CalendarMentionPreviewItem,
+ calendar_events::inbound::axum_router::CalendarMentionPreviewKind,
+ calendar_events::domain::models::CalendarMentionEvent,
calendar_events::domain::models::CalendarSyncStatus,
SoupItemWithProperties,
SoupApiItem,