Macro is a unified workspace for teams: email, chat, docs, tasks, agents, calls, and CRM — @-linked together with shared AI memory.
TypeScript agentaiai-agentsall-in-onecrmcrm-systememaillinearmcpmessagingnotesnotionofficerustslackslack-alternativestartupstartup-toolstypescriptworkspace
Seanaye/feat/soup threads 1 (#4165)
Sean Aye9687b284c423
diff --git a/js/app/packages/app/component/next-soup/filters/query-filters.ts b/js/app/packages/app/component/next-soup/filters/query-filters.tsindex d0427df2bc..9f276cd70c 100644--- a/js/app/packages/app/component/next-soup/filters/query-filters.ts+++ b/js/app/packages/app/component/next-soup/filters/query-filters.ts@@ -81,6 +81,11 @@ export function filterSoupItemByRequestBody(({ data }) =>!isIdFilteredOut(body.channel_filters?.channel_ids, data.channel.id))+ .with(+ { tag: 'channelThread' },+ ({ data }) =>+ !isIdFilteredOut(body.channel_filters?.channel_ids, data.channel_id)+ ).with({ tag: 'project' },({ data }) => !isIdFilteredOut(body.project_filters?.project_ids, data.id)diff --git a/js/app/packages/queries/notification/user-notifications.ts b/js/app/packages/queries/notification/user-notifications.tsindex 4bbfa9851f..4649d75b40 100644--- a/js/app/packages/queries/notification/user-notifications.ts+++ b/js/app/packages/queries/notification/user-notifications.ts@@ -546,6 +546,7 @@ function notificationEntityTypeToSoupTag('user','team','call',+ 'channel_message','static_file','crm_company','crm_contact'diff --git a/js/app/packages/queries/properties/entity.ts b/js/app/packages/queries/properties/entity.tsindex b0a30e688a..2c4d4ed5ab 100644--- a/js/app/packages/queries/properties/entity.ts+++ b/js/app/packages/queries/properties/entity.ts@@ -89,6 +89,7 @@ function optimisticUpdateSoupEntityProperty(current.tag === 'call' ||current.tag === 'crmCompany' ||current.tag === 'foreignEntity' ||+ current.tag === 'channelThread' ||!current.data.properties) {return undefined;diff --git a/js/app/packages/queries/soup/normalized-cache/normalizer.ts b/js/app/packages/queries/soup/normalized-cache/normalizer.tsindex f21d9616f8..6d76fbb6dd 100644--- a/js/app/packages/queries/soup/normalized-cache/normalizer.ts+++ b/js/app/packages/queries/soup/normalized-cache/normalizer.ts@@ -28,6 +28,7 @@ export const getNormalizationObjectKey = (const channel = data?.channel as Record<string, unknown> | undefined;return channel?.id ? soupNormKey(channel.id as string) : undefined;}+ if (obj.tag === 'channelThread') return undefined;return data?.id ? soupNormKey(data.id as string) : undefined;}return undefined;diff --git a/js/app/packages/queries/soup/normalized-cache/operations.ts b/js/app/packages/queries/soup/normalized-cache/operations.tsindex 516d734f0a..1900700d82 100644--- a/js/app/packages/queries/soup/normalized-cache/operations.ts+++ b/js/app/packages/queries/soup/normalized-cache/operations.ts@@ -74,6 +74,8 @@ function cancelSoupQueries() {export function optimisticUpdateSoupEntity<T extends SoupEntityTag>(partial: SoupEntityPartial<T>): SoupTransaction {+ if (partial.tag === 'channelThread') return { rollback: () => {} };+cancelSoupQueries();const normalizer = getSoupNormalizer();@@ -147,6 +149,8 @@ export function getSoupItemId(item: SoupApiItem): string {return item.data.channel.id;case 'call':return item.data.callId;+ case 'channelThread':+ return item.data.root_message.message_id;default:return item.data.id;}@@ -158,6 +162,8 @@ export function getSoupItemId(item: SoupApiItem): string {* and upsert into each resolvable group. Date / unresolved labels invalidate.*/export function insertSoupEntity(item: SoupApiItem): SoupTransaction {+ if (item.tag === 'channelThread') return { rollback: () => {} };+cancelSoupQueries();const previous = snapshotSoup();@@ -339,6 +345,8 @@ export async function refetchSoupEntity(entityType: SoupEntityTag,options?: { includeRoot?: boolean }): Promise<void> {+ if (entityType === 'channelThread') return;+const { storageServiceClient } = await import('@service-storage/client');const filter = buildSingleEntityFilter(entityType, entityId, options);@@ -360,6 +368,8 @@ export async function refetchSoupEntity(if (!page.items.length) return;for (const item of page.items) {+ if (item.tag === 'channelThread') continue;+const itemId = getSoupItemId(item);if (hasSoupEntity(itemId)) {optimisticUpdateSoupEntity(item);@@ -413,6 +423,7 @@ export function buildSingleEntityFilter(...base,foreign_entity_filters: { ids: [entityId] },}))+ .with('channelThread', () => base).exhaustive();}@@ -437,8 +448,12 @@ export function optimisticUpdateSoupItemViewedAt(itemId: string) {data: { channel: { id: itemId }, viewed_at: now },frecency_score: current.frecency_score,});- } else if (current.tag === 'call' || current.tag === 'foreignEntity') {- // Call records and foreign entities don't have viewedAt — skip.+ } else if (+ current.tag === 'call' ||+ current.tag === 'foreignEntity' ||+ current.tag === 'channelThread'+ ) {+ // Call records, foreign entities, and channel threads don't have viewedAt — skip.return;} else {optimisticUpdateSoupEntity({@@ -475,8 +490,8 @@ export function optimisticUpdateSoupItemUpdatedAt(data: { channel: { id: itemId, updated_at: updatedAt } },frecency_score: current.frecency_score,});- } else if (current.tag === 'call') {- // Call records use endedAt/startedAt, not updatedAt — skip optimistic timestamp updates.+ } else if (current.tag === 'call' || current.tag === 'channelThread') {+ // Call records use endedAt/startedAt and channel threads nest message timestamps — skip.return;} else {if (!shouldUpdateOptimisticTimestamp(current.data.updatedAt, updatedAt))diff --git a/js/app/packages/queries/soup/normalized-cache/types.ts b/js/app/packages/queries/soup/normalized-cache/types.tsindex b573f5d9e5..566f46ff9b 100644--- a/js/app/packages/queries/soup/normalized-cache/types.ts+++ b/js/app/packages/queries/soup/normalized-cache/types.ts@@ -13,6 +13,7 @@ type SoupItemData<T extends SoupEntityTag> = Extract<// Channel's inner Channel object (for partial nested updates like { channel: { id, name } })type ChannelInner = SoupItemData<'channel'>['channel'];+type ChannelThreadRootMessage = SoupItemData<'channelThread'>['root_message'];// Partial data: require the entity ID, all else optional.// Channel is special — ID lives at data.channel.id.@@ -22,7 +23,12 @@ type SoupPartialData<T extends SoupEntityTag> = T extends 'channel'>: T extends 'call'? Partial<SoupItemData<'call'>> & { callId: string }- : Partial<SoupItemData<T>> & { id: string };+ : T extends 'channelThread'+ ? {+ root_message: Partial<ChannelThreadRootMessage> &+ Pick<ChannelThreadRootMessage, 'message_id'>;+ } & Partial<Omit<SoupItemData<'channelThread'>, 'root_message'>>+ : Partial<SoupItemData<T>> & { id: string };// A partial soup entity for optimistic updates.export type SoupEntityPartial<T extends SoupEntityTag = SoupEntityTag> = {diff --git a/js/app/packages/queries/soup/recently-viewed.ts b/js/app/packages/queries/soup/recently-viewed.tsindex 725775c945..72cf73eee9 100644--- a/js/app/packages/queries/soup/recently-viewed.ts+++ b/js/app/packages/queries/soup/recently-viewed.ts@@ -50,7 +50,11 @@ export function useRecentlyViewedSoupQuery() {}));return page.items.flatMap((item): RecentlyViewedItem[] => {- if (item.tag === 'call' || item.tag === 'foreignEntity') {+ if (+ item.tag === 'call' ||+ item.tag === 'foreignEntity' ||+ item.tag === 'channelThread'+ ) {return [];}diff --git a/js/app/packages/queries/soup/transform-utils.ts b/js/app/packages/queries/soup/transform-utils.tsindex f010e6300f..815c49a974 100644--- a/js/app/packages/queries/soup/transform-utils.ts+++ b/js/app/packages/queries/soup/transform-utils.ts@@ -54,9 +54,12 @@ type InnerSearchResult =| ProjectSearchResult| CallRecordSearchResult;-// Every soup tag is handled by the map below (companies and foreign/GitHub-PR-// entities included), so nothing is excluded here.-type DisplayableSoupItem = SoupPage['items'][number];+// Channel thread soup items are currently only exposed to AI tooling; the app+// entity list does not have enough channel metadata to render them directly.+type DisplayableSoupItem = Exclude<+ SoupPage['items'][number],+ { tag: 'channelThread' }+>;type SoupEntity =| DocumentEntity@@ -511,8 +514,8 @@ const resolveDocumentEntityName = (};export const isDisplayableSoupItem = (- _: SoupPage['items'][number]-): _ is DisplayableSoupItem => true;+ item: SoupPage['items'][number]+): item is DisplayableSoupItem => item.tag !== 'channelThread';/*** The email soup query encodes "no sort timestamp" — e.g. a never-viewed thread@@ -750,6 +753,8 @@ export const mapSoupPageToEntityList: () => SoupEntity[] = (data, options) => {return data.items.filter((item): item is DisplayableSoupItem => {+ if (!isDisplayableSoupItem(item)) return false;+if (item.tag === 'foreignEntity') {return (options.showSupportedForeignEntities === true &&diff --git a/js/app/packages/service-clients/service-cognition/generated/schemas/entityType.ts b/js/app/packages/service-clients/service-cognition/generated/schemas/entityType.tsindex 4cda84692d..81f0de8b36 100644--- a/js/app/packages/service-clients/service-cognition/generated/schemas/entityType.ts+++ b/js/app/packages/service-clients/service-cognition/generated/schemas/entityType.ts@@ -15,6 +15,7 @@ export const EntityType = {user: 'user',chat: 'chat',channel: 'channel',+ channel_message: 'channel_message',document: 'document',project: 'project',email_thread: 'email_thread',diff --git a/js/app/packages/service-clients/service-cognition/generated/tools/schemas.ts b/js/app/packages/service-clients/service-cognition/generated/tools/schemas.tsindex bcca21f510..1a44a48fca 100644--- a/js/app/packages/service-clients/service-cognition/generated/tools/schemas.ts+++ b/js/app/packages/service-clients/service-cognition/generated/tools/schemas.ts@@ -584,15 +584,32 @@ export const ListEntities = z.object({includeTypes: z.union([z.array(- z.enum([- 'document',- 'ai_chat',- 'project',- 'email',- 'channel',- 'call',- 'foreign_entity',- ])+ z.any().superRefine((x, ctx) => {+ const schemas = [+ z.literal('document'),+ z.literal('ai_chat'),+ z.literal('project'),+ z.literal('email'),+ z.literal('channel'),+ z.literal('call'),+ z.literal('foreign_entity'),+ ];+ const errors = schemas.reduce<z.ZodError[]>(+ (errors, schema) =>+ ((result) => (result.error ? [...errors, result.error] : errors))(+ schema.safeParse(x)+ ),+ []+ );+ if (schemas.length - errors.length !== 1) {+ ctx.addIssue({+ path: ctx.path,+ code: 'invalid_union',+ unionErrors: errors,+ message: 'Invalid input: Should pass single schema',+ });+ }+ })),z.null(),])@@ -601,7 +618,29 @@ export const ListEntities = z.object({pf: z.any().default(null),propf: z.any().default(null),sortBy: z- .enum(['recently_viewed', 'recently_updated', 'recently_created'])+ .any()+ .superRefine((x, ctx) => {+ const schemas = [+ z.literal('recently_viewed'),+ z.literal('recently_updated'),+ z.literal('recently_created'),+ ];+ const errors = schemas.reduce<z.ZodError[]>(+ (errors, schema) =>+ ((result) => (result.error ? [...errors, result.error] : errors))(+ schema.safeParse(x)+ ),+ []+ );+ if (schemas.length - errors.length !== 1) {+ ctx.addIssue({+ path: ctx.path,+ code: 'invalid_union',+ unionErrors: errors,+ message: 'Invalid input: Should pass single schema',+ });+ }+ }).optional(),});@@ -634,6 +673,11 @@ export const ListEntitiesResponse = z.object({name: z.union([z.string(), z.null()]).optional(),type: z.literal('channel'),}),+ z.object({+ channelId: z.string().uuid(),+ id: z.string().uuid(),+ type: z.literal('channelThread'),+ }),z.object({createdBy: z.string(),id: z.string().uuid(),diff --git a/js/app/packages/service-clients/service-cognition/generated/tools/types.ts b/js/app/packages/service-clients/service-cognition/generated/tools/types.tsindex 5f0e9c61c7..dedbcad5fe 100644--- a/js/app/packages/service-clients/service-cognition/generated/tools/types.ts+++ b/js/app/packages/service-clients/service-cognition/generated/tools/types.ts@@ -131,42 +131,106 @@ export type DocumentContentState = 'unknown' | 'pending' | 'ready';*/export type DocumentSubType = 'task' | 'snippet';export type EmailPreset = 'signal';+/**+ * Item returned by the list entities AI tool.+ */export type EntityItem =| {+ /**+ * Document id.+ */id: string;+ /**+ * Document name.+ */name: string;type: 'document';}| {+ /**+ * Chat id.+ */id: string;+ /**+ * Chat name.+ */name: string;type: 'aiChat';}| {+ /**+ * Project id.+ */id: string;+ /**+ * Project name.+ */name: string;type: 'project';}| {+ /**+ * Email thread id.+ */id: string;+ /**+ * Email subject, when present.+ */subject?: string | null;type: 'email';}| {+ /**+ * Channel id.+ */id: string;+ /**+ * Channel name, when present.+ */name?: string | null;type: 'channel';}| {+ /**+ * Channel id containing the thread.+ */+ channelId: string;+ /**+ * Parent message id for the thread.+ */+ id: string;+ type: 'channelThread';+ }+ | {+ /**+ * User or actor that created the call.+ */createdBy: string;+ /**+ * Call id.+ */id: string;type: 'call';}| {+ /**+ * Provider-specific foreign entity id.+ */foreignEntityId: string;+ /**+ * Provider/source name for the foreign entity.+ */foreignEntitySource: string;+ /**+ * Foreign entity row id.+ */id: string;- metadata: unknown;+ /**+ * Foreign entity metadata.+ */+ metadata: {+ [k: string]: unknown;+ };type: 'foreignEntity';};export type ToolEntityType =@@ -177,6 +241,9 @@ export type ToolEntityType =| 'thread'| 'channel'| 'user';+/**+ * Entity types that can be returned by the list entities AI tool.+ */export type ItemType =| 'document'| 'ai_chat'@@ -185,6 +252,9 @@ export type ItemType =| 'channel'| 'call'| 'foreign_entity';+/**+ * Sort order for the list entities AI tool.+ */export type SortBy =| 'recently_viewed'| 'recently_updated'@@ -1345,8 +1415,17 @@ export interface ListEntities {};sortBy?: SortBy;}+/**+ * Response returned by the list entities AI tool.+ */export interface ListEntitiesResponse {+ /**+ * Items returned for the request.+ */items: EntityItem[];+ /**+ * Human-readable summary of the returned items.+ */summary: string;}/**diff --git a/js/app/packages/service-clients/service-cognition/openapi.json b/js/app/packages/service-clients/service-cognition/openapi.jsonindex bbf788930b..e6cd82e917 100644--- a/js/app/packages/service-clients/service-cognition/openapi.json+++ b/js/app/packages/service-clients/service-cognition/openapi.json@@ -2348,6 +2348,7 @@"user","chat","channel",+ "channel_message","document","project","email_thread",diff --git a/js/app/packages/service-clients/service-connection/generated/schemas/entityType.ts b/js/app/packages/service-clients/service-connection/generated/schemas/entityType.tsindex 062e212685..17d7a9144e 100644--- a/js/app/packages/service-clients/service-connection/generated/schemas/entityType.ts+++ b/js/app/packages/service-clients/service-connection/generated/schemas/entityType.ts@@ -15,6 +15,7 @@ export const EntityType = {user: 'user',chat: 'chat',channel: 'channel',+ channel_message: 'channel_message',document: 'document',project: 'project',email_thread: 'email_thread',diff --git a/js/app/packages/service-clients/service-connection/openapi.json b/js/app/packages/service-clients/service-connection/openapi.jsonindex effc0c0de0..fab4f20dc9 100644--- a/js/app/packages/service-clients/service-connection/openapi.json+++ b/js/app/packages/service-clients/service-connection/openapi.json@@ -233,6 +233,7 @@"user","chat","channel",+ "channel_message","document","project","email_thread",diff --git a/js/app/packages/service-clients/service-notification/generated/schemas/entityType.ts b/js/app/packages/service-clients/service-notification/generated/schemas/entityType.tsindex 2a276be51a..c45592dedb 100644--- a/js/app/packages/service-clients/service-notification/generated/schemas/entityType.ts+++ b/js/app/packages/service-clients/service-notification/generated/schemas/entityType.ts@@ -15,6 +15,7 @@ export const EntityType = {user: 'user',chat: 'chat',channel: 'channel',+ channel_message: 'channel_message',document: 'document',project: 'project',email_thread: 'email_thread',diff --git a/js/app/packages/service-clients/service-notification/generated/zod.ts b/js/app/packages/service-clients/service-notification/generated/zod.tsindex b5d20556f2..41d58d2fcc 100644--- a/js/app/packages/service-clients/service-notification/generated/zod.ts+++ b/js/app/packages/service-clients/service-notification/generated/zod.ts@@ -131,6 +131,7 @@ export const listTypedNotificationsResponse = zod'user','chat','channel',+ 'channel_message','document','project','email_thread',@@ -1391,6 +1392,7 @@ export const bulkGetTypedNotificationsByEventItemIdsResponse = zod'user','chat','channel',+ 'channel_message','document','project','email_thread',@@ -2645,6 +2647,7 @@ export const getTypedNotificationsByEventItemIdResponse = zod'user','chat','channel',+ 'channel_message','document','project','email_thread',@@ -3910,6 +3913,7 @@ export const getTypedNotificationByIdResponse = zod'user','chat','channel',+ 'channel_message','document','project','email_thread',diff --git a/js/app/packages/service-clients/service-notification/openapi.json b/js/app/packages/service-clients/service-notification/openapi.jsonindex 171ce76312..6f24ed0fb1 100644--- a/js/app/packages/service-clients/service-notification/openapi.json+++ b/js/app/packages/service-clients/service-notification/openapi.json@@ -1494,6 +1494,7 @@"user","chat","channel",+ "channel_message","document","project","email_thread",diff --git a/js/app/packages/service-clients/service-storage/generated/schemas/apiEntityFilterAst.ts b/js/app/packages/service-clients/service-storage/generated/schemas/apiEntityFilterAst.tsindex 13aab72073..72dcd68acc 100644--- a/js/app/packages/service-clients/service-storage/generated/schemas/apiEntityFilterAst.ts+++ b/js/app/packages/service-clients/service-storage/generated/schemas/apiEntityFilterAst.ts@@ -5,6 +5,9 @@* OpenAPI spec version: 0.1.0*/+/**+ * Wire-format entity filter AST accepted by soup AST endpoints.+ */export interface ApiEntityFilterAst {/** the filters that should be applied to the call entity */callf?: unknown;diff --git a/js/app/packages/service-clients/service-storage/generated/schemas/channelParticipant.ts b/js/app/packages/service-clients/service-storage/generated/schemas/channelParticipant.tsindex bf6465821f..3d95e661fa 100644--- a/js/app/packages/service-clients/service-storage/generated/schemas/channelParticipant.ts+++ b/js/app/packages/service-clients/service-storage/generated/schemas/channelParticipant.ts@@ -7,10 +7,18 @@import type { ChannelParticipantLeftAt } from './channelParticipantLeftAt';import type { ParticipantRole } from './participantRole';+/**+ * A user's membership in a channel.+ */export interface ChannelParticipant {+ /** Channel id for the participant membership. */channel_id: string;+ /** Timestamp when the participant joined the channel. */joined_at: string;+ /** Timestamp when the participant left the channel, if any. */left_at?: ChannelParticipantLeftAt;+ /** Participant role in the channel. */role: ParticipantRole;+ /** Participant user id. */user_id: string;}diff --git a/js/app/packages/service-clients/service-storage/generated/schemas/channelParticipantLeftAt.ts b/js/app/packages/service-clients/service-storage/generated/schemas/channelParticipantLeftAt.tsindex 676763f6ca..2dd24245b5 100644--- a/js/app/packages/service-clients/service-storage/generated/schemas/channelParticipantLeftAt.ts+++ b/js/app/packages/service-clients/service-storage/generated/schemas/channelParticipantLeftAt.ts@@ -5,4 +5,7 @@* OpenAPI spec version: 0.1.0*/+/**+ * Timestamp when the participant left the channel, if any.+ */export type ChannelParticipantLeftAt = string | null;diff --git a/js/app/packages/service-clients/service-storage/generated/schemas/channelWithParticipants.ts b/js/app/packages/service-clients/service-storage/generated/schemas/channelWithParticipants.tsindex 03428bcc16..905a4931e0 100644--- a/js/app/packages/service-clients/service-storage/generated/schemas/channelWithParticipants.ts+++ b/js/app/packages/service-clients/service-storage/generated/schemas/channelWithParticipants.ts@@ -7,7 +7,12 @@import type { Channel } from './channel';import type { ChannelParticipant } from './channelParticipant';+/**+ * Channel metadata together with its participants.+ */export interface ChannelWithParticipants {+ /** Channel metadata. */channel: Channel;+ /** Participants in the channel. */participants: ChannelParticipant[];}diff --git a/js/app/packages/service-clients/service-storage/generated/schemas/groupedSoupPageOneOf.ts b/js/app/packages/service-clients/service-storage/generated/schemas/groupedSoupPageOneOf.tsindex 5fa2b5fef7..5f874e268a 100644--- a/js/app/packages/service-clients/service-storage/generated/schemas/groupedSoupPageOneOf.ts+++ b/js/app/packages/service-clients/service-storage/generated/schemas/groupedSoupPageOneOf.ts@@ -7,5 +7,8 @@import type { GroupedSoupInitialPage } from './groupedSoupInitialPage';import type { GroupedSoupPageOneOfAllOf } from './groupedSoupPageOneOfAllOf';+/**+ * Initial grouped response containing multiple groups.+ */export type GroupedSoupPageOneOf = GroupedSoupInitialPage &GroupedSoupPageOneOfAllOf;diff --git a/js/app/packages/service-clients/service-storage/generated/schemas/groupedSoupPageOneOfFour.ts b/js/app/packages/service-clients/service-storage/generated/schemas/groupedSoupPageOneOfFour.tsindex a6c058aed4..69f547a9f0 100644--- a/js/app/packages/service-clients/service-storage/generated/schemas/groupedSoupPageOneOfFour.ts+++ b/js/app/packages/service-clients/service-storage/generated/schemas/groupedSoupPageOneOfFour.ts@@ -7,5 +7,8 @@import type { GroupedSoupGroupPage } from './groupedSoupGroupPage';import type { GroupedSoupPageOneOfFourAllOf } from './groupedSoupPageOneOfFourAllOf';+/**+ * Follow-up response for one specific group.+ */export type GroupedSoupPageOneOfFour = GroupedSoupGroupPage &GroupedSoupPageOneOfFourAllOf;diff --git a/js/app/packages/service-clients/service-storage/generated/schemas/index.ts b/js/app/packages/service-clients/service-storage/generated/schemas/index.tsindex e528d8cc1f..4d18f0a426 100644--- a/js/app/packages/service-clients/service-storage/generated/schemas/index.ts+++ b/js/app/packages/service-clients/service-storage/generated/schemas/index.ts@@ -844,6 +844,7 @@ export * from './soupChannel';export * from './soupChannelAllOf';export * from './soupChannelAllOfInteractedAt';export * from './soupChannelAllOfViewedAt';+export * from './soupChannelThread';export * from './soupChat';export * from './soupChatDeletedAt';export * from './soupChatProjectId';@@ -895,6 +896,8 @@ export * from './soupItemOneOfOnefive';export * from './soupItemOneOfOnefiveTag';export * from './soupItemOneOfOneone';export * from './soupItemOneOfOneoneTag';+export * from './soupItemOneOfOneseven';+export * from './soupItemOneOfOnesevenTag';export * from './soupItemOneOfOnethree';export * from './soupItemOneOfOnethreeTag';export * from './soupItemOneOfSeven';diff --git a/js/app/packages/service-clients/service-storage/generated/schemas/params.ts b/js/app/packages/service-clients/service-storage/generated/schemas/params.tsindex 2f063c627e..3f49dbde80 100644--- a/js/app/packages/service-clients/service-storage/generated/schemas/params.ts+++ b/js/app/packages/service-clients/service-storage/generated/schemas/params.ts@@ -8,6 +8,9 @@ import type { ParamsExpand } from './paramsExpand';import type { ParamsLimit } from './paramsLimit';import type { ParamsSortMethod } from './paramsSortMethod';+/**+ * Query parameters shared by soup endpoints.+ */export interface Params {/** Whether to expand projects. Defaults to true. */expand?: ParamsExpand;diff --git a/js/app/packages/service-clients/service-storage/generated/schemas/postGroupedSoupAstRequestOneOf.ts b/js/app/packages/service-clients/service-storage/generated/schemas/postGroupedSoupAstRequestOneOf.tsindex 2283a1ee51..09349b950e 100644--- a/js/app/packages/service-clients/service-storage/generated/schemas/postGroupedSoupAstRequestOneOf.ts+++ b/js/app/packages/service-clients/service-storage/generated/schemas/postGroupedSoupAstRequestOneOf.ts@@ -7,5 +7,8 @@import type { PostGroupedSoupAstInitialRequest } from './postGroupedSoupAstInitialRequest';import type { PostGroupedSoupAstRequestOneOfAllOf } from './postGroupedSoupAstRequestOneOfAllOf';+/**+ * Initial grouped soup request.+ */export type PostGroupedSoupAstRequestOneOf = PostGroupedSoupAstInitialRequest &PostGroupedSoupAstRequestOneOfAllOf;diff --git a/js/app/packages/service-clients/service-storage/generated/schemas/postGroupedSoupAstRequestOneOfFour.ts b/js/app/packages/service-clients/service-storage/generated/schemas/postGroupedSoupAstRequestOneOfFour.tsindex a5bbbee1a6..2830f8b270 100644--- a/js/app/packages/service-clients/service-storage/generated/schemas/postGroupedSoupAstRequestOneOfFour.ts+++ b/js/app/packages/service-clients/service-storage/generated/schemas/postGroupedSoupAstRequestOneOfFour.ts@@ -7,5 +7,8 @@import type { PostGroupedSoupAstGroupPageRequest } from './postGroupedSoupAstGroupPageRequest';import type { PostGroupedSoupAstRequestOneOfFourAllOf } from './postGroupedSoupAstRequestOneOfFourAllOf';+/**+ * Request for a page within one group.+ */export type PostGroupedSoupAstRequestOneOfFour =PostGroupedSoupAstGroupPageRequest & PostGroupedSoupAstRequestOneOfFourAllOf;diff --git a/js/app/packages/service-clients/service-storage/generated/schemas/postSoupAstRequest.ts b/js/app/packages/service-clients/service-storage/generated/schemas/postSoupAstRequest.tsindex 9a69d3a1a2..a31658440e 100644--- a/js/app/packages/service-clients/service-storage/generated/schemas/postSoupAstRequest.ts+++ b/js/app/packages/service-clients/service-storage/generated/schemas/postSoupAstRequest.ts@@ -8,6 +8,9 @@ import type { ApiEntityFilterAst } from './apiEntityFilterAst';import type { Params } from './params';import type { PostSoupAstRequestAllOf } from './postSoupAstRequestAllOf';+/**+ * Request body for the AST soup endpoint.+ */export type PostSoupAstRequest = ApiEntityFilterAst &Params &PostSoupAstRequestAllOf;diff --git a/js/app/packages/service-clients/service-storage/generated/schemas/postSoupRequest.ts b/js/app/packages/service-clients/service-storage/generated/schemas/postSoupRequest.tsindex aeb92cae5d..77ab604a5a 100644--- a/js/app/packages/service-clients/service-storage/generated/schemas/postSoupRequest.ts+++ b/js/app/packages/service-clients/service-storage/generated/schemas/postSoupRequest.ts@@ -8,4 +8,7 @@ import type { EntityFilters } from './entityFilters';import type { Params } from './params';import type { PostSoupRequestAllOf } from './postSoupRequestAllOf';+/**+ * Request body for the typed soup endpoint.+ */export type PostSoupRequest = EntityFilters & Params & PostSoupRequestAllOf;diff --git a/js/app/packages/service-clients/service-storage/generated/schemas/soupApiItem.ts b/js/app/packages/service-clients/service-storage/generated/schemas/soupApiItem.tsindex e286dcd667..d203a043b8 100644--- a/js/app/packages/service-clients/service-storage/generated/schemas/soupApiItem.ts+++ b/js/app/packages/service-clients/service-storage/generated/schemas/soupApiItem.ts@@ -8,4 +8,7 @@import type { SoupApiItemAllOf } from './soupApiItemAllOf';import type { SoupItem } from './soupItem';+/**+ * API representation of a soup item with its frecency score.+ */export type SoupApiItem = SoupItem & SoupApiItemAllOf;diff --git a/js/app/packages/service-clients/service-storage/generated/schemas/soupApiSort.ts b/js/app/packages/service-clients/service-storage/generated/schemas/soupApiSort.tsindex cebdeec287..730cfcad88 100644--- a/js/app/packages/service-clients/service-storage/generated/schemas/soupApiSort.ts+++ b/js/app/packages/service-clients/service-storage/generated/schemas/soupApiSort.ts@@ -5,6 +5,9 @@* OpenAPI spec version: 0.1.0*/+/**+ * Sort options accepted by non-grouped soup API endpoints.+ */export type SoupApiSort = (typeof SoupApiSort)[keyof typeof SoupApiSort];// eslint-disable-next-line @typescript-eslint/no-redeclarediff --git a/js/app/packages/service-clients/service-storage/generated/schemas/soupAttachment.ts b/js/app/packages/service-clients/service-storage/generated/schemas/soupAttachment.tsindex fc18beb195..f2f1730589 100644--- a/js/app/packages/service-clients/service-storage/generated/schemas/soupAttachment.ts+++ b/js/app/packages/service-clients/service-storage/generated/schemas/soupAttachment.ts@@ -10,13 +10,24 @@ import type { SoupAttachmentMimeType } from './soupAttachmentMimeType';import type { SoupAttachmentProviderAttachmentId } from './soupAttachmentProviderAttachmentId';import type { SoupAttachmentSizeBytes } from './soupAttachmentSizeBytes';+/**+ * An email attachment as displayed in Soup.+ */export interface SoupAttachment {+ /** Content id for inline attachments. */contentId?: SoupAttachmentContentId;+ /** Timestamp when the attachment was created. */createdAt: string;+ /** Attachment filename. */filename?: SoupAttachmentFilename;+ /** Attachment id. */id: string;+ /** Message id that owns this attachment. */messageId: string;+ /** Attachment MIME type. */mimeType?: SoupAttachmentMimeType;+ /** Provider-specific attachment id. */providerAttachmentId?: SoupAttachmentProviderAttachmentId;+ /** Attachment size in bytes. */sizeBytes?: SoupAttachmentSizeBytes;}diff --git a/js/app/packages/service-clients/service-storage/generated/schemas/soupAttachmentContentId.ts b/js/app/packages/service-clients/service-storage/generated/schemas/soupAttachmentContentId.tsindex 25bee058ac..0cc29cef98 100644--- a/js/app/packages/service-clients/service-storage/generated/schemas/soupAttachmentContentId.ts+++ b/js/app/packages/service-clients/service-storage/generated/schemas/soupAttachmentContentId.ts@@ -5,4 +5,7 @@* OpenAPI spec version: 0.1.0*/+/**+ * Content id for inline attachments.+ */export type SoupAttachmentContentId = string | null;diff --git a/js/app/packages/service-clients/service-storage/generated/schemas/soupAttachmentFilename.ts b/js/app/packages/service-clients/service-storage/generated/schemas/soupAttachmentFilename.tsindex 15a8bff2d5..354f2cb53f 100644--- a/js/app/packages/service-clients/service-storage/generated/schemas/soupAttachmentFilename.ts+++ b/js/app/packages/service-clients/service-storage/generated/schemas/soupAttachmentFilename.ts@@ -5,4 +5,7 @@* OpenAPI spec version: 0.1.0*/+/**+ * Attachment filename.+ */export type SoupAttachmentFilename = string | null;diff --git a/js/app/packages/service-clients/service-storage/generated/schemas/soupAttachmentMimeType.ts b/js/app/packages/service-clients/service-storage/generated/schemas/soupAttachmentMimeType.tsindex afee6e0138..166c33a448 100644--- a/js/app/packages/service-clients/service-storage/generated/schemas/soupAttachmentMimeType.ts+++ b/js/app/packages/service-clients/service-storage/generated/schemas/soupAttachmentMimeType.ts@@ -5,4 +5,7 @@* OpenAPI spec version: 0.1.0*/+/**+ * Attachment MIME type.+ */export type SoupAttachmentMimeType = string | null;diff --git a/js/app/packages/service-clients/service-storage/generated/schemas/soupAttachmentProviderAttachmentId.ts b/js/app/packages/service-clients/service-storage/generated/schemas/soupAttachmentProviderAttachmentId.tsindex 0fa8217e9d..bd36a92280 100644--- a/js/app/packages/service-clients/service-storage/generated/schemas/soupAttachmentProviderAttachmentId.ts+++ b/js/app/packages/service-clients/service-storage/generated/schemas/soupAttachmentProviderAttachmentId.ts@@ -5,4 +5,7 @@* OpenAPI spec version: 0.1.0*/+/**+ * Provider-specific attachment id.+ */export type SoupAttachmentProviderAttachmentId = string | null;diff --git a/js/app/packages/service-clients/service-storage/generated/schemas/soupAttachmentSizeBytes.ts b/js/app/packages/service-clients/service-storage/generated/schemas/soupAttachmentSizeBytes.tsindex 14170caf22..55150531c3 100644--- a/js/app/packages/service-clients/service-storage/generated/schemas/soupAttachmentSizeBytes.ts+++ b/js/app/packages/service-clients/service-storage/generated/schemas/soupAttachmentSizeBytes.ts@@ -5,4 +5,7 @@* OpenAPI spec version: 0.1.0*/+/**+ * Attachment size in bytes.+ */export type SoupAttachmentSizeBytes = number | null;diff --git a/js/app/packages/service-clients/service-storage/generated/schemas/soupChannel.ts b/js/app/packages/service-clients/service-storage/generated/schemas/soupChannel.tsindex 8b6ad34dea..86fcaad186 100644--- a/js/app/packages/service-clients/service-storage/generated/schemas/soupChannel.ts+++ b/js/app/packages/service-clients/service-storage/generated/schemas/soupChannel.ts@@ -8,6 +8,9 @@ import type { ChannelWithParticipants } from './channelWithParticipants';import type { LatestMessage } from './latestMessage';import type { SoupChannelAllOf } from './soupChannelAllOf';+/**+ * A channel as displayed in Soup.+ */export type SoupChannel = ChannelWithParticipants &LatestMessage &SoupChannelAllOf;diff --git a/js/app/packages/service-clients/service-storage/generated/schemas/soupChannelAllOf.ts b/js/app/packages/service-clients/service-storage/generated/schemas/soupChannelAllOf.tsindex 03dfa32c72..dd04826088 100644--- a/js/app/packages/service-clients/service-storage/generated/schemas/soupChannelAllOf.ts+++ b/js/app/packages/service-clients/service-storage/generated/schemas/soupChannelAllOf.ts@@ -8,6 +8,8 @@ import type { SoupChannelAllOfInteractedAt } from './soupChannelAllOfInteractedAimport type { SoupChannelAllOfViewedAt } from './soupChannelAllOfViewedAt';export type SoupChannelAllOf = {+ /** Timestamp when the requesting user last interacted with this channel. */interacted_at?: SoupChannelAllOfInteractedAt;+ /** Timestamp when the requesting user last viewed this channel. */viewed_at?: SoupChannelAllOfViewedAt;};diff --git a/js/app/packages/service-clients/service-storage/generated/schemas/soupChannelAllOfInteractedAt.ts b/js/app/packages/service-clients/service-storage/generated/schemas/soupChannelAllOfInteractedAt.tsindex cec26b4014..77ff65a21f 100644--- a/js/app/packages/service-clients/service-storage/generated/schemas/soupChannelAllOfInteractedAt.ts+++ b/js/app/packages/service-clients/service-storage/generated/schemas/soupChannelAllOfInteractedAt.ts@@ -5,4 +5,7 @@* OpenAPI spec version: 0.1.0*/+/**+ * Timestamp when the requesting user last interacted with this channel.+ */export type SoupChannelAllOfInteractedAt = string | null;diff --git a/js/app/packages/service-clients/service-storage/generated/schemas/soupChannelAllOfViewedAt.ts b/js/app/packages/service-clients/service-storage/generated/schemas/soupChannelAllOfViewedAt.tsindex ea8005cb9d..df4b112512 100644--- a/js/app/packages/service-clients/service-storage/generated/schemas/soupChannelAllOfViewedAt.ts+++ b/js/app/packages/service-clients/service-storage/generated/schemas/soupChannelAllOfViewedAt.ts@@ -5,4 +5,7 @@* OpenAPI spec version: 0.1.0*/+/**+ * Timestamp when the requesting user last viewed this channel.+ */export type SoupChannelAllOfViewedAt = string | null;diff --git a/js/app/packages/service-clients/service-storage/generated/schemas/soupChannelThread.ts b/js/app/packages/service-clients/service-storage/generated/schemas/soupChannelThread.tsnew file mode 100644index 0000000000..ced30d8599--- /dev/null+++ b/js/app/packages/service-clients/service-storage/generated/schemas/soupChannelThread.ts@@ -0,0 +1,22 @@+/**+ * Generated by orval v7.21.0 🍺+ * Do not edit manually.+ * document_storage_service+ * OpenAPI spec version: 0.1.0+ */+import type { ChannelMessage } from './channelMessage';++/**+ * A top-level channel message thread for soup payloads.++This reuses the existing lightweight [`ChannelMessage`] shape used by+[`SoupChannel`] latest-message data.+ */+export interface SoupChannelThread {+ /** Channel that owns the thread. */+ channel_id: string;+ /** Thread replies, using the same lightweight channel message shape. */+ messages: ChannelMessage[];+ /** Top-level message that acts as the thread parent. */+ root_message: ChannelMessage;+}diff --git a/js/app/packages/service-clients/service-storage/generated/schemas/soupChat.ts b/js/app/packages/service-clients/service-storage/generated/schemas/soupChat.tsindex 984bdf8f17..33ae67a09f 100644--- a/js/app/packages/service-clients/service-storage/generated/schemas/soupChat.ts+++ b/js/app/packages/service-clients/service-storage/generated/schemas/soupChat.ts@@ -9,6 +9,9 @@ import type { SoupChatProjectId } from './soupChatProjectId';import type { SoupChatViewedAt } from './soupChatViewedAt';import type { SoupProperty } from './soupProperty';+/**+ * A chat as displayed in Soup.+ */export interface SoupChat {/** The time the chat was created */createdAt: string;diff --git a/js/app/packages/service-clients/service-storage/generated/schemas/soupContact.ts b/js/app/packages/service-clients/service-storage/generated/schemas/soupContact.tsindex f27294f305..854f8b378f 100644--- a/js/app/packages/service-clients/service-storage/generated/schemas/soupContact.ts+++ b/js/app/packages/service-clients/service-storage/generated/schemas/soupContact.ts@@ -8,10 +8,18 @@ import type { SoupContactEmailAddress } from './soupContactEmailAddress';import type { SoupContactName } from './soupContactName';import type { SoupContactSfsPhotoUrl } from './soupContactSfsPhotoUrl';+/**+ * A contact participating in an email thread as displayed in Soup.+ */export interface SoupContact {+ /** Contact email address. */emailAddress?: SoupContactEmailAddress;+ /** Contact id. */id: string;+ /** Connected account link id for the contact. */linkId: string;+ /** Contact display name. */name?: SoupContactName;+ /** Contact photo URL from SFS, if available. */sfsPhotoUrl?: SoupContactSfsPhotoUrl;}diff --git a/js/app/packages/service-clients/service-storage/generated/schemas/soupContactEmailAddress.ts b/js/app/packages/service-clients/service-storage/generated/schemas/soupContactEmailAddress.tsindex 6acea123b0..187775dd1e 100644--- a/js/app/packages/service-clients/service-storage/generated/schemas/soupContactEmailAddress.ts+++ b/js/app/packages/service-clients/service-storage/generated/schemas/soupContactEmailAddress.ts@@ -5,4 +5,7 @@* OpenAPI spec version: 0.1.0*/+/**+ * Contact email address.+ */export type SoupContactEmailAddress = string | null;diff --git a/js/app/packages/service-clients/service-storage/generated/schemas/soupContactName.ts b/js/app/packages/service-clients/service-storage/generated/schemas/soupContactName.tsindex 2547d2b25d..3ceee99e1e 100644--- a/js/app/packages/service-clients/service-storage/generated/schemas/soupContactName.ts+++ b/js/app/packages/service-clients/service-storage/generated/schemas/soupContactName.ts@@ -5,4 +5,7 @@* OpenAPI spec version: 0.1.0*/+/**+ * Contact display name.+ */export type SoupContactName = string | null;diff --git a/js/app/packages/service-clients/service-storage/generated/schemas/soupContactSfsPhotoUrl.ts b/js/app/packages/service-clients/service-storage/generated/schemas/soupContactSfsPhotoUrl.tsindex a1500682b0..f8ea79bb3f 100644--- a/js/app/packages/service-clients/service-storage/generated/schemas/soupContactSfsPhotoUrl.ts+++ b/js/app/packages/service-clients/service-storage/generated/schemas/soupContactSfsPhotoUrl.ts@@ -5,4 +5,7 @@* OpenAPI spec version: 0.1.0*/+/**+ * Contact photo URL from SFS, if available.+ */export type SoupContactSfsPhotoUrl = string | null;diff --git a/js/app/packages/service-clients/service-storage/generated/schemas/soupDocument.ts b/js/app/packages/service-clients/service-storage/generated/schemas/soupDocument.tsindex 91adf09dfa..c9b23e63a8 100644--- a/js/app/packages/service-clients/service-storage/generated/schemas/soupDocument.ts+++ b/js/app/packages/service-clients/service-storage/generated/schemas/soupDocument.ts@@ -15,6 +15,9 @@ import type { SoupDocumentSubTypeProperty } from './soupDocumentSubTypeProperty'import type { SoupDocumentViewedAt } from './soupDocumentViewedAt';import type { SoupProperty } from './soupProperty';+/**+ * A document as displayed in Soup.+ */export interface SoupDocument {/** The id of the document this document branched from */branchedFromId?: SoupDocumentBranchedFromId;diff --git a/js/app/packages/service-clients/service-storage/generated/schemas/soupEmailThreadPreview.ts b/js/app/packages/service-clients/service-storage/generated/schemas/soupEmailThreadPreview.tsindex 6ffbb7233d..3532584247 100644--- a/js/app/packages/service-clients/service-storage/generated/schemas/soupEmailThreadPreview.ts+++ b/js/app/packages/service-clients/service-storage/generated/schemas/soupEmailThreadPreview.ts@@ -13,22 +13,42 @@ import type { SoupEmailThreadPreviewSenderPhotoUrl } from './soupEmailThreadPrevimport type { SoupEmailThreadPreviewSnippet } from './soupEmailThreadPreviewSnippet';import type { SoupEmailThreadPreviewViewedAt } from './soupEmailThreadPreviewViewedAt';+/**+ * Email thread preview data as displayed in Soup.+ */export interface SoupEmailThreadPreview {+ /** Timestamp when the thread was created. */createdAt: string;+ /** Thread id. */id: string;+ /** Whether the thread should appear in the inbox. */inboxVisible: boolean;+ /** Whether the thread contains a draft. */isDraft: boolean;+ /** Whether the thread is marked important. */isImportant: boolean;+ /** Whether the thread has been read. */isRead: boolean;+ /** Thread display name or subject. */name?: SoupEmailThreadPreviewName;+ /** Owner user id. */ownerId: string;+ /** Project id associated with the thread. */projectId?: SoupEmailThreadPreviewProjectId;+ /** Provider-specific thread id. */providerId?: SoupEmailThreadPreviewProviderId;+ /** Sender email address for the preview. */senderEmail?: SoupEmailThreadPreviewSenderEmail;+ /** Sender display name for the preview. */senderName?: SoupEmailThreadPreviewSenderName;+ /** Sender photo URL for the preview. */senderPhotoUrl?: SoupEmailThreadPreviewSenderPhotoUrl;+ /** Thread snippet. */snippet?: SoupEmailThreadPreviewSnippet;+ /** Timestamp used for email thread sorting. */sortTs: string;+ /** Timestamp when the thread was last updated. */updatedAt: string;+ /** Timestamp when the requesting user last viewed the thread. */viewedAt?: SoupEmailThreadPreviewViewedAt;}diff --git a/js/app/packages/service-clients/service-storage/generated/schemas/soupEmailThreadPreviewName.ts b/js/app/packages/service-clients/service-storage/generated/schemas/soupEmailThreadPreviewName.tsindex 3e1d263b37..541d6551df 100644--- a/js/app/packages/service-clients/service-storage/generated/schemas/soupEmailThreadPreviewName.ts+++ b/js/app/packages/service-clients/service-storage/generated/schemas/soupEmailThreadPreviewName.ts@@ -5,4 +5,7 @@* OpenAPI spec version: 0.1.0*/+/**+ * Thread display name or subject.+ */export type SoupEmailThreadPreviewName = string | null;diff --git a/js/app/packages/service-clients/service-storage/generated/schemas/soupEmailThreadPreviewProjectId.ts b/js/app/packages/service-clients/service-storage/generated/schemas/soupEmailThreadPreviewProjectId.tsindex b1da0994e8..c5d90fc2c6 100644--- a/js/app/packages/service-clients/service-storage/generated/schemas/soupEmailThreadPreviewProjectId.ts+++ b/js/app/packages/service-clients/service-storage/generated/schemas/soupEmailThreadPreviewProjectId.ts@@ -5,4 +5,7 @@* OpenAPI spec version: 0.1.0*/+/**+ * Project id associated with the thread.+ */export type SoupEmailThreadPreviewProjectId = string | null;diff --git a/js/app/packages/service-clients/service-storage/generated/schemas/soupEmailThreadPreviewProviderId.ts b/js/app/packages/service-clients/service-storage/generated/schemas/soupEmailThreadPreviewProviderId.tsindex fb30786b94..b083a99702 100644--- a/js/app/packages/service-clients/service-storage/generated/schemas/soupEmailThreadPreviewProviderId.ts+++ b/js/app/packages/service-clients/service-storage/generated/schemas/soupEmailThreadPreviewProviderId.ts@@ -5,4 +5,7 @@* OpenAPI spec version: 0.1.0*/+/**+ * Provider-specific thread id.+ */export type SoupEmailThreadPreviewProviderId = string | null;diff --git a/js/app/packages/service-clients/service-storage/generated/schemas/soupEmailThreadPreviewSenderEmail.ts b/js/app/packages/service-clients/service-storage/generated/schemas/soupEmailThreadPreviewSenderEmail.tsindex 36cafefb4c..d1e0c09c4d 100644--- a/js/app/packages/service-clients/service-storage/generated/schemas/soupEmailThreadPreviewSenderEmail.ts+++ b/js/app/packages/service-clients/service-storage/generated/schemas/soupEmailThreadPreviewSenderEmail.ts@@ -5,4 +5,7 @@* OpenAPI spec version: 0.1.0*/+/**+ * Sender email address for the preview.+ */export type SoupEmailThreadPreviewSenderEmail = string | null;diff --git a/js/app/packages/service-clients/service-storage/generated/schemas/soupEmailThreadPreviewSenderName.ts b/js/app/packages/service-clients/service-storage/generated/schemas/soupEmailThreadPreviewSenderName.tsindex ea8c297663..b493f47f10 100644--- a/js/app/packages/service-clients/service-storage/generated/schemas/soupEmailThreadPreviewSenderName.ts+++ b/js/app/packages/service-clients/service-storage/generated/schemas/soupEmailThreadPreviewSenderName.ts@@ -5,4 +5,7 @@* OpenAPI spec version: 0.1.0*/+/**+ * Sender display name for the preview.+ */export type SoupEmailThreadPreviewSenderName = string | null;diff --git a/js/app/packages/service-clients/service-storage/generated/schemas/soupEmailThreadPreviewSenderPhotoUrl.ts b/js/app/packages/service-clients/service-storage/generated/schemas/soupEmailThreadPreviewSenderPhotoUrl.tsindex a6814e829e..3d4e84b46d 100644--- a/js/app/packages/service-clients/service-storage/generated/schemas/soupEmailThreadPreviewSenderPhotoUrl.ts+++ b/js/app/packages/service-clients/service-storage/generated/schemas/soupEmailThreadPreviewSenderPhotoUrl.ts@@ -5,4 +5,7 @@* OpenAPI spec version: 0.1.0*/+/**+ * Sender photo URL for the preview.+ */export type SoupEmailThreadPreviewSenderPhotoUrl = string | null;diff --git a/js/app/packages/service-clients/service-storage/generated/schemas/soupEmailThreadPreviewSnippet.ts b/js/app/packages/service-clients/service-storage/generated/schemas/soupEmailThreadPreviewSnippet.tsindex a41f02c08d..5f5fb4764d 100644--- a/js/app/packages/service-clients/service-storage/generated/schemas/soupEmailThreadPreviewSnippet.ts+++ b/js/app/packages/service-clients/service-storage/generated/schemas/soupEmailThreadPreviewSnippet.ts@@ -5,4 +5,7 @@* OpenAPI spec version: 0.1.0*/+/**+ * Thread snippet.+ */export type SoupEmailThreadPreviewSnippet = string | null;diff --git a/js/app/packages/service-clients/service-storage/generated/schemas/soupEmailThreadPreviewViewedAt.ts b/js/app/packages/service-clients/service-storage/generated/schemas/soupEmailThreadPreviewViewedAt.tsindex be9494fe3c..4d9bc98f65 100644--- a/js/app/packages/service-clients/service-storage/generated/schemas/soupEmailThreadPreviewViewedAt.ts+++ b/js/app/packages/service-clients/service-storage/generated/schemas/soupEmailThreadPreviewViewedAt.ts@@ -5,4 +5,7 @@* OpenAPI spec version: 0.1.0*/+/**+ * Timestamp when the requesting user last viewed the thread.+ */export type SoupEmailThreadPreviewViewedAt = string | null;diff --git a/js/app/packages/service-clients/service-storage/generated/schemas/soupEnrichedEmailThreadPreview.ts b/js/app/packages/service-clients/service-storage/generated/schemas/soupEnrichedEmailThreadPreview.tsindex bfd72c15ae..698e6997c0 100644--- a/js/app/packages/service-clients/service-storage/generated/schemas/soupEnrichedEmailThreadPreview.ts+++ b/js/app/packages/service-clients/service-storage/generated/schemas/soupEnrichedEmailThreadPreview.ts@@ -7,5 +7,8 @@import type { SoupEmailThreadPreview } from './soupEmailThreadPreview';import type { SoupEnrichedEmailThreadPreviewAllOf } from './soupEnrichedEmailThreadPreviewAllOf';+/**+ * Email thread preview enriched with related metadata for Soup.+ */export type SoupEnrichedEmailThreadPreview = SoupEmailThreadPreview &SoupEnrichedEmailThreadPreviewAllOf;diff --git a/js/app/packages/service-clients/service-storage/generated/schemas/soupEnrichedEmailThreadPreviewAllOf.ts b/js/app/packages/service-clients/service-storage/generated/schemas/soupEnrichedEmailThreadPreviewAllOf.tsindex 090e409399..678551a88b 100644--- a/js/app/packages/service-clients/service-storage/generated/schemas/soupEnrichedEmailThreadPreviewAllOf.ts+++ b/js/app/packages/service-clients/service-storage/generated/schemas/soupEnrichedEmailThreadPreviewAllOf.ts@@ -10,8 +10,12 @@ import type { SoupLabel } from './soupLabel';import type { SoupProperty } from './soupProperty';export type SoupEnrichedEmailThreadPreviewAllOf = {+ /** Attachments on the thread. */attachments: SoupAttachment[];+ /** Labels attached to the thread. */labels: SoupLabel[];+ /** Contacts participating in the thread. */participants: SoupContact[];+ /** Properties attached to the thread. */properties: SoupProperty[];};diff --git a/js/app/packages/service-clients/service-storage/generated/schemas/soupItem.ts b/js/app/packages/service-clients/service-storage/generated/schemas/soupItem.tsindex fcb2e013d4..71397d6c0c 100644--- a/js/app/packages/service-clients/service-storage/generated/schemas/soupItem.ts+++ b/js/app/packages/service-clients/service-storage/generated/schemas/soupItem.ts@@ -9,10 +9,14 @@ import type { SoupItemOneOfFive } from './soupItemOneOfFive';import type { SoupItemOneOfNine } from './soupItemOneOfNine';import type { SoupItemOneOfOnefive } from './soupItemOneOfOnefive';import type { SoupItemOneOfOneone } from './soupItemOneOfOneone';+import type { SoupItemOneOfOneseven } from './soupItemOneOfOneseven';import type { SoupItemOneOfOnethree } from './soupItemOneOfOnethree';import type { SoupItemOneOfSeven } from './soupItemOneOfSeven';import type { SoupItemOneOfThree } from './soupItemOneOfThree';+/**+ * A single item in the Soup feed.+ */export type SoupItem =| SoupItemOneOf| SoupItemOneOfThree@@ -21,4 +25,5 @@ export type SoupItem =| SoupItemOneOfNine| SoupItemOneOfOneone| SoupItemOneOfOnethree- | SoupItemOneOfOnefive;+ | SoupItemOneOfOnefive+ | SoupItemOneOfOneseven;diff --git a/js/app/packages/service-clients/service-storage/generated/schemas/soupItemOneOf.ts b/js/app/packages/service-clients/service-storage/generated/schemas/soupItemOneOf.tsindex 4e059ea985..c5b1168a45 100644--- a/js/app/packages/service-clients/service-storage/generated/schemas/soupItemOneOf.ts+++ b/js/app/packages/service-clients/service-storage/generated/schemas/soupItemOneOf.ts@@ -7,7 +7,11 @@import type { SoupDocument } from './soupDocument';import type { SoupItemOneOfTag } from './soupItemOneOfTag';+/**+ * Document item.+ */export type SoupItemOneOf = {+ /** Document item. */data: SoupDocument;tag: SoupItemOneOfTag;};diff --git a/js/app/packages/service-clients/service-storage/generated/schemas/soupItemOneOfFive.ts b/js/app/packages/service-clients/service-storage/generated/schemas/soupItemOneOfFive.tsindex 6fc7d91113..eb044b9ebd 100644--- a/js/app/packages/service-clients/service-storage/generated/schemas/soupItemOneOfFive.ts+++ b/js/app/packages/service-clients/service-storage/generated/schemas/soupItemOneOfFive.ts@@ -8,7 +8,11 @@import type { SoupItemOneOfFiveTag } from './soupItemOneOfFiveTag';import type { SoupProject } from './soupProject';+/**+ * Project item.+ */export type SoupItemOneOfFive = {+ /** Project item. */data: SoupProject;tag: SoupItemOneOfFiveTag;};diff --git a/js/app/packages/service-clients/service-storage/generated/schemas/soupItemOneOfNine.ts b/js/app/packages/service-clients/service-storage/generated/schemas/soupItemOneOfNine.tsindex 665a62e291..28b5c82b4d 100644--- a/js/app/packages/service-clients/service-storage/generated/schemas/soupItemOneOfNine.ts+++ b/js/app/packages/service-clients/service-storage/generated/schemas/soupItemOneOfNine.ts@@ -7,7 +7,11 @@import type { SoupChannel } from './soupChannel';import type { SoupItemOneOfNineTag } from './soupItemOneOfNineTag';+/**+ * Channel item.+ */export type SoupItemOneOfNine = {+ /** Channel item. */data: SoupChannel;tag: SoupItemOneOfNineTag;};diff --git a/js/app/packages/service-clients/service-storage/generated/schemas/soupItemOneOfOnefive.ts b/js/app/packages/service-clients/service-storage/generated/schemas/soupItemOneOfOnefive.tsindex c4738c5974..882ad3d8d3 100644--- a/js/app/packages/service-clients/service-storage/generated/schemas/soupItemOneOfOnefive.ts+++ b/js/app/packages/service-clients/service-storage/generated/schemas/soupItemOneOfOnefive.ts@@ -4,10 +4,14 @@* document_storage_service* OpenAPI spec version: 0.1.0*/-import type { SoupForeignEntity } from './soupForeignEntity';+import type { SoupCrmCompany } from './soupCrmCompany';import type { SoupItemOneOfOnefiveTag } from './soupItemOneOfOnefiveTag';+/**+ * CRM company item.+ */export type SoupItemOneOfOnefive = {- data: SoupForeignEntity;+ /** CRM company item. */+ data: SoupCrmCompany;tag: SoupItemOneOfOnefiveTag;};diff --git a/js/app/packages/service-clients/service-storage/generated/schemas/soupItemOneOfOnefiveTag.ts b/js/app/packages/service-clients/service-storage/generated/schemas/soupItemOneOfOnefiveTag.tsindex 506aac0ba3..2e329d4d25 100644--- a/js/app/packages/service-clients/service-storage/generated/schemas/soupItemOneOfOnefiveTag.ts+++ b/js/app/packages/service-clients/service-storage/generated/schemas/soupItemOneOfOnefiveTag.ts@@ -10,5 +10,5 @@ export type SoupItemOneOfOnefiveTag =// eslint-disable-next-line @typescript-eslint/no-redeclareexport const SoupItemOneOfOnefiveTag = {- foreignEntity: 'foreignEntity',+ crmCompany: 'crmCompany',} as const;diff --git a/js/app/packages/service-clients/service-storage/generated/schemas/soupItemOneOfOneone.ts b/js/app/packages/service-clients/service-storage/generated/schemas/soupItemOneOfOneone.tsindex 814dd225ef..dd61d0d73d 100644--- a/js/app/packages/service-clients/service-storage/generated/schemas/soupItemOneOfOneone.ts+++ b/js/app/packages/service-clients/service-storage/generated/schemas/soupItemOneOfOneone.ts@@ -4,10 +4,14 @@* document_storage_service* OpenAPI spec version: 0.1.0*/-import type { SoupCallRecord } from './soupCallRecord';+import type { SoupChannelThread } from './soupChannelThread';import type { SoupItemOneOfOneoneTag } from './soupItemOneOfOneoneTag';+/**+ * Channel thread item.+ */export type SoupItemOneOfOneone = {- data: SoupCallRecord;+ /** Channel thread item. */+ data: SoupChannelThread;tag: SoupItemOneOfOneoneTag;};diff --git a/js/app/packages/service-clients/service-storage/generated/schemas/soupItemOneOfOneoneTag.ts b/js/app/packages/service-clients/service-storage/generated/schemas/soupItemOneOfOneoneTag.tsindex 81a3b77f2a..fd0c673e37 100644--- a/js/app/packages/service-clients/service-storage/generated/schemas/soupItemOneOfOneoneTag.ts+++ b/js/app/packages/service-clients/service-storage/generated/schemas/soupItemOneOfOneoneTag.ts@@ -10,5 +10,5 @@ export type SoupItemOneOfOneoneTag =// eslint-disable-next-line @typescript-eslint/no-redeclareexport const SoupItemOneOfOneoneTag = {- call: 'call',+ channelThread: 'channelThread',} as const;diff --git a/js/app/packages/service-clients/service-storage/generated/schemas/soupItemOneOfOneseven.ts b/js/app/packages/service-clients/service-storage/generated/schemas/soupItemOneOfOneseven.tsnew file mode 100644index 0000000000..2e998a61c9--- /dev/null+++ b/js/app/packages/service-clients/service-storage/generated/schemas/soupItemOneOfOneseven.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 { SoupForeignEntity } from './soupForeignEntity';+import type { SoupItemOneOfOnesevenTag } from './soupItemOneOfOnesevenTag';++/**+ * Foreign entity item.+ */+export type SoupItemOneOfOneseven = {+ /** Foreign entity item. */+ data: SoupForeignEntity;+ tag: SoupItemOneOfOnesevenTag;+};diff --git a/js/app/packages/service-clients/service-storage/generated/schemas/soupItemOneOfOnesevenTag.ts b/js/app/packages/service-clients/service-storage/generated/schemas/soupItemOneOfOnesevenTag.tsnew file mode 100644index 0000000000..7685c77112--- /dev/null+++ b/js/app/packages/service-clients/service-storage/generated/schemas/soupItemOneOfOnesevenTag.ts@@ -0,0 +1,14 @@+/**+ * Generated by orval v7.21.0 🍺+ * Do not edit manually.+ * document_storage_service+ * OpenAPI spec version: 0.1.0+ */++export type SoupItemOneOfOnesevenTag =+ (typeof SoupItemOneOfOnesevenTag)[keyof typeof SoupItemOneOfOnesevenTag];++// eslint-disable-next-line @typescript-eslint/no-redeclare+export const SoupItemOneOfOnesevenTag = {+ foreignEntity: 'foreignEntity',+} as const;diff --git a/js/app/packages/service-clients/service-storage/generated/schemas/soupItemOneOfOnethree.ts b/js/app/packages/service-clients/service-storage/generated/schemas/soupItemOneOfOnethree.tsindex 72b2063945..fd21f4e047 100644--- a/js/app/packages/service-clients/service-storage/generated/schemas/soupItemOneOfOnethree.ts+++ b/js/app/packages/service-clients/service-storage/generated/schemas/soupItemOneOfOnethree.ts@@ -4,10 +4,14 @@* document_storage_service* OpenAPI spec version: 0.1.0*/-import type { SoupCrmCompany } from './soupCrmCompany';+import type { SoupCallRecord } from './soupCallRecord';import type { SoupItemOneOfOnethreeTag } from './soupItemOneOfOnethreeTag';+/**+ * Call record item.+ */export type SoupItemOneOfOnethree = {- data: SoupCrmCompany;+ /** Call record item. */+ data: SoupCallRecord;tag: SoupItemOneOfOnethreeTag;};diff --git a/js/app/packages/service-clients/service-storage/generated/schemas/soupItemOneOfOnethreeTag.ts b/js/app/packages/service-clients/service-storage/generated/schemas/soupItemOneOfOnethreeTag.tsindex b1f1c5bb62..627e638a9b 100644--- a/js/app/packages/service-clients/service-storage/generated/schemas/soupItemOneOfOnethreeTag.ts+++ b/js/app/packages/service-clients/service-storage/generated/schemas/soupItemOneOfOnethreeTag.ts@@ -10,5 +10,5 @@ export type SoupItemOneOfOnethreeTag =// eslint-disable-next-line @typescript-eslint/no-redeclareexport const SoupItemOneOfOnethreeTag = {- crmCompany: 'crmCompany',+ call: 'call',} as const;diff --git a/js/app/packages/service-clients/service-storage/generated/schemas/soupItemOneOfSeven.ts b/js/app/packages/service-clients/service-storage/generated/schemas/soupItemOneOfSeven.tsindex 06eebf9b88..00ed5245f5 100644--- a/js/app/packages/service-clients/service-storage/generated/schemas/soupItemOneOfSeven.ts+++ b/js/app/packages/service-clients/service-storage/generated/schemas/soupItemOneOfSeven.ts@@ -7,7 +7,11 @@import type { SoupEnrichedEmailThreadPreview } from './soupEnrichedEmailThreadPreview';import type { SoupItemOneOfSevenTag } from './soupItemOneOfSevenTag';+/**+ * Email thread item.+ */export type SoupItemOneOfSeven = {+ /** Email thread item. */data: SoupEnrichedEmailThreadPreview;tag: SoupItemOneOfSevenTag;};diff --git a/js/app/packages/service-clients/service-storage/generated/schemas/soupItemOneOfThree.ts b/js/app/packages/service-clients/service-storage/generated/schemas/soupItemOneOfThree.tsindex a332c844fe..1ec6c4f0bb 100644--- a/js/app/packages/service-clients/service-storage/generated/schemas/soupItemOneOfThree.ts+++ b/js/app/packages/service-clients/service-storage/generated/schemas/soupItemOneOfThree.ts@@ -7,7 +7,11 @@import type { SoupChat } from './soupChat';import type { SoupItemOneOfThreeTag } from './soupItemOneOfThreeTag';+/**+ * Chat item.+ */export type SoupItemOneOfThree = {+ /** Chat item. */data: SoupChat;tag: SoupItemOneOfThreeTag;};diff --git a/js/app/packages/service-clients/service-storage/generated/schemas/soupLabel.ts b/js/app/packages/service-clients/service-storage/generated/schemas/soupLabel.tsindex 91f8a230a9..45175f83ed 100644--- a/js/app/packages/service-clients/service-storage/generated/schemas/soupLabel.ts+++ b/js/app/packages/service-clients/service-storage/generated/schemas/soupLabel.ts@@ -8,13 +8,24 @@ import type { SoupLabelListVisibility } from './soupLabelListVisibility';import type { SoupLabelType } from './soupLabelType';import type { SoupMessageListVisibility } from './soupMessageListVisibility';+/**+ * An email label as displayed in Soup.+ */export interface SoupLabel {+ /** Timestamp when the label was created. */createdAt: string;+ /** Label id. */id: string;+ /** Label visibility in label lists. */labelListVisibility: SoupLabelListVisibility;+ /** Connected account link id for the label. */linkId: string;+ /** Label visibility in message lists. */messageListVisibility: SoupMessageListVisibility;+ /** Label display name. */name: string;+ /** Provider-specific label id. */providerLabelId: string;+ /** Label type. */type: SoupLabelType;}diff --git a/js/app/packages/service-clients/service-storage/generated/schemas/soupLabelListVisibility.ts b/js/app/packages/service-clients/service-storage/generated/schemas/soupLabelListVisibility.tsindex 10abe53f56..8cbf431f6b 100644--- a/js/app/packages/service-clients/service-storage/generated/schemas/soupLabelListVisibility.ts+++ b/js/app/packages/service-clients/service-storage/generated/schemas/soupLabelListVisibility.ts@@ -5,6 +5,9 @@* OpenAPI spec version: 0.1.0*/+/**+ * Gmail-style label list visibility.+ */export type SoupLabelListVisibility =(typeof SoupLabelListVisibility)[keyof typeof SoupLabelListVisibility];diff --git a/js/app/packages/service-clients/service-storage/generated/schemas/soupLabelType.ts b/js/app/packages/service-clients/service-storage/generated/schemas/soupLabelType.tsindex 822a96e729..fe6abed8cc 100644--- a/js/app/packages/service-clients/service-storage/generated/schemas/soupLabelType.ts+++ b/js/app/packages/service-clients/service-storage/generated/schemas/soupLabelType.ts@@ -5,6 +5,9 @@* OpenAPI spec version: 0.1.0*/+/**+ * Whether an email label is provider-created or user-created.+ */export type SoupLabelType = (typeof SoupLabelType)[keyof typeof SoupLabelType];// eslint-disable-next-line @typescript-eslint/no-redeclarediff --git a/js/app/packages/service-clients/service-storage/generated/schemas/soupMessageListVisibility.ts b/js/app/packages/service-clients/service-storage/generated/schemas/soupMessageListVisibility.tsindex 7ba45dbded..a2bb8ee231 100644--- a/js/app/packages/service-clients/service-storage/generated/schemas/soupMessageListVisibility.ts+++ b/js/app/packages/service-clients/service-storage/generated/schemas/soupMessageListVisibility.ts@@ -5,6 +5,9 @@* OpenAPI spec version: 0.1.0*/+/**+ * Gmail-style message list visibility for a label.+ */export type SoupMessageListVisibility =(typeof SoupMessageListVisibility)[keyof typeof SoupMessageListVisibility];diff --git a/js/app/packages/service-clients/service-storage/generated/schemas/soupPage.ts b/js/app/packages/service-clients/service-storage/generated/schemas/soupPage.tsindex 13a3a0c8ae..d64ddc4b1a 100644--- a/js/app/packages/service-clients/service-storage/generated/schemas/soupPage.ts+++ b/js/app/packages/service-clients/service-storage/generated/schemas/soupPage.ts@@ -7,6 +7,9 @@import type { SoupApiItem } from './soupApiItem';import type { SoupPageNextCursor } from './soupPageNextCursor';+/**+ * Response page for non-grouped soup endpoints.+ */export interface SoupPage {items: SoupApiItem[];next_cursor?: SoupPageNextCursor;diff --git a/js/app/packages/service-clients/service-storage/generated/schemas/soupProject.ts b/js/app/packages/service-clients/service-storage/generated/schemas/soupProject.tsindex 1d91e0ea25..7115e6e637 100644--- a/js/app/packages/service-clients/service-storage/generated/schemas/soupProject.ts+++ b/js/app/packages/service-clients/service-storage/generated/schemas/soupProject.ts@@ -9,6 +9,9 @@ import type { SoupProjectParentId } from './soupProjectParentId';import type { SoupProjectViewedAt } from './soupProjectViewedAt';import type { SoupProperty } from './soupProperty';+/**+ * A project as displayed in Soup.+ */export interface SoupProject {/** The time the project was created */createdAt: string;diff --git a/js/app/packages/service-clients/service-storage/generated/zod.ts b/js/app/packages/service-clients/service-storage/generated/zod.tsindex 1748739bd5..b5d1927702 100644--- a/js/app/packages/service-clients/service-storage/generated/zod.ts+++ b/js/app/packages/service-clients/service-storage/generated/zod.ts@@ -6266,1168 +6266,1416 @@ export const getItemsSoupQueryParams = zod.object({export const getItemsSoupResponseItemsItemDataChannelOrgIdMin = 0;-export const getItemsSoupResponse = zod.object({- items: zod.array(- zod- .union([- zod.object({- data: zod.object({- branchedFromId: zod- .uuid()- .nullish()- .describe('The id of the document this document branched from'),- branchedFromVersionId: zod- .number()- .nullish()- .describe(- 'The id of the version this document branched from\nThis could be either DocumentInstance or DocumentBom id depending on the file type'- ),- createdAt: zod.iso- .datetime({})- .describe('The time the document was created'),- deletedAt: zod.iso- .datetime({})- .nullish()- .describe('The time the document was deleted'),- documentFamilyId: zod- .number()- .nullish()- .describe(- 'The id of the document family this document belongs to'- ),- documentVersionId: zod- .number()- .describe(- 'The version of the document\nThis could be the document_instance_id or document_bom_id depending on the file type'- ),- fileType: zod- .string()- .nullish()- .describe('The file type of the document (e.g. pdf, docx)'),- id: zod.uuid().describe('The document id'),- name: zod.string().describe('The name of the document'),- ownerId: zod.string().describe('The owner of the document'),- projectId: zod- .uuid()- .nullish()- .describe('The id of the project that this document belongs to'),- properties: zod- .array(- zod- .object({- definition: zod- .object({- created_at: zod.iso.datetime({}),- data_type: zod- .enum([- 'BOOLEAN',- 'DATE',- 'NUMBER',- 'STRING',- 'SELECT_NUMBER',- 'SELECT_STRING',- 'ENTITY',- 'LINK',- ])- .describe(- 'Data type for property values, determining storage and validation.'- ),- display_name: zod.string(),- id: zod.uuid(),- is_metadata: zod- .boolean()- .describe(- 'Flag to indicate if this is a system-generated metadata property.\nNot stored in database - computed at service layer.'- ),- is_multi_select: zod.boolean(),- is_system: zod- .boolean()- .describe(- 'Flag to indicate if this is a system property (stored in DB).'- ),- owner: zod- .union([- zod- .object({- scope: zod.enum(['user']),- user_id: zod.string(),- })- .describe('User-scoped property only'),- zod- .object({- organization_id: zod.number(),- scope: zod.enum(['organization']),- })- .describe('Organization-scoped property only'),- zod- .object({- organization_id: zod.number(),- scope: zod.enum(['user_and_organization']),- user_id: zod.string(),- })- .describe('Both user and organization-scoped'),- zod- .object({- scope: zod.enum(['system']),- })- .describe(- 'System-owned property (no user or org owner)'- ),- ])- .describe(- 'Defines who owns a property - user-scoped, org-scoped, system, or both user and org.'- ),- specific_entity_type: zod- .union([- zod.null(),- zod- .enum([- 'CHANNEL',- 'CHAT',- 'COMPANY',- 'DOCUMENT',- 'PROJECT',- 'TASK',- 'THREAD',- 'USER',- ])- .describe(- 'Type of entity that can be referenced by entity properties.'- ),- ])- .optional(),- updated_at: zod.iso.datetime({}),- })- .describe(- 'Property definition model (service representation).'- ),- value: zod- .union([- zod.null(),- zod- .union([- zod- .object({- type: zod.enum(['Boolean']),- value: zod- .boolean()- .describe(- 'Boolean value\nSerializes as: {\"type\": \"Boolean\", \"value\": true}'- ),- })- .describe(- 'Boolean value\nSerializes as: {\"type\": \"Boolean\", \"value\": true}'- ),- zod- .object({- type: zod.enum(['Number']),- value: zod- .number()- .describe(- 'Numeric value\nSerializes as: {\"type\": \"Number\", \"value\": 42.5}'- ),- })- .describe(- 'Numeric value\nSerializes as: {\"type\": \"Number\", \"value\": 42.5}'- ),- zod- .object({- type: zod.enum(['String']),- value: zod- .string()- .describe(- 'String value\nSerializes as: {\"type\": \"String\", \"value\": \"text\"}'- ),- })- .describe(- 'String value\nSerializes as: {\"type\": \"String\", \"value\": \"text\"}'- ),- zod- .object({- type: zod.enum(['Date']),- value: zod.iso- .datetime({})- .describe(- 'Date\/timestamp value\nSerializes as: {\"type\": \"Date\", \"value\": \"2025-01-01T00:00:00Z\"}'- ),- })- .describe(- 'Date\/timestamp value\nSerializes as: {\"type\": \"Date\", \"value\": \"2025-01-01T00:00:00Z\"}'- ),- zod- .object({- type: zod.enum(['SelectOption']),- value: zod- .array(zod.uuid())- .describe(- 'Select option(s) - always an array (check is_multi_select to determine if single or multi)\nSingle-select: {\"type\": \"SelectOption\", \"value\": [\"uuid\"]} (length 0 or 1)\nMulti-select: {\"type\": \"SelectOption\", \"value\": [\"uuid1\", \"uuid2\", ...]} (length 0+)'- ),- })- .describe(- 'Select option(s) - always an array (check is_multi_select to determine if single or multi)\nSingle-select: {\"type\": \"SelectOption\", \"value\": [\"uuid\"]} (length 0 or 1)\nMulti-select: {\"type\": \"SelectOption\", \"value\": [\"uuid1\", \"uuid2\", ...]} (length 0+)'- ),- zod- .object({- type: zod.enum(['EntityReference']),- value: zod- .array(- zod- .object({- entity_id: zod.string(),- entity_type: zod- .enum([- 'CHANNEL',- 'CHAT',- 'COMPANY',- 'DOCUMENT',- 'PROJECT',- 'TASK',- 'THREAD',- 'USER',- ])- .describe(- 'Type of entity that can be referenced by entity properties.'- ),- specific_message_id: zod- .uuid()- .nullish()- .describe(- 'For CHANNEL, CHAT, THREAD entity types - optional specific message ID.\nThis allows referencing a specific message within a thread\/channel\/chat.'- ),- })- .describe(- 'Entity reference for entity-type property values.'- )- )- .describe(- 'Entity reference(s) - always an array (check is_multi_select to determine if single or multi)\nSingle-select: {\"type\": \"EntityReference\", \"value\": [{...}]} (length 0 or 1)\nMulti-select: {\"type\": \"EntityReference\", \"value\": [{...}, {...}, ...]} (length 0+)'- ),- })- .describe(- 'Entity reference(s) - always an array (check is_multi_select to determine if single or multi)\nSingle-select: {\"type\": \"EntityReference\", \"value\": [{...}]} (length 0 or 1)\nMulti-select: {\"type\": \"EntityReference\", \"value\": [{...}, {...}, ...]} (length 0+)'- ),- zod- .object({- type: zod.enum(['Link']),- value: zod- .array(zod.string())- .describe(- 'Link value(s) - always an array (check is_multi_select to determine if single or multi)\nSingle-select: {\"type\": \"Link\", \"value\": [\"https:\/\/example.com\"]} (length 0 or 1)\nMulti-select: {\"type\": \"Link\", \"value\": [\"https:\/\/example.com\", \"https:\/\/other.com\"]} (length 0+)'- ),- })- .describe(- 'Link value(s) - always an array (check is_multi_select to determine if single or multi)\nSingle-select: {\"type\": \"Link\", \"value\": [\"https:\/\/example.com\"]} (length 0 or 1)\nMulti-select: {\"type\": \"Link\", \"value\": [\"https:\/\/example.com\", \"https:\/\/other.com\"]} (length 0+)'- ),- ])- .describe(- 'Property value (service representation).\n\nRepresents the actual value stored for an entity property.\nThis is serialized to\/from JSONB in the database.'- ),- ])- .optional(),- })- .describe(- 'A property attached to a Soup item.\n\nThis is a simplified representation that includes only the definition and value,\nomitting the entity property assignment metadata and options.'- )- )- .describe('Properties'),- sha: zod- .string()- .nullish()- .describe(- 'If the document is a PDF, this is the SHA of the pdf\nIf the document is a DOCX, this will not be present'- ),- subType: zod- .union([- zod.null(),- zod- .union([- zod- .object({- is_completed: zod- .boolean()- .describe(- 'Whether the task is completed.\nTrue if the Status property is set to \"Completed\".'- ),- type: zod.enum(['task']),- })- .describe(- 'A task document with its associated properties'- ),- zod- .object({- type: zod.enum(['snippet']),- })- .describe('A snippet document — reusable markdown'),- ])- .describe(- 'Sub type of a document with associated properties encoded in each variant.\nThis ensures type-safety: task properties only exist when the document is a task.'- ),- ])- .optional(),- updatedAt: zod.iso- .datetime({})- .describe(- 'The time the document instance \/ document BOM was updated'- ),- viewedAt: zod.iso- .datetime({})- .nullish()- .describe('The time the document was last viewed'),- }),- tag: zod.enum(['document']),- }),- zod.object({- data: zod.object({- createdAt: zod.iso- .datetime({})- .describe('The time the chat was created'),- deletedAt: zod.iso- .datetime({})- .nullish()- .describe('The time the chat was deleted'),- id: zod.uuid().describe('The chat uuid'),- isPersistent: zod- .boolean()- .describe('Whether the chat is persistent or not'),- name: zod.string().describe('The name of the chat'),- ownerId: zod.string().describe('Who the chat belongs to'),- projectId: zod- .uuid()- .nullish()- .describe('The project id of the chat'),- properties: zod- .array(- zod- .object({- definition: zod- .object({- created_at: zod.iso.datetime({}),- data_type: zod- .enum([- 'BOOLEAN',- 'DATE',- 'NUMBER',- 'STRING',- 'SELECT_NUMBER',- 'SELECT_STRING',- 'ENTITY',- 'LINK',- ])- .describe(- 'Data type for property values, determining storage and validation.'- ),- display_name: zod.string(),- id: zod.uuid(),- is_metadata: zod- .boolean()- .describe(- 'Flag to indicate if this is a system-generated metadata property.\nNot stored in database - computed at service layer.'- ),- is_multi_select: zod.boolean(),- is_system: zod- .boolean()- .describe(- 'Flag to indicate if this is a system property (stored in DB).'- ),- owner: zod- .union([- zod- .object({- scope: zod.enum(['user']),- user_id: zod.string(),- })- .describe('User-scoped property only'),- zod- .object({- organization_id: zod.number(),- scope: zod.enum(['organization']),- })- .describe('Organization-scoped property only'),- zod- .object({- organization_id: zod.number(),- scope: zod.enum(['user_and_organization']),- user_id: zod.string(),- })- .describe('Both user and organization-scoped'),- zod- .object({- scope: zod.enum(['system']),- })- .describe(- 'System-owned property (no user or org owner)'- ),- ])- .describe(- 'Defines who owns a property - user-scoped, org-scoped, system, or both user and org.'- ),- specific_entity_type: zod- .union([- zod.null(),- zod- .enum([- 'CHANNEL',- 'CHAT',- 'COMPANY',- 'DOCUMENT',- 'PROJECT',- 'TASK',- 'THREAD',- 'USER',- ])- .describe(- 'Type of entity that can be referenced by entity properties.'- ),- ])- .optional(),- updated_at: zod.iso.datetime({}),- })- .describe(- 'Property definition model (service representation).'- ),- value: zod- .union([- zod.null(),+export const getItemsSoupResponse = zod+ .object({+ items: zod.array(+ zod+ .union([+ zod+ .object({+ data: zod+ .object({+ branchedFromId: zod+ .uuid()+ .nullish()+ .describe(+ 'The id of the document this document branched from'+ ),+ branchedFromVersionId: zod+ .number()+ .nullish()+ .describe(+ 'The id of the version this document branched from\nThis could be either DocumentInstance or DocumentBom id depending on the file type'+ ),+ createdAt: zod.iso+ .datetime({})+ .describe('The time the document was created'),+ deletedAt: zod.iso+ .datetime({})+ .nullish()+ .describe('The time the document was deleted'),+ documentFamilyId: zod+ .number()+ .nullish()+ .describe(+ 'The id of the document family this document belongs to'+ ),+ documentVersionId: zod+ .number()+ .describe(+ 'The version of the document\nThis could be the document_instance_id or document_bom_id depending on the file type'+ ),+ fileType: zod+ .string()+ .nullish()+ .describe('The file type of the document (e.g. pdf, docx)'),+ id: zod.uuid().describe('The document id'),+ name: zod.string().describe('The name of the document'),+ ownerId: zod.string().describe('The owner of the document'),+ projectId: zod+ .uuid()+ .nullish()+ .describe(+ 'The id of the project that this document belongs to'+ ),+ properties: zod+ .array(+ zod+ .object({+ definition: zod+ .object({+ created_at: zod.iso.datetime({}),+ data_type: zod+ .enum([+ 'BOOLEAN',+ 'DATE',+ 'NUMBER',+ 'STRING',+ 'SELECT_NUMBER',+ 'SELECT_STRING',+ 'ENTITY',+ 'LINK',+ ])+ .describe(+ 'Data type for property values, determining storage and validation.'+ ),+ display_name: zod.string(),+ id: zod.uuid(),+ is_metadata: zod+ .boolean()+ .describe(+ 'Flag to indicate if this is a system-generated metadata property.\nNot stored in database - computed at service layer.'+ ),+ is_multi_select: zod.boolean(),+ is_system: zod+ .boolean()+ .describe(+ 'Flag to indicate if this is a system property (stored in DB).'+ ),+ owner: zod+ .union([+ zod+ .object({+ scope: zod.enum(['user']),+ user_id: zod.string(),+ })+ .describe('User-scoped property only'),+ zod+ .object({+ organization_id: zod.number(),+ scope: zod.enum(['organization']),+ })+ .describe(+ 'Organization-scoped property only'+ ),+ zod+ .object({+ organization_id: zod.number(),+ scope: zod.enum([+ 'user_and_organization',+ ]),+ user_id: zod.string(),+ })+ .describe(+ 'Both user and organization-scoped'+ ),+ zod+ .object({+ scope: zod.enum(['system']),+ })+ .describe(+ 'System-owned property (no user or org owner)'+ ),+ ])+ .describe(+ 'Defines who owns a property - user-scoped, org-scoped, system, or both user and org.'+ ),+ specific_entity_type: zod+ .union([+ zod.null(),+ zod+ .enum([+ 'CHANNEL',+ 'CHAT',+ 'COMPANY',+ 'DOCUMENT',+ 'PROJECT',+ 'TASK',+ 'THREAD',+ 'USER',+ ])+ .describe(+ 'Type of entity that can be referenced by entity properties.'+ ),+ ])+ .optional(),+ updated_at: zod.iso.datetime({}),+ })+ .describe(+ 'Property definition model (service representation).'+ ),+ value: zod+ .union([+ zod.null(),+ zod+ .union([+ zod+ .object({+ type: zod.enum(['Boolean']),+ value: zod+ .boolean()+ .describe(+ 'Boolean value\nSerializes as: {\"type\": \"Boolean\", \"value\": true}'+ ),+ })+ .describe(+ 'Boolean value\nSerializes as: {\"type\": \"Boolean\", \"value\": true}'+ ),+ zod+ .object({+ type: zod.enum(['Number']),+ value: zod+ .number()+ .describe(+ 'Numeric value\nSerializes as: {\"type\": \"Number\", \"value\": 42.5}'+ ),+ })+ .describe(+ 'Numeric value\nSerializes as: {\"type\": \"Number\", \"value\": 42.5}'+ ),+ zod+ .object({+ type: zod.enum(['String']),+ value: zod+ .string()+ .describe(+ 'String value\nSerializes as: {\"type\": \"String\", \"value\": \"text\"}'+ ),+ })+ .describe(+ 'String value\nSerializes as: {\"type\": \"String\", \"value\": \"text\"}'+ ),+ zod+ .object({+ type: zod.enum(['Date']),+ value: zod.iso+ .datetime({})+ .describe(+ 'Date\/timestamp value\nSerializes as: {\"type\": \"Date\", \"value\": \"2025-01-01T00:00:00Z\"}'+ ),+ })+ .describe(+ 'Date\/timestamp value\nSerializes as: {\"type\": \"Date\", \"value\": \"2025-01-01T00:00:00Z\"}'+ ),+ zod+ .object({+ type: zod.enum(['SelectOption']),+ value: zod+ .array(zod.uuid())+ .describe(+ 'Select option(s) - always an array (check is_multi_select to determine if single or multi)\nSingle-select: {\"type\": \"SelectOption\", \"value\": [\"uuid\"]} (length 0 or 1)\nMulti-select: {\"type\": \"SelectOption\", \"value\": [\"uuid1\", \"uuid2\", ...]} (length 0+)'+ ),+ })+ .describe(+ 'Select option(s) - always an array (check is_multi_select to determine if single or multi)\nSingle-select: {\"type\": \"SelectOption\", \"value\": [\"uuid\"]} (length 0 or 1)\nMulti-select: {\"type\": \"SelectOption\", \"value\": [\"uuid1\", \"uuid2\", ...]} (length 0+)'+ ),+ zod+ .object({+ type: zod.enum(['EntityReference']),+ value: zod+ .array(+ zod+ .object({+ entity_id: zod.string(),+ entity_type: zod+ .enum([+ 'CHANNEL',+ 'CHAT',+ 'COMPANY',+ 'DOCUMENT',+ 'PROJECT',+ 'TASK',+ 'THREAD',+ 'USER',+ ])+ .describe(+ 'Type of entity that can be referenced by entity properties.'+ ),+ specific_message_id: zod+ .uuid()+ .nullish()+ .describe(+ 'For CHANNEL, CHAT, THREAD entity types - optional specific message ID.\nThis allows referencing a specific message within a thread\/channel\/chat.'+ ),+ })+ .describe(+ 'Entity reference for entity-type property values.'+ )+ )+ .describe(+ 'Entity reference(s) - always an array (check is_multi_select to determine if single or multi)\nSingle-select: {\"type\": \"EntityReference\", \"value\": [{...}]} (length 0 or 1)\nMulti-select: {\"type\": \"EntityReference\", \"value\": [{...}, {...}, ...]} (length 0+)'+ ),+ })+ .describe(+ 'Entity reference(s) - always an array (check is_multi_select to determine if single or multi)\nSingle-select: {\"type\": \"EntityReference\", \"value\": [{...}]} (length 0 or 1)\nMulti-select: {\"type\": \"EntityReference\", \"value\": [{...}, {...}, ...]} (length 0+)'+ ),+ zod+ .object({+ type: zod.enum(['Link']),+ value: zod+ .array(zod.string())+ .describe(+ 'Link value(s) - always an array (check is_multi_select to determine if single or multi)\nSingle-select: {\"type\": \"Link\", \"value\": [\"https:\/\/example.com\"]} (length 0 or 1)\nMulti-select: {\"type\": \"Link\", \"value\": [\"https:\/\/example.com\", \"https:\/\/other.com\"]} (length 0+)'+ ),+ })+ .describe(+ 'Link value(s) - always an array (check is_multi_select to determine if single or multi)\nSingle-select: {\"type\": \"Link\", \"value\": [\"https:\/\/example.com\"]} (length 0 or 1)\nMulti-select: {\"type\": \"Link\", \"value\": [\"https:\/\/example.com\", \"https:\/\/other.com\"]} (length 0+)'+ ),+ ])+ .describe(+ 'Property value (service representation).\n\nRepresents the actual value stored for an entity property.\nThis is serialized to\/from JSONB in the database.'+ ),+ ])+ .optional(),+ })+ .describe(+ 'A property attached to a Soup item.\n\nThis is a simplified representation that includes only the definition and value,\nomitting the entity property assignment metadata and options.'+ )+ )+ .describe('Properties'),+ sha: zod+ .string()+ .nullish()+ .describe(+ 'If the document is a PDF, this is the SHA of the pdf\nIf the document is a DOCX, this will not be present'+ ),+ subType: zod+ .union([+ zod.null(),+ zod+ .union([+ zod+ .object({+ is_completed: zod+ .boolean()+ .describe(+ 'Whether the task is completed.\nTrue if the Status property is set to \"Completed\".'+ ),+ type: zod.enum(['task']),+ })+ .describe(+ 'A task document with its associated properties'+ ),+ zod+ .object({+ type: zod.enum(['snippet']),+ })+ .describe('A snippet document — reusable markdown'),+ ])+ .describe(+ 'Sub type of a document with associated properties encoded in each variant.\nThis ensures type-safety: task properties only exist when the document is a task.'+ ),+ ])+ .optional(),+ updatedAt: zod.iso+ .datetime({})+ .describe(+ 'The time the document instance \/ document BOM was updated'+ ),+ viewedAt: zod.iso+ .datetime({})+ .nullish()+ .describe('The time the document was last viewed'),+ })+ .describe('A document as displayed in Soup.'),+ tag: zod.enum(['document']),+ })+ .describe('Document item.'),+ zod+ .object({+ data: zod+ .object({+ createdAt: zod.iso+ .datetime({})+ .describe('The time the chat was created'),+ deletedAt: zod.iso+ .datetime({})+ .nullish()+ .describe('The time the chat was deleted'),+ id: zod.uuid().describe('The chat uuid'),+ isPersistent: zod+ .boolean()+ .describe('Whether the chat is persistent or not'),+ name: zod.string().describe('The name of the chat'),+ ownerId: zod.string().describe('Who the chat belongs to'),+ projectId: zod+ .uuid()+ .nullish()+ .describe('The project id of the chat'),+ properties: zod+ .array(+ zod+ .object({+ definition: zod+ .object({+ created_at: zod.iso.datetime({}),+ data_type: zod+ .enum([+ 'BOOLEAN',+ 'DATE',+ 'NUMBER',+ 'STRING',+ 'SELECT_NUMBER',+ 'SELECT_STRING',+ 'ENTITY',+ 'LINK',+ ])+ .describe(+ 'Data type for property values, determining storage and validation.'+ ),+ display_name: zod.string(),+ id: zod.uuid(),+ is_metadata: zod+ .boolean()+ .describe(+ 'Flag to indicate if this is a system-generated metadata property.\nNot stored in database - computed at service layer.'+ ),+ is_multi_select: zod.boolean(),+ is_system: zod+ .boolean()+ .describe(+ 'Flag to indicate if this is a system property (stored in DB).'+ ),+ owner: zod+ .union([+ zod+ .object({+ scope: zod.enum(['user']),+ user_id: zod.string(),+ })+ .describe('User-scoped property only'),+ zod+ .object({+ organization_id: zod.number(),+ scope: zod.enum(['organization']),+ })+ .describe(+ 'Organization-scoped property only'+ ),+ zod+ .object({+ organization_id: zod.number(),+ scope: zod.enum([+ 'user_and_organization',+ ]),+ user_id: zod.string(),+ })+ .describe(+ 'Both user and organization-scoped'+ ),+ zod+ .object({+ scope: zod.enum(['system']),+ })+ .describe(+ 'System-owned property (no user or org owner)'+ ),+ ])+ .describe(+ 'Defines who owns a property - user-scoped, org-scoped, system, or both user and org.'+ ),+ specific_entity_type: zod+ .union([+ zod.null(),+ zod+ .enum([+ 'CHANNEL',+ 'CHAT',+ 'COMPANY',+ 'DOCUMENT',+ 'PROJECT',+ 'TASK',+ 'THREAD',+ 'USER',+ ])+ .describe(+ 'Type of entity that can be referenced by entity properties.'+ ),+ ])+ .optional(),+ updated_at: zod.iso.datetime({}),+ })+ .describe(+ 'Property definition model (service representation).'+ ),+ value: zod+ .union([+ zod.null(),+ zod+ .union([+ zod+ .object({+ type: zod.enum(['Boolean']),+ value: zod+ .boolean()+ .describe(+ 'Boolean value\nSerializes as: {\"type\": \"Boolean\", \"value\": true}'+ ),+ })+ .describe(+ 'Boolean value\nSerializes as: {\"type\": \"Boolean\", \"value\": true}'+ ),+ zod+ .object({+ type: zod.enum(['Number']),+ value: zod+ .number()+ .describe(+ 'Numeric value\nSerializes as: {\"type\": \"Number\", \"value\": 42.5}'+ ),+ })+ .describe(+ 'Numeric value\nSerializes as: {\"type\": \"Number\", \"value\": 42.5}'+ ),+ zod+ .object({+ type: zod.enum(['String']),+ value: zod+ .string()+ .describe(+ 'String value\nSerializes as: {\"type\": \"String\", \"value\": \"text\"}'+ ),+ })+ .describe(+ 'String value\nSerializes as: {\"type\": \"String\", \"value\": \"text\"}'+ ),+ zod+ .object({+ type: zod.enum(['Date']),+ value: zod.iso+ .datetime({})+ .describe(+ 'Date\/timestamp value\nSerializes as: {\"type\": \"Date\", \"value\": \"2025-01-01T00:00:00Z\"}'+ ),+ })+ .describe(+ 'Date\/timestamp value\nSerializes as: {\"type\": \"Date\", \"value\": \"2025-01-01T00:00:00Z\"}'+ ),+ zod+ .object({+ type: zod.enum(['SelectOption']),+ value: zod+ .array(zod.uuid())+ .describe(+ 'Select option(s) - always an array (check is_multi_select to determine if single or multi)\nSingle-select: {\"type\": \"SelectOption\", \"value\": [\"uuid\"]} (length 0 or 1)\nMulti-select: {\"type\": \"SelectOption\", \"value\": [\"uuid1\", \"uuid2\", ...]} (length 0+)'+ ),+ })+ .describe(+ 'Select option(s) - always an array (check is_multi_select to determine if single or multi)\nSingle-select: {\"type\": \"SelectOption\", \"value\": [\"uuid\"]} (length 0 or 1)\nMulti-select: {\"type\": \"SelectOption\", \"value\": [\"uuid1\", \"uuid2\", ...]} (length 0+)'+ ),+ zod+ .object({+ type: zod.enum(['EntityReference']),+ value: zod+ .array(+ zod+ .object({+ entity_id: zod.string(),+ entity_type: zod+ .enum([+ 'CHANNEL',+ 'CHAT',+ 'COMPANY',+ 'DOCUMENT',+ 'PROJECT',+ 'TASK',+ 'THREAD',+ 'USER',+ ])+ .describe(+ 'Type of entity that can be referenced by entity properties.'+ ),+ specific_message_id: zod+ .uuid()+ .nullish()+ .describe(+ 'For CHANNEL, CHAT, THREAD entity types - optional specific message ID.\nThis allows referencing a specific message within a thread\/channel\/chat.'+ ),+ })+ .describe(+ 'Entity reference for entity-type property values.'+ )+ )+ .describe(+ 'Entity reference(s) - always an array (check is_multi_select to determine if single or multi)\nSingle-select: {\"type\": \"EntityReference\", \"value\": [{...}]} (length 0 or 1)\nMulti-select: {\"type\": \"EntityReference\", \"value\": [{...}, {...}, ...]} (length 0+)'+ ),+ })+ .describe(+ 'Entity reference(s) - always an array (check is_multi_select to determine if single or multi)\nSingle-select: {\"type\": \"EntityReference\", \"value\": [{...}]} (length 0 or 1)\nMulti-select: {\"type\": \"EntityReference\", \"value\": [{...}, {...}, ...]} (length 0+)'+ ),+ zod+ .object({+ type: zod.enum(['Link']),+ value: zod+ .array(zod.string())+ .describe(+ 'Link value(s) - always an array (check is_multi_select to determine if single or multi)\nSingle-select: {\"type\": \"Link\", \"value\": [\"https:\/\/example.com\"]} (length 0 or 1)\nMulti-select: {\"type\": \"Link\", \"value\": [\"https:\/\/example.com\", \"https:\/\/other.com\"]} (length 0+)'+ ),+ })+ .describe(+ 'Link value(s) - always an array (check is_multi_select to determine if single or multi)\nSingle-select: {\"type\": \"Link\", \"value\": [\"https:\/\/example.com\"]} (length 0 or 1)\nMulti-select: {\"type\": \"Link\", \"value\": [\"https:\/\/example.com\", \"https:\/\/other.com\"]} (length 0+)'+ ),+ ])+ .describe(+ 'Property value (service representation).\n\nRepresents the actual value stored for an entity property.\nThis is serialized to\/from JSONB in the database.'+ ),+ ])+ .optional(),+ })+ .describe(+ 'A property attached to a Soup item.\n\nThis is a simplified representation that includes only the definition and value,\nomitting the entity property assignment metadata and options.'+ )+ )+ .describe('Properties'),+ updatedAt: zod.iso+ .datetime({})+ .describe('The time the chat was last updated'),+ viewedAt: zod.iso+ .datetime({})+ .nullish()+ .describe('The time the chat was last viewed'),+ })+ .describe('A chat as displayed in Soup.'),+ tag: zod.enum(['chat']),+ })+ .describe('Chat item.'),+ zod+ .object({+ data: zod+ .object({+ createdAt: zod.iso+ .datetime({})+ .describe('The time the project was created'),+ deletedAt: zod.iso+ .datetime({})+ .nullish()+ .describe('The time the project was deleted'),+ id: zod.uuid().describe('The id of the project'),+ name: zod.string().describe('The name of the project'),+ ownerId: zod+ .string()+ .describe('The user id of who created the project'),+ parentId: zod+ .uuid()+ .nullish()+ .describe('The parent project id'),+ properties: zod+ .array(+ zod+ .object({+ definition: zod+ .object({+ created_at: zod.iso.datetime({}),+ data_type: zod+ .enum([+ 'BOOLEAN',+ 'DATE',+ 'NUMBER',+ 'STRING',+ 'SELECT_NUMBER',+ 'SELECT_STRING',+ 'ENTITY',+ 'LINK',+ ])+ .describe(+ 'Data type for property values, determining storage and validation.'+ ),+ display_name: zod.string(),+ id: zod.uuid(),+ is_metadata: zod+ .boolean()+ .describe(+ 'Flag to indicate if this is a system-generated metadata property.\nNot stored in database - computed at service layer.'+ ),+ is_multi_select: zod.boolean(),+ is_system: zod+ .boolean()+ .describe(+ 'Flag to indicate if this is a system property (stored in DB).'+ ),+ owner: zod+ .union([+ zod+ .object({+ scope: zod.enum(['user']),+ user_id: zod.string(),+ })+ .describe('User-scoped property only'),+ zod+ .object({+ organization_id: zod.number(),+ scope: zod.enum(['organization']),+ })+ .describe(+ 'Organization-scoped property only'+ ),+ zod+ .object({+ organization_id: zod.number(),+ scope: zod.enum([+ 'user_and_organization',+ ]),+ user_id: zod.string(),+ })+ .describe(+ 'Both user and organization-scoped'+ ),+ zod+ .object({+ scope: zod.enum(['system']),+ })+ .describe(+ 'System-owned property (no user or org owner)'+ ),+ ])+ .describe(+ 'Defines who owns a property - user-scoped, org-scoped, system, or both user and org.'+ ),+ specific_entity_type: zod+ .union([+ zod.null(),+ zod+ .enum([+ 'CHANNEL',+ 'CHAT',+ 'COMPANY',+ 'DOCUMENT',+ 'PROJECT',+ 'TASK',+ 'THREAD',+ 'USER',+ ])+ .describe(+ 'Type of entity that can be referenced by entity properties.'+ ),+ ])+ .optional(),+ updated_at: zod.iso.datetime({}),+ })+ .describe(+ 'Property definition model (service representation).'+ ),+ value: zod+ .union([+ zod.null(),+ zod+ .union([+ zod+ .object({+ type: zod.enum(['Boolean']),+ value: zod+ .boolean()+ .describe(+ 'Boolean value\nSerializes as: {\"type\": \"Boolean\", \"value\": true}'+ ),+ })+ .describe(+ 'Boolean value\nSerializes as: {\"type\": \"Boolean\", \"value\": true}'+ ),+ zod+ .object({+ type: zod.enum(['Number']),+ value: zod+ .number()+ .describe(+ 'Numeric value\nSerializes as: {\"type\": \"Number\", \"value\": 42.5}'+ ),+ })+ .describe(+ 'Numeric value\nSerializes as: {\"type\": \"Number\", \"value\": 42.5}'+ ),+ zod+ .object({+ type: zod.enum(['String']),+ value: zod+ .string()+ .describe(+ 'String value\nSerializes as: {\"type\": \"String\", \"value\": \"text\"}'+ ),+ })+ .describe(+ 'String value\nSerializes as: {\"type\": \"String\", \"value\": \"text\"}'+ ),+ zod+ .object({+ type: zod.enum(['Date']),+ value: zod.iso+ .datetime({})+ .describe(+ 'Date\/timestamp value\nSerializes as: {\"type\": \"Date\", \"value\": \"2025-01-01T00:00:00Z\"}'+ ),+ })+ .describe(+ 'Date\/timestamp value\nSerializes as: {\"type\": \"Date\", \"value\": \"2025-01-01T00:00:00Z\"}'+ ),+ zod+ .object({+ type: zod.enum(['SelectOption']),+ value: zod+ .array(zod.uuid())+ .describe(+ 'Select option(s) - always an array (check is_multi_select to determine if single or multi)\nSingle-select: {\"type\": \"SelectOption\", \"value\": [\"uuid\"]} (length 0 or 1)\nMulti-select: {\"type\": \"SelectOption\", \"value\": [\"uuid1\", \"uuid2\", ...]} (length 0+)'+ ),+ })+ .describe(+ 'Select option(s) - always an array (check is_multi_select to determine if single or multi)\nSingle-select: {\"type\": \"SelectOption\", \"value\": [\"uuid\"]} (length 0 or 1)\nMulti-select: {\"type\": \"SelectOption\", \"value\": [\"uuid1\", \"uuid2\", ...]} (length 0+)'+ ),+ zod+ .object({+ type: zod.enum(['EntityReference']),+ value: zod+ .array(+ zod+ .object({+ entity_id: zod.string(),+ entity_type: zod+ .enum([+ 'CHANNEL',+ 'CHAT',+ 'COMPANY',+ 'DOCUMENT',+ 'PROJECT',+ 'TASK',+ 'THREAD',+ 'USER',+ ])+ .describe(+ 'Type of entity that can be referenced by entity properties.'+ ),+ specific_message_id: zod+ .uuid()+ .nullish()+ .describe(+ 'For CHANNEL, CHAT, THREAD entity types - optional specific message ID.\nThis allows referencing a specific message within a thread\/channel\/chat.'+ ),+ })+ .describe(+ 'Entity reference for entity-type property values.'+ )+ )+ .describe(+ 'Entity reference(s) - always an array (check is_multi_select to determine if single or multi)\nSingle-select: {\"type\": \"EntityReference\", \"value\": [{...}]} (length 0 or 1)\nMulti-select: {\"type\": \"EntityReference\", \"value\": [{...}, {...}, ...]} (length 0+)'+ ),+ })+ .describe(+ 'Entity reference(s) - always an array (check is_multi_select to determine if single or multi)\nSingle-select: {\"type\": \"EntityReference\", \"value\": [{...}]} (length 0 or 1)\nMulti-select: {\"type\": \"EntityReference\", \"value\": [{...}, {...}, ...]} (length 0+)'+ ),+ zod+ .object({+ type: zod.enum(['Link']),+ value: zod+ .array(zod.string())+ .describe(+ 'Link value(s) - always an array (check is_multi_select to determine if single or multi)\nSingle-select: {\"type\": \"Link\", \"value\": [\"https:\/\/example.com\"]} (length 0 or 1)\nMulti-select: {\"type\": \"Link\", \"value\": [\"https:\/\/example.com\", \"https:\/\/other.com\"]} (length 0+)'+ ),+ })+ .describe(+ 'Link value(s) - always an array (check is_multi_select to determine if single or multi)\nSingle-select: {\"type\": \"Link\", \"value\": [\"https:\/\/example.com\"]} (length 0 or 1)\nMulti-select: {\"type\": \"Link\", \"value\": [\"https:\/\/example.com\", \"https:\/\/other.com\"]} (length 0+)'+ ),+ ])+ .describe(+ 'Property value (service representation).\n\nRepresents the actual value stored for an entity property.\nThis is serialized to\/from JSONB in the database.'+ ),+ ])+ .optional(),+ })+ .describe(+ 'A property attached to a Soup item.\n\nThis is a simplified representation that includes only the definition and value,\nomitting the entity property assignment metadata and options.'+ )+ )+ .describe('Properties'),+ updatedAt: zod.iso+ .datetime({})+ .describe('The time the project was updated'),+ viewedAt: zod.iso+ .datetime({})+ .nullish()+ .describe('The time the document was last viewed'),+ })+ .describe('A project as displayed in Soup.'),+ tag: zod.enum(['project']),+ })+ .describe('Project item.'),+ zod+ .object({+ data: zod+ .object({+ createdAt: zod.iso+ .datetime({})+ .describe('Timestamp when the thread was created.'),+ id: zod.uuid().describe('Thread id.'),+ inboxVisible: zod+ .boolean()+ .describe('Whether the thread should appear in the inbox.'),+ isDraft: zod+ .boolean()+ .describe('Whether the thread contains a draft.'),+ isImportant: zod+ .boolean()+ .describe('Whether the thread is marked important.'),+ isRead: zod+ .boolean()+ .describe('Whether the thread has been read.'),+ name: zod+ .string()+ .nullish()+ .describe('Thread display name or subject.'),+ ownerId: zod.string().describe('Owner user id.'),+ projectId: zod+ .string()+ .nullish()+ .describe('Project id associated with the thread.'),+ providerId: zod+ .string()+ .nullish()+ .describe('Provider-specific thread id.'),+ senderEmail: zod+ .string()+ .nullish()+ .describe('Sender email address for the preview.'),+ senderName: zod+ .string()+ .nullish()+ .describe('Sender display name for the preview.'),+ senderPhotoUrl: zod+ .string()+ .nullish()+ .describe('Sender photo URL for the preview.'),+ snippet: zod.string().nullish().describe('Thread snippet.'),+ sortTs: zod.iso+ .datetime({})+ .describe('Timestamp used for email thread sorting.'),+ updatedAt: zod.iso+ .datetime({})+ .describe('Timestamp when the thread was last updated.'),+ viewedAt: zod.iso+ .datetime({})+ .nullish()+ .describe(+ 'Timestamp when the requesting user last viewed the thread.'+ ),+ })+ .describe('Email thread preview data as displayed in Soup.')+ .and(+ zod.object({+ attachments: zod+ .array(zod- .union([- zod- .object({- type: zod.enum(['Boolean']),- value: zod- .boolean()- .describe(- 'Boolean value\nSerializes as: {\"type\": \"Boolean\", \"value\": true}'- ),- })- .describe(- 'Boolean value\nSerializes as: {\"type\": \"Boolean\", \"value\": true}'- ),- zod- .object({- type: zod.enum(['Number']),- value: zod- .number()- .describe(- 'Numeric value\nSerializes as: {\"type\": \"Number\", \"value\": 42.5}'- ),- })+ .object({+ contentId: zod+ .string()+ .nullish()+ .describe('Content id for inline attachments.'),+ createdAt: zod.iso+ .datetime({}).describe(- 'Numeric value\nSerializes as: {\"type\": \"Number\", \"value\": 42.5}'+ 'Timestamp when the attachment was created.'),- zod- .object({- type: zod.enum(['String']),- value: zod- .string()- .describe(- 'String value\nSerializes as: {\"type\": \"String\", \"value\": \"text\"}'- ),- })+ filename: zod+ .string()+ .nullish()+ .describe('Attachment filename.'),+ id: zod.uuid().describe('Attachment id.'),+ messageId: zod+ .uuid().describe(- 'String value\nSerializes as: {\"type\": \"String\", \"value\": \"text\"}'+ 'Message id that owns this attachment.'),- zod- .object({- type: zod.enum(['Date']),- value: zod.iso- .datetime({})- .describe(- 'Date\/timestamp value\nSerializes as: {\"type\": \"Date\", \"value\": \"2025-01-01T00:00:00Z\"}'- ),- })+ mimeType: zod+ .string()+ .nullish()+ .describe('Attachment MIME type.'),+ providerAttachmentId: zod+ .string()+ .nullish()+ .describe('Provider-specific attachment id.'),+ sizeBytes: zod+ .number()+ .nullish()+ .describe('Attachment size in bytes.'),+ })+ .describe('An email attachment as displayed in Soup.')+ )+ .describe('Attachments on the thread.'),+ labels: zod+ .array(+ zod+ .object({+ createdAt: zod.iso+ .datetime({}).describe(- 'Date\/timestamp value\nSerializes as: {\"type\": \"Date\", \"value\": \"2025-01-01T00:00:00Z\"}'+ 'Timestamp when the label was created.'),- zod- .object({- type: zod.enum(['SelectOption']),- value: zod- .array(zod.uuid())- .describe(- 'Select option(s) - always an array (check is_multi_select to determine if single or multi)\nSingle-select: {\"type\": \"SelectOption\", \"value\": [\"uuid\"]} (length 0 or 1)\nMulti-select: {\"type\": \"SelectOption\", \"value\": [\"uuid1\", \"uuid2\", ...]} (length 0+)'- ),- })+ id: zod.uuid().describe('Label id.'),+ labelListVisibility: zod+ .enum([+ 'labelShow',+ 'labelShowIfUnread',+ 'labelHide',+ ])+ .describe('Gmail-style label list visibility.'),+ linkId: zod+ .uuid().describe(- 'Select option(s) - always an array (check is_multi_select to determine if single or multi)\nSingle-select: {\"type\": \"SelectOption\", \"value\": [\"uuid\"]} (length 0 or 1)\nMulti-select: {\"type\": \"SelectOption\", \"value\": [\"uuid1\", \"uuid2\", ...]} (length 0+)'+ 'Connected account link id for the label.'),- zod- .object({- type: zod.enum(['EntityReference']),- value: zod- .array(- zod- .object({- entity_id: zod.string(),- entity_type: zod- .enum([- 'CHANNEL',- 'CHAT',- 'COMPANY',- 'DOCUMENT',- 'PROJECT',- 'TASK',- 'THREAD',- 'USER',- ])- .describe(- 'Type of entity that can be referenced by entity properties.'- ),- specific_message_id: zod- .uuid()- .nullish()- .describe(- 'For CHANNEL, CHAT, THREAD entity types - optional specific message ID.\nThis allows referencing a specific message within a thread\/channel\/chat.'- ),- })- .describe(- 'Entity reference for entity-type property values.'- )- )- .describe(- 'Entity reference(s) - always an array (check is_multi_select to determine if single or multi)\nSingle-select: {\"type\": \"EntityReference\", \"value\": [{...}]} (length 0 or 1)\nMulti-select: {\"type\": \"EntityReference\", \"value\": [{...}, {...}, ...]} (length 0+)'- ),- })+ messageListVisibility: zod+ .enum(['show', 'hide']).describe(- 'Entity reference(s) - always an array (check is_multi_select to determine if single or multi)\nSingle-select: {\"type\": \"EntityReference\", \"value\": [{...}]} (length 0 or 1)\nMulti-select: {\"type\": \"EntityReference\", \"value\": [{...}, {...}, ...]} (length 0+)'+ 'Gmail-style message list visibility for a label.'),- zod- .object({- type: zod.enum(['Link']),- value: zod- .array(zod.string())- .describe(- 'Link value(s) - always an array (check is_multi_select to determine if single or multi)\nSingle-select: {\"type\": \"Link\", \"value\": [\"https:\/\/example.com\"]} (length 0 or 1)\nMulti-select: {\"type\": \"Link\", \"value\": [\"https:\/\/example.com\", \"https:\/\/other.com\"]} (length 0+)'- ),- })+ name: zod.string().describe('Label display name.'),+ providerLabelId: zod+ .string()+ .describe('Provider-specific label id.'),+ type: zod+ .enum(['system', 'user']).describe(- 'Link value(s) - always an array (check is_multi_select to determine if single or multi)\nSingle-select: {\"type\": \"Link\", \"value\": [\"https:\/\/example.com\"]} (length 0 or 1)\nMulti-select: {\"type\": \"Link\", \"value\": [\"https:\/\/example.com\", \"https:\/\/other.com\"]} (length 0+)'+ 'Whether an email label is provider-created or user-created.'),- ])- .describe(- 'Property value (service representation).\n\nRepresents the actual value stored for an entity property.\nThis is serialized to\/from JSONB in the database.'- ),- ])- .optional(),- })- .describe(- 'A property attached to a Soup item.\n\nThis is a simplified representation that includes only the definition and value,\nomitting the entity property assignment metadata and options.'- )- )- .describe('Properties'),- updatedAt: zod.iso- .datetime({})- .describe('The time the chat was last updated'),- viewedAt: zod.iso- .datetime({})- .nullish()- .describe('The time the chat was last viewed'),- }),- tag: zod.enum(['chat']),- }),- zod.object({- data: zod.object({- createdAt: zod.iso- .datetime({})- .describe('The time the project was created'),- deletedAt: zod.iso- .datetime({})- .nullish()- .describe('The time the project was deleted'),- id: zod.uuid().describe('The id of the project'),- name: zod.string().describe('The name of the project'),- ownerId: zod- .string()- .describe('The user id of who created the project'),- parentId: zod.uuid().nullish().describe('The parent project id'),- properties: zod- .array(- zod- .object({- definition: zod- .object({- created_at: zod.iso.datetime({}),- data_type: zod- .enum([- 'BOOLEAN',- 'DATE',- 'NUMBER',- 'STRING',- 'SELECT_NUMBER',- 'SELECT_STRING',- 'ENTITY',- 'LINK',- ])- .describe(- 'Data type for property values, determining storage and validation.'- ),- display_name: zod.string(),- id: zod.uuid(),- is_metadata: zod- .boolean()- .describe(- 'Flag to indicate if this is a system-generated metadata property.\nNot stored in database - computed at service layer.'- ),- is_multi_select: zod.boolean(),- is_system: zod- .boolean()- .describe(- 'Flag to indicate if this is a system property (stored in DB).'- ),- owner: zod- .union([- zod- .object({- scope: zod.enum(['user']),- user_id: zod.string(),- })- .describe('User-scoped property only'),- zod- .object({- organization_id: zod.number(),- scope: zod.enum(['organization']),- })- .describe('Organization-scoped property only'),- zod- .object({- organization_id: zod.number(),- scope: zod.enum(['user_and_organization']),- user_id: zod.string(),- })- .describe('Both user and organization-scoped'),- zod- .object({- scope: zod.enum(['system']),- })+ })+ .describe('An email label as displayed in Soup.')+ )+ .describe('Labels attached to the thread.'),+ participants: zod+ .array(+ zod+ .object({+ emailAddress: zod+ .string()+ .nullish()+ .describe('Contact email address.'),+ id: zod.uuid().describe('Contact id.'),+ linkId: zod+ .uuid().describe(- 'System-owned property (no user or org owner)'+ 'Connected account link id for the contact.'),- ])- .describe(- 'Defines who owns a property - user-scoped, org-scoped, system, or both user and org.'- ),- specific_entity_type: zod- .union([- zod.null(),- zod- .enum([- 'CHANNEL',- 'CHAT',- 'COMPANY',- 'DOCUMENT',- 'PROJECT',- 'TASK',- 'THREAD',- 'USER',- ])+ name: zod+ .string()+ .nullish()+ .describe('Contact display name.'),+ sfsPhotoUrl: zod+ .string()+ .nullish().describe(- 'Type of entity that can be referenced by entity properties.'+ 'Contact photo URL from SFS, if available.'),- ])- .optional(),- updated_at: zod.iso.datetime({}),- })- .describe(- 'Property definition model (service representation).'- ),- value: zod- .union([- zod.null(),+ })+ .describe(+ 'A contact participating in an email thread as displayed in Soup.'+ )+ )+ .describe('Contacts participating in the thread.'),+ properties: zod+ .array(zod- .union([- zod- .object({- type: zod.enum(['Boolean']),- value: zod- .boolean()- .describe(- 'Boolean value\nSerializes as: {\"type\": \"Boolean\", \"value\": true}'- ),- })- .describe(- 'Boolean value\nSerializes as: {\"type\": \"Boolean\", \"value\": true}'- ),- zod+ .object({+ definition: zod.object({- type: zod.enum(['Number']),- value: zod- .number()+ created_at: zod.iso.datetime({}),+ data_type: zod+ .enum([+ 'BOOLEAN',+ 'DATE',+ 'NUMBER',+ 'STRING',+ 'SELECT_NUMBER',+ 'SELECT_STRING',+ 'ENTITY',+ 'LINK',+ ]).describe(- 'Numeric value\nSerializes as: {\"type\": \"Number\", \"value\": 42.5}'+ 'Data type for property values, determining storage and validation.'),- })- .describe(- 'Numeric value\nSerializes as: {\"type\": \"Number\", \"value\": 42.5}'- ),- zod- .object({- type: zod.enum(['String']),- value: zod- .string()+ display_name: zod.string(),+ id: zod.uuid(),+ is_metadata: zod+ .boolean().describe(- 'String value\nSerializes as: {\"type\": \"String\", \"value\": \"text\"}'+ 'Flag to indicate if this is a system-generated metadata property.\nNot stored in database - computed at service layer.'),- })- .describe(- 'String value\nSerializes as: {\"type\": \"String\", \"value\": \"text\"}'- ),- zod- .object({- type: zod.enum(['Date']),- value: zod.iso- .datetime({})+ is_multi_select: zod.boolean(),+ is_system: zod+ .boolean().describe(- 'Date\/timestamp value\nSerializes as: {\"type\": \"Date\", \"value\": \"2025-01-01T00:00:00Z\"}'+ 'Flag to indicate if this is a system property (stored in DB).'),- })- .describe(- 'Date\/timestamp value\nSerializes as: {\"type\": \"Date\", \"value\": \"2025-01-01T00:00:00Z\"}'- ),- zod- .object({- type: zod.enum(['SelectOption']),- value: zod- .array(zod.uuid())+ owner: zod+ .union([+ zod+ .object({+ scope: zod.enum(['user']),+ user_id: zod.string(),+ })+ .describe('User-scoped property only'),+ zod+ .object({+ organization_id: zod.number(),+ scope: zod.enum(['organization']),+ })+ .describe(+ 'Organization-scoped property only'+ ),+ zod+ .object({+ organization_id: zod.number(),+ scope: zod.enum([+ 'user_and_organization',+ ]),+ user_id: zod.string(),+ })+ .describe(+ 'Both user and organization-scoped'+ ),+ zod+ .object({+ scope: zod.enum(['system']),+ })+ .describe(+ 'System-owned property (no user or org owner)'+ ),+ ]).describe(- 'Select option(s) - always an array (check is_multi_select to determine if single or multi)\nSingle-select: {\"type\": \"SelectOption\", \"value\": [\"uuid\"]} (length 0 or 1)\nMulti-select: {\"type\": \"SelectOption\", \"value\": [\"uuid1\", \"uuid2\", ...]} (length 0+)'+ 'Defines who owns a property - user-scoped, org-scoped, system, or both user and org.'),+ specific_entity_type: zod+ .union([+ zod.null(),+ zod+ .enum([+ 'CHANNEL',+ 'CHAT',+ 'COMPANY',+ 'DOCUMENT',+ 'PROJECT',+ 'TASK',+ 'THREAD',+ 'USER',+ ])+ .describe(+ 'Type of entity that can be referenced by entity properties.'+ ),+ ])+ .optional(),+ updated_at: zod.iso.datetime({}),}).describe(- 'Select option(s) - always an array (check is_multi_select to determine if single or multi)\nSingle-select: {\"type\": \"SelectOption\", \"value\": [\"uuid\"]} (length 0 or 1)\nMulti-select: {\"type\": \"SelectOption\", \"value\": [\"uuid1\", \"uuid2\", ...]} (length 0+)'+ 'Property definition model (service representation).'),- zod- .object({- type: zod.enum(['EntityReference']),- value: zod- .array(+ value: zod+ .union([+ zod.null(),+ zod+ .union([zod.object({- entity_id: zod.string(),- entity_type: zod- .enum([- 'CHANNEL',- 'CHAT',- 'COMPANY',- 'DOCUMENT',- 'PROJECT',- 'TASK',- 'THREAD',- 'USER',- ])+ type: zod.enum(['Boolean']),+ value: zod+ .boolean().describe(- 'Type of entity that can be referenced by entity properties.'+ 'Boolean value\nSerializes as: {\"type\": \"Boolean\", \"value\": true}'),- specific_message_id: zod- .uuid()- .nullish()+ })+ .describe(+ 'Boolean value\nSerializes as: {\"type\": \"Boolean\", \"value\": true}'+ ),+ zod+ .object({+ type: zod.enum(['Number']),+ value: zod+ .number().describe(- 'For CHANNEL, CHAT, THREAD entity types - optional specific message ID.\nThis allows referencing a specific message within a thread\/channel\/chat.'+ 'Numeric value\nSerializes as: {\"type\": \"Number\", \"value\": 42.5}'),}).describe(- 'Entity reference for entity-type property values.'- )- )- .describe(- 'Entity reference(s) - always an array (check is_multi_select to determine if single or multi)\nSingle-select: {\"type\": \"EntityReference\", \"value\": [{...}]} (length 0 or 1)\nMulti-select: {\"type\": \"EntityReference\", \"value\": [{...}, {...}, ...]} (length 0+)'- ),- })- .describe(- 'Entity reference(s) - always an array (check is_multi_select to determine if single or multi)\nSingle-select: {\"type\": \"EntityReference\", \"value\": [{...}]} (length 0 or 1)\nMulti-select: {\"type\": \"EntityReference\", \"value\": [{...}, {...}, ...]} (length 0+)'- ),- zod- .object({- type: zod.enum(['Link']),- value: zod- .array(zod.string())+ 'Numeric value\nSerializes as: {\"type\": \"Number\", \"value\": 42.5}'+ ),+ zod+ .object({+ type: zod.enum(['String']),+ value: zod+ .string()+ .describe(+ 'String value\nSerializes as: {\"type\": \"String\", \"value\": \"text\"}'+ ),+ })+ .describe(+ 'String value\nSerializes as: {\"type\": \"String\", \"value\": \"text\"}'+ ),+ zod+ .object({+ type: zod.enum(['Date']),+ value: zod.iso+ .datetime({})+ .describe(+ 'Date\/timestamp value\nSerializes as: {\"type\": \"Date\", \"value\": \"2025-01-01T00:00:00Z\"}'+ ),+ })+ .describe(+ 'Date\/timestamp value\nSerializes as: {\"type\": \"Date\", \"value\": \"2025-01-01T00:00:00Z\"}'+ ),+ zod+ .object({+ type: zod.enum(['SelectOption']),+ value: zod+ .array(zod.uuid())+ .describe(+ 'Select option(s) - always an array (check is_multi_select to determine if single or multi)\nSingle-select: {\"type\": \"SelectOption\", \"value\": [\"uuid\"]} (length 0 or 1)\nMulti-select: {\"type\": \"SelectOption\", \"value\": [\"uuid1\", \"uuid2\", ...]} (length 0+)'+ ),+ })+ .describe(+ 'Select option(s) - always an array (check is_multi_select to determine if single or multi)\nSingle-select: {\"type\": \"SelectOption\", \"value\": [\"uuid\"]} (length 0 or 1)\nMulti-select: {\"type\": \"SelectOption\", \"value\": [\"uuid1\", \"uuid2\", ...]} (length 0+)'+ ),+ zod+ .object({+ type: zod.enum(['EntityReference']),+ value: zod+ .array(+ zod+ .object({+ entity_id: zod.string(),+ entity_type: zod+ .enum([+ 'CHANNEL',+ 'CHAT',+ 'COMPANY',+ 'DOCUMENT',+ 'PROJECT',+ 'TASK',+ 'THREAD',+ 'USER',+ ])+ .describe(+ 'Type of entity that can be referenced by entity properties.'+ ),+ specific_message_id: zod+ .uuid()+ .nullish()+ .describe(+ 'For CHANNEL, CHAT, THREAD entity types - optional specific message ID.\nThis allows referencing a specific message within a thread\/channel\/chat.'+ ),+ })+ .describe(+ 'Entity reference for entity-type property values.'+ )+ )+ .describe(+ 'Entity reference(s) - always an array (check is_multi_select to determine if single or multi)\nSingle-select: {\"type\": \"EntityReference\", \"value\": [{...}]} (length 0 or 1)\nMulti-select: {\"type\": \"EntityReference\", \"value\": [{...}, {...}, ...]} (length 0+)'+ ),+ })+ .describe(+ 'Entity reference(s) - always an array (check is_multi_select to determine if single or multi)\nSingle-select: {\"type\": \"EntityReference\", \"value\": [{...}]} (length 0 or 1)\nMulti-select: {\"type\": \"EntityReference\", \"value\": [{...}, {...}, ...]} (length 0+)'+ ),+ zod+ .object({+ type: zod.enum(['Link']),+ value: zod+ .array(zod.string())+ .describe(+ 'Link value(s) - always an array (check is_multi_select to determine if single or multi)\nSingle-select: {\"type\": \"Link\", \"value\": [\"https:\/\/example.com\"]} (length 0 or 1)\nMulti-select: {\"type\": \"Link\", \"value\": [\"https:\/\/example.com\", \"https:\/\/other.com\"]} (length 0+)'+ ),+ })+ .describe(+ 'Link value(s) - always an array (check is_multi_select to determine if single or multi)\nSingle-select: {\"type\": \"Link\", \"value\": [\"https:\/\/example.com\"]} (length 0 or 1)\nMulti-select: {\"type\": \"Link\", \"value\": [\"https:\/\/example.com\", \"https:\/\/other.com\"]} (length 0+)'+ ),+ ]).describe(- 'Link value(s) - always an array (check is_multi_select to determine if single or multi)\nSingle-select: {\"type\": \"Link\", \"value\": [\"https:\/\/example.com\"]} (length 0 or 1)\nMulti-select: {\"type\": \"Link\", \"value\": [\"https:\/\/example.com\", \"https:\/\/other.com\"]} (length 0+)'+ 'Property value (service representation).\n\nRepresents the actual value stored for an entity property.\nThis is serialized to\/from JSONB in the database.'),- })- .describe(- 'Link value(s) - always an array (check is_multi_select to determine if single or multi)\nSingle-select: {\"type\": \"Link\", \"value\": [\"https:\/\/example.com\"]} (length 0 or 1)\nMulti-select: {\"type\": \"Link\", \"value\": [\"https:\/\/example.com\", \"https:\/\/other.com\"]} (length 0+)'- ),- ])+ ])+ .optional(),+ }).describe(- 'Property value (service representation).\n\nRepresents the actual value stored for an entity property.\nThis is serialized to\/from JSONB in the database.'- ),- ])- .optional(),- })- .describe(- 'A property attached to a Soup item.\n\nThis is a simplified representation that includes only the definition and value,\nomitting the entity property assignment metadata and options.'- )- )- .describe('Properties'),- updatedAt: zod.iso- .datetime({})- .describe('The time the project was updated'),- viewedAt: zod.iso- .datetime({})- .nullish()- .describe('The time the document was last viewed'),- }),- tag: zod.enum(['project']),- }),- zod.object({- data: zod- .object({- createdAt: zod.iso.datetime({}),- id: zod.uuid(),- inboxVisible: zod.boolean(),- isDraft: zod.boolean(),- isImportant: zod.boolean(),- isRead: zod.boolean(),- name: zod.string().nullish(),- ownerId: zod.string(),- projectId: zod.string().nullish(),- providerId: zod.string().nullish(),- senderEmail: zod.string().nullish(),- senderName: zod.string().nullish(),- senderPhotoUrl: zod.string().nullish(),- snippet: zod.string().nullish(),- sortTs: zod.iso.datetime({}),- updatedAt: zod.iso.datetime({}),- viewedAt: zod.iso.datetime({}).nullish(),- })- .and(- zod.object({- attachments: zod.array(- zod.object({- contentId: zod.string().nullish(),- createdAt: zod.iso.datetime({}),- filename: zod.string().nullish(),- id: zod.uuid(),- messageId: zod.uuid(),- mimeType: zod.string().nullish(),- providerAttachmentId: zod.string().nullish(),- sizeBytes: zod.number().nullish(),- })- ),- labels: zod.array(- zod.object({- createdAt: zod.iso.datetime({}),- id: zod.uuid(),- labelListVisibility: zod.enum([- 'labelShow',- 'labelShowIfUnread',- 'labelHide',- ]),- linkId: zod.uuid(),- messageListVisibility: zod.enum(['show', 'hide']),- name: zod.string(),- providerLabelId: zod.string(),- type: zod.enum(['system', 'user']),- })- ),- participants: zod.array(- zod.object({- emailAddress: zod.string().nullish(),- id: zod.uuid(),- linkId: zod.uuid(),- name: zod.string().nullish(),- sfsPhotoUrl: zod.string().nullish(),+ 'A property attached to a Soup item.\n\nThis is a simplified representation that includes only the definition and value,\nomitting the entity property assignment metadata and options.'+ )+ )+ .describe('Properties attached to the thread.'),})+ )+ .describe(+ 'Email thread preview enriched with related metadata for Soup.'),- properties: zod.array(- zod+ tag: zod.enum(['emailThread']),+ })+ .describe('Email thread item.'),+ zod+ .object({+ data: zod+ .object({+ channel: zod.object({- definition: zod+ channel_type: zod+ .enum(['public', 'private', 'direct_message', 'team'])+ .describe('Type of channel.'),+ created_at: zod.iso+ .datetime({})+ .describe('Creation timestamp.'),+ id: zod.uuid().describe('Channel id.'),+ name: zod+ .string()+ .nullish()+ .describe('Channel display name.'),+ org_id: zod+ .number()+ .min(getItemsSoupResponseItemsItemDataChannelOrgIdMin)+ .nullish()+ .describe('Organization id.'),+ owner_id: zod.string().describe('Channel owner.'),+ team_id: zod.uuid().nullish().describe('Team id.'),+ updated_at: zod.iso+ .datetime({})+ .describe('Update timestamp.'),+ })+ .describe('Channel metadata in soup payloads.'),+ participants: zod+ .array(+ zod.object({- created_at: zod.iso.datetime({}),- data_type: zod- .enum([- 'BOOLEAN',- 'DATE',- 'NUMBER',- 'STRING',- 'SELECT_NUMBER',- 'SELECT_STRING',- 'ENTITY',- 'LINK',- ])+ channel_id: zod+ .uuid().describe(- 'Data type for property values, determining storage and validation.'+ 'Channel id for the participant membership.'),- display_name: zod.string(),- id: zod.uuid(),- is_metadata: zod- .boolean()+ joined_at: zod.iso+ .datetime({}).describe(- 'Flag to indicate if this is a system-generated metadata property.\nNot stored in database - computed at service layer.'+ 'Timestamp when the participant joined the channel.'),- is_multi_select: zod.boolean(),- is_system: zod- .boolean()+ left_at: zod.iso+ .datetime({})+ .nullish().describe(- 'Flag to indicate if this is a system property (stored in DB).'+ 'Timestamp when the participant left the channel, if any.'),- owner: zod- .union([- zod- .object({- scope: zod.enum(['user']),- user_id: zod.string(),- })- .describe('User-scoped property only'),- zod- .object({- organization_id: zod.number(),- scope: zod.enum(['organization']),- })- .describe('Organization-scoped property only'),- zod- .object({- organization_id: zod.number(),- scope: zod.enum(['user_and_organization']),- user_id: zod.string(),- })- .describe('Both user and organization-scoped'),- zod- .object({- scope: zod.enum(['system']),- })+ role: zod+ .enum(['owner', 'admin', 'member'])+ .describe('The role a user has within a channel.'),+ user_id: zod+ .string()+ .describe('Participant user id.'),+ })+ .describe("A user's membership in a channel.")+ )+ .describe('Participants in the channel.'),+ })+ .describe('Channel metadata together with its participants.')+ .and(+ zod+ .object({+ latest_message: zod+ .union([+ zod.null(),+ zod+ .object({+ content: zod+ .string()+ .describe('Message content.'),+ created_at: zod.iso+ .datetime({})+ .describe('Creation timestamp.'),+ deleted_at: zod.iso+ .datetime({})+ .nullish()+ .describe('Deletion timestamp.'),+ mentions: zod+ .array(zod.string()).describe(- 'System-owned property (no user or org owner)'+ 'Message mentions formatted as `{ENTITY_TYPE}:{ENTITY_ID}`.'),- ])+ message_id: zod.uuid().describe('Message id.'),+ sender_id: zod.string().describe('Sender id.'),+ thread_id: zod+ .uuid()+ .nullish()+ .describe('Thread parent id.'),+ updated_at: zod.iso+ .datetime({})+ .describe('Update timestamp.'),+ }).describe(- 'Defines who owns a property - user-scoped, org-scoped, system, or both user and org.'+ 'Lightweight channel message for soup payloads.'),- specific_entity_type: zod- .union([- zod.null(),- zod- .enum([- 'CHANNEL',- 'CHAT',- 'COMPANY',- 'DOCUMENT',- 'PROJECT',- 'TASK',- 'THREAD',- 'USER',- ])- .describe(- 'Type of entity that can be referenced by entity properties.'- ),- ])- .optional(),- updated_at: zod.iso.datetime({}),- })- .describe(- 'Property definition model (service representation).'- ),- value: zod+ ])+ .optional(),+ latest_non_thread_message: zod.union([zod.null(),zod- .union([- zod- .object({- type: zod.enum(['Boolean']),- value: zod- .boolean()- .describe(- 'Boolean value\nSerializes as: {\"type\": \"Boolean\", \"value\": true}'- ),- })- .describe(- 'Boolean value\nSerializes as: {\"type\": \"Boolean\", \"value\": true}'- ),- zod- .object({- type: zod.enum(['Number']),- value: zod- .number()- .describe(- 'Numeric value\nSerializes as: {\"type\": \"Number\", \"value\": 42.5}'- ),- })- .describe(- 'Numeric value\nSerializes as: {\"type\": \"Number\", \"value\": 42.5}'- ),- zod- .object({- type: zod.enum(['String']),- value: zod- .string()- .describe(- 'String value\nSerializes as: {\"type\": \"String\", \"value\": \"text\"}'- ),- })- .describe(- 'String value\nSerializes as: {\"type\": \"String\", \"value\": \"text\"}'- ),- zod- .object({- type: zod.enum(['Date']),- value: zod.iso- .datetime({})- .describe(- 'Date\/timestamp value\nSerializes as: {\"type\": \"Date\", \"value\": \"2025-01-01T00:00:00Z\"}'- ),- })- .describe(- 'Date\/timestamp value\nSerializes as: {\"type\": \"Date\", \"value\": \"2025-01-01T00:00:00Z\"}'- ),- zod- .object({- type: zod.enum(['SelectOption']),- value: zod- .array(zod.uuid())- .describe(- 'Select option(s) - always an array (check is_multi_select to determine if single or multi)\nSingle-select: {\"type\": \"SelectOption\", \"value\": [\"uuid\"]} (length 0 or 1)\nMulti-select: {\"type\": \"SelectOption\", \"value\": [\"uuid1\", \"uuid2\", ...]} (length 0+)'- ),- })- .describe(- 'Select option(s) - always an array (check is_multi_select to determine if single or multi)\nSingle-select: {\"type\": \"SelectOption\", \"value\": [\"uuid\"]} (length 0 or 1)\nMulti-select: {\"type\": \"SelectOption\", \"value\": [\"uuid1\", \"uuid2\", ...]} (length 0+)'- ),- zod- .object({- type: zod.enum(['EntityReference']),- value: zod- .array(- zod- .object({- entity_id: zod.string(),- entity_type: zod- .enum([- 'CHANNEL',- 'CHAT',- 'COMPANY',- 'DOCUMENT',- 'PROJECT',- 'TASK',- 'THREAD',- 'USER',- ])- .describe(- 'Type of entity that can be referenced by entity properties.'- ),- specific_message_id: zod- .uuid()- .nullish()- .describe(- 'For CHANNEL, CHAT, THREAD entity types - optional specific message ID.\nThis allows referencing a specific message within a thread\/channel\/chat.'- ),- })- .describe(- 'Entity reference for entity-type property values.'- )- )- .describe(- 'Entity reference(s) - always an array (check is_multi_select to determine if single or multi)\nSingle-select: {\"type\": \"EntityReference\", \"value\": [{...}]} (length 0 or 1)\nMulti-select: {\"type\": \"EntityReference\", \"value\": [{...}, {...}, ...]} (length 0+)'- ),- })- .describe(- 'Entity reference(s) - always an array (check is_multi_select to determine if single or multi)\nSingle-select: {\"type\": \"EntityReference\", \"value\": [{...}]} (length 0 or 1)\nMulti-select: {\"type\": \"EntityReference\", \"value\": [{...}, {...}, ...]} (length 0+)'- ),- zod- .object({- type: zod.enum(['Link']),- value: zod- .array(zod.string())- .describe(- 'Link value(s) - always an array (check is_multi_select to determine if single or multi)\nSingle-select: {\"type\": \"Link\", \"value\": [\"https:\/\/example.com\"]} (length 0 or 1)\nMulti-select: {\"type\": \"Link\", \"value\": [\"https:\/\/example.com\", \"https:\/\/other.com\"]} (length 0+)'- ),- })+ .object({+ content: zod+ .string()+ .describe('Message content.'),+ created_at: zod.iso+ .datetime({})+ .describe('Creation timestamp.'),+ deleted_at: zod.iso+ .datetime({})+ .nullish()+ .describe('Deletion timestamp.'),+ mentions: zod+ .array(zod.string()).describe(- 'Link value(s) - always an array (check is_multi_select to determine if single or multi)\nSingle-select: {\"type\": \"Link\", \"value\": [\"https:\/\/example.com\"]} (length 0 or 1)\nMulti-select: {\"type\": \"Link\", \"value\": [\"https:\/\/example.com\", \"https:\/\/other.com\"]} (length 0+)'+ 'Message mentions formatted as `{ENTITY_TYPE}:{ENTITY_ID}`.'),- ])+ message_id: zod.uuid().describe('Message id.'),+ sender_id: zod.string().describe('Sender id.'),+ thread_id: zod+ .uuid()+ .nullish()+ .describe('Thread parent id.'),+ updated_at: zod.iso+ .datetime({})+ .describe('Update timestamp.'),+ }).describe(- 'Property value (service representation).\n\nRepresents the actual value stored for an entity property.\nThis is serialized to\/from JSONB in the database.'+ 'Lightweight channel message for soup payloads.'),]).optional(),})- .describe(- 'A property attached to a Soup item.\n\nThis is a simplified representation that includes only the definition and value,\nomitting the entity property assignment metadata and options.'- )- ),- })- ),- tag: zod.enum(['emailThread']),- }),- zod.object({- data: zod- .object({- channel: zod- .object({- channel_type: zod- .enum(['public', 'private', 'direct_message', 'team'])- .describe('Type of channel.'),- created_at: zod.iso- .datetime({})- .describe('Creation timestamp.'),- id: zod.uuid().describe('Channel id.'),- name: zod- .string()- .nullish()- .describe('Channel display name.'),- org_id: zod- .number()- .min(getItemsSoupResponseItemsItemDataChannelOrgIdMin)- .nullish()- .describe('Organization id.'),- owner_id: zod.string().describe('Channel owner.'),- team_id: zod.uuid().nullish().describe('Team id.'),- updated_at: zod.iso- .datetime({})- .describe('Update timestamp.'),- })- .describe('Channel metadata in soup payloads.'),- participants: zod.array(- zod.object({- channel_id: zod.uuid(),- joined_at: zod.iso.datetime({}),- left_at: zod.iso.datetime({}).nullish(),- role: zod- .enum(['owner', 'admin', 'member'])- .describe('The role a user has within a channel.'),- user_id: zod.string(),- })- ),+ .describe('Latest-message bundle for soup payloads.')+ )+ .and(+ zod.object({+ interacted_at: zod.iso+ .datetime({})+ .nullish()+ .describe(+ 'Timestamp when the requesting user last interacted with this channel.'+ ),+ viewed_at: zod.iso+ .datetime({})+ .nullish()+ .describe(+ 'Timestamp when the requesting user last viewed this channel.'+ ),+ })+ )+ .describe('A channel as displayed in Soup.'),+ tag: zod.enum(['channel']),})- .and(- zod+ .describe('Channel item.'),+ zod+ .object({+ data: zod.object({- latest_message: zod- .union([- zod.null(),- zod- .object({- content: zod.string().describe('Message content.'),- created_at: zod.iso- .datetime({})- .describe('Creation timestamp.'),- deleted_at: zod.iso- .datetime({})- .nullish()- .describe('Deletion timestamp.'),- mentions: zod- .array(zod.string())- .describe(- 'Message mentions formatted as `{ENTITY_TYPE}:{ENTITY_ID}`.'- ),- message_id: zod.uuid().describe('Message id.'),- sender_id: zod.string().describe('Sender id.'),- thread_id: zod- .uuid()- .nullish()- .describe('Thread parent id.'),- updated_at: zod.iso- .datetime({})- .describe('Update timestamp.'),- })- .describe(- 'Lightweight channel message for soup payloads.'- ),- ])- .optional(),- latest_non_thread_message: zod- .union([- zod.null(),+ channel_id: zod+ .uuid()+ .describe('Channel that owns the thread.'),+ messages: zod+ .array(zod.object({content: zod.string().describe('Message content.'),@@ -7455,213 +7703,256 @@ export const getItemsSoupResponse = zod.object({}).describe('Lightweight channel message for soup payloads.'- ),- ])- .optional(),- })- .describe('Latest-message bundle for soup payloads.')- )- .and(- zod.object({- interacted_at: zod.iso.datetime({}).nullish(),- viewed_at: zod.iso.datetime({}).nullish(),- })- ),- tag: zod.enum(['channel']),- }),- zod.object({- data: zod- .object({- attended: zod- .boolean()- .describe(- 'Whether the requesting user attended this call. Kept for compatibility\nand derived from `status == ATTENDED`.'- ),- callId: zod.uuid().describe('The call identifier.'),- channelId: zod- .uuid()- .describe('The channel this call belongs to.'),- channelName: zod- .string()- .nullish()- .describe('Resolved display name for the channel.'),- createdBy: zod.string().describe('User who created the call.'),- customName: zod- .string()- .nullish()- .describe(- 'User-supplied or AI-generated display name for the call.'- ),- durationMs: zod- .number()- .nullish()- .describe(- 'Call duration in milliseconds (None if still active).'- ),- endedAt: zod.iso- .datetime({})- .nullish()- .describe('When the call ended (None if still active).'),- isActive: zod- .boolean()- .describe('Whether the call is currently active.'),- participants: zod- .array(- zod+ )+ )+ .describe(+ 'Thread replies, using the same lightweight channel message shape.'+ ),+ root_message: zod.object({- joinedAt: zod.iso+ content: zod.string().describe('Message content.'),+ created_at: zod.iso.datetime({})- .describe('When the user joined the call.'),- leftAt: zod.iso+ .describe('Creation timestamp.'),+ deleted_at: zod.iso.datetime({}).nullish()+ .describe('Deletion timestamp.'),+ mentions: zod+ .array(zod.string()).describe(- 'When the user left (None if still in an active call).'+ 'Message mentions formatted as `{ENTITY_TYPE}:{ENTITY_ID}`.'),- userId: zod.string().describe('The user id.'),+ message_id: zod.uuid().describe('Message id.'),+ sender_id: zod.string().describe('Sender id.'),+ thread_id: zod+ .uuid()+ .nullish()+ .describe('Thread parent id.'),+ updated_at: zod.iso+ .datetime({})+ .describe('Update timestamp.'),})- .describe(- 'A participant in a call record, as displayed in Soup.'- )- )- .describe('Participants in the call.'),- startedAt: zod.iso- .datetime({})- .describe('When the call started.'),- status: zod- .enum(['ATTENDED', 'MISSED', 'UNATTENDED'])- .describe(- 'Viewer-relative attendance status for a call record.\nSerializes as `ATTENDED`, `MISSED`, or `UNATTENDED`.'- ),- summary: zod- .string()- .nullish()+ .describe('Lightweight channel message for soup payloads.'),+ }).describe(- 'AI-generated summary of the call. Only set on archived\n`call_records` once summarization has run; active calls always\nreturn `None`.'+ 'A top-level channel message thread for soup payloads.\n\nThis reuses the existing lightweight [`ChannelMessage`] shape used by\n[`SoupChannel`] latest-message data.'),+ tag: zod.enum(['channelThread']),})- .describe(- 'A call record as displayed in Soup. Excludes room_name, egress_id,\nand transcript — fields that are irrelevant for the soup feed.'- ),- tag: zod.enum(['call']),- }),- zod.object({- data: zod+ .describe('Channel thread item.'),+ zod.object({- createdAt: zod.iso- .datetime({})- .describe('When the company was created.'),- description: zod- .string()- .nullish()- .describe(- "Display description from the primary domain's directory entry."- ),- domains: zod- .array(- zod- .object({- companyId: zod- .uuid()- .describe(- 'The id of the company the domain belongs to.'- ),- createdAt: zod.iso- .datetime({})- .describe('When the domain record was created.'),- domain: zod- .string()+ data: zod+ .object({+ attended: zod+ .boolean()+ .describe(+ 'Whether the requesting user attended this call. Kept for compatibility\nand derived from `status == ATTENDED`.'+ ),+ callId: zod.uuid().describe('The call identifier.'),+ channelId: zod+ .uuid()+ .describe('The channel this call belongs to.'),+ channelName: zod+ .string()+ .nullish()+ .describe('Resolved display name for the channel.'),+ createdBy: zod+ .string()+ .describe('User who created the call.'),+ customName: zod+ .string()+ .nullish()+ .describe(+ 'User-supplied or AI-generated display name for the call.'+ ),+ durationMs: zod+ .number()+ .nullish()+ .describe(+ 'Call duration in milliseconds (None if still active).'+ ),+ endedAt: zod.iso+ .datetime({})+ .nullish()+ .describe('When the call ended (None if still active).'),+ isActive: zod+ .boolean()+ .describe('Whether the call is currently active.'),+ participants: zod+ .array(+ zod+ .object({+ joinedAt: zod.iso+ .datetime({})+ .describe('When the user joined the call.'),+ leftAt: zod.iso+ .datetime({})+ .nullish()+ .describe(+ 'When the user left (None if still in an active call).'+ ),+ userId: zod.string().describe('The user id.'),+ }).describe(- 'The domain (lowercased, e.g. \"acme.com\").'- ),- id: zod.uuid().describe('The id of the domain record.'),- })+ 'A participant in a call record, as displayed in Soup.'+ )+ )+ .describe('Participants in the call.'),+ startedAt: zod.iso+ .datetime({})+ .describe('When the call started.'),+ status: zod+ .enum(['ATTENDED', 'MISSED', 'UNATTENDED'])+ .describe(+ 'Viewer-relative attendance status for a call record.\nSerializes as `ATTENDED`, `MISSED`, or `UNATTENDED`.'+ ),+ summary: zod+ .string()+ .nullish().describe(- "A CRM domain as displayed in Soup. Mirrors the crm crate's\n[`CrmDomain`] with a stable wire shape that the FE can rely on."- )- )- .describe(- 'Domains associated with this company, ordered by creation time\nascending (primary first).'- ),- emailSync: zod- .boolean()- .describe('Whether email sync is enabled for this company.'),- hidden: zod- .boolean()- .describe(- 'Whether the company is hidden from CRM listings. Soup filters\nthese out by default.'- ),- id: zod.uuid().describe('The id of the company.'),- name: zod- .string()- .nullish()- .describe(- "Display name from the primary domain's directory entry, or\n`None` when unresolved."- ),- teamId: zod- .uuid()- .describe('The id of the team that owns this company record.'),- updatedAt: zod.iso- .datetime({})- .describe('When the company was last updated.'),- viewedAt: zod.iso- .datetime({})- .nullish()+ 'AI-generated summary of the call. Only set on archived\n`call_records` once summarization has run; active calls always\nreturn `None`.'+ ),+ }).describe(- 'When the requesting user last viewed this company, or `None` if\nnever viewed. Mirrors the `viewed_at` other soup entities carry.'+ 'A call record as displayed in Soup. Excludes room_name, egress_id,\nand transcript — fields that are irrelevant for the soup feed.'),+ tag: zod.enum(['call']),})- .describe(- 'A CRM company as displayed in Soup. Carries the core company\nfields plus display metadata resolved from `crm_domain_directory`\nagainst the primary (earliest-created) domain.'- ),- tag: zod.enum(['crmCompany']),- }),- zod.object({- data: zod+ .describe('Call record item.'),+ zod.object({- createdAt: zod.iso- .datetime({})- .describe('Timestamp when the record was created.'),- foreignEntityId: zod- .string()- .describe('Identifier assigned by the external system.'),- foreignEntitySource: zod- .string()- .describe('Source system that owns the external identifier.'),- id: zod- .uuid()- .describe(- 'Internal primary key for this foreign entity record.'- ),- metadata: zod- .object({})- .describe('Arbitrary metadata stored with the mapping.'),- storedForAuthEntity: zod- .string()- .describe(- 'Internal auth entity namespace this foreign entity is stored for.'- ),- storedForId: zod- .string()+ data: zod+ .object({+ createdAt: zod.iso+ .datetime({})+ .describe('When the company was created.'),+ description: zod+ .string()+ .nullish()+ .describe(+ "Display description from the primary domain's directory entry."+ ),+ domains: zod+ .array(+ zod+ .object({+ companyId: zod+ .uuid()+ .describe(+ 'The id of the company the domain belongs to.'+ ),+ createdAt: zod.iso+ .datetime({})+ .describe('When the domain record was created.'),+ domain: zod+ .string()+ .describe(+ 'The domain (lowercased, e.g. \"acme.com\").'+ ),+ id: zod+ .uuid()+ .describe('The id of the domain record.'),+ })+ .describe(+ "A CRM domain as displayed in Soup. Mirrors the crm crate's\n[`CrmDomain`] with a stable wire shape that the FE can rely on."+ )+ )+ .describe(+ 'Domains associated with this company, ordered by creation time\nascending (primary first).'+ ),+ emailSync: zod+ .boolean()+ .describe(+ 'Whether email sync is enabled for this company.'+ ),+ hidden: zod+ .boolean()+ .describe(+ 'Whether the company is hidden from CRM listings. Soup filters\nthese out by default.'+ ),+ id: zod.uuid().describe('The id of the company.'),+ name: zod+ .string()+ .nullish()+ .describe(+ "Display name from the primary domain's directory entry, or\n`None` when unresolved."+ ),+ teamId: zod+ .uuid()+ .describe(+ 'The id of the team that owns this company record.'+ ),+ updatedAt: zod.iso+ .datetime({})+ .describe('When the company was last updated.'),+ viewedAt: zod.iso+ .datetime({})+ .nullish()+ .describe(+ 'When the requesting user last viewed this company, or `None` if\nnever viewed. Mirrors the `viewed_at` other soup entities carry.'+ ),+ }).describe(- 'Internal entity identifier this foreign entity is stored for.'+ 'A CRM company as displayed in Soup. Carries the core company\nfields plus display metadata resolved from `crm_domain_directory`\nagainst the primary (earliest-created) domain.'),- updatedAt: zod.iso- .datetime({})- .describe('Timestamp when the record was last updated.'),+ tag: zod.enum(['crmCompany']),})- .describe('A foreign entity record as displayed in Soup.'),- tag: zod.enum(['foreignEntity']),- }),- ])- .and(- zod.object({- frecency_score: zod.number(),- })- )- ),- next_cursor: zod.string().nullish(),-});+ .describe('CRM company item.'),+ zod+ .object({+ data: zod+ .object({+ createdAt: zod.iso+ .datetime({})+ .describe('Timestamp when the record was created.'),+ foreignEntityId: zod+ .string()+ .describe('Identifier assigned by the external system.'),+ foreignEntitySource: zod+ .string()+ .describe(+ 'Source system that owns the external identifier.'+ ),+ id: zod+ .uuid()+ .describe(+ 'Internal primary key for this foreign entity record.'+ ),+ metadata: zod+ .object({})+ .describe('Arbitrary metadata stored with the mapping.'),+ storedForAuthEntity: zod+ .string()+ .describe(+ 'Internal auth entity namespace this foreign entity is stored for.'+ ),+ storedForId: zod+ .string()+ .describe(+ 'Internal entity identifier this foreign entity is stored for.'+ ),+ updatedAt: zod.iso+ .datetime({})+ .describe('Timestamp when the record was last updated.'),+ })+ .describe('A foreign entity record as displayed in Soup.'),+ tag: zod.enum(['foreignEntity']),+ })+ .describe('Foreign entity item.'),+ ])+ .describe('A single item in the Soup feed.')+ .and(+ zod.object({+ frecency_score: zod.number(),+ })+ )+ .describe('API representation of a soup item with its frecency score.')+ ),+ next_cursor: zod.string().nullish(),+ })+ .describe('Response page for non-grouped soup endpoints.');/*** @summary Gets the items the user has access to@@ -7676,211 +7967,66 @@ export const postItemsSoupBody = zod.object({call_filters: zod.object({- attended: zod- .boolean()- .nullish()- .describe(- 'Legacy filter by whether the requesting user attended the call.\nPrefer [`CallFilters::status`] for new callers.\n`None` = no filter, `Some(true)` = only calls the user joined,\n`Some(false)` = only calls the user did not join.'- ),- call_ids: zod- .array(zod.string())- .optional()- .describe(- 'Call record IDs to filter by. Empty to include all calls.'- ),- channel_ids: zod- .array(zod.string())- .optional()- .describe(- 'Channel IDs to filter calls by. Empty to include all calls.'- ),- speaker_ids: zod- .array(zod.string())- .optional()- .describe('Speaker macro user ids. Empty to include all.'),- status: zod- .union([- zod.null(),- zod- .enum(['ATTENDED', 'MISSED', 'UNATTENDED'])- .describe(- 'Viewer-relative attendance status for a call record.\nSerializes as `ATTENDED`, `MISSED`, or `UNATTENDED`.'- ),- ])- .optional(),- })- .optional()- .describe('Filters for call records.'),- channel_filters: zod- .object({- channel_ids: zod- .array(zod.string())- .optional()- .describe(- "Channel IDs to search within. Examples: ['general']. Empty to search all accessible channels."- ),- channel_types: zod- .array(zod.string())- .optional()- .describe(- "Channel types to filter by. Examples: ['public'], ['direct_message', 'private']. Empty to search all channel types."- ),- importance: zod- .boolean()- .nullish()- .describe(- 'Filter by channel importance. None to ignore, true to pass through (no clause), false to short-circuit and return nothing.'- ),- mentions: zod- .array(zod.string())- .optional()- .describe(- "Channel user mentions to search for. Examples: ['@username']. Empty if not filtering by mentions."- ),- notification_filters: zod- .object({- done: zod- .boolean()- .nullish()- .describe(- 'Filter by notification done state. `Some(true)` selects done\nnotifications; `Some(false)` selects not-done notifications.'- ),- seen: zod- .boolean()- .nullish()- .describe(- 'Filter by notification seen state. `Some(true)` selects seen\nnotifications; `Some(false)` selects not-seen notifications.'- ),- })- .optional()- .describe('Notification state filters for channel message queries.'),- org_id: zod- .number()- .nullish()- .describe(- 'Channel organization ID to search within. Empty to ignore organization filtering.'- ),- sender_ids: zod- .array(zod.string())- .optional()- .describe(- "Sender IDs to search within. Examples: ['user1']. Empty to search all accessible senders."- ),- team_id: zod- .string()- .nullish()- .describe(- 'Channel team ID to search within. Empty to ignore team filtering.'- ),- thread_ids: zod- .array(zod.string())- .optional()- .describe(- "Channel thread IDs to search within. Examples: ['thread123']. Empty to search all threads."- ),- })- .optional()- .describe(- 'The channel message filters used to filter down what channel messages you search over.'- ),- chat_filters: zod- .object({- chat_ids: zod- .array(zod.string())- .optional()- .describe(- "Chat ids to search over. Examples: ['chat1'], ['chat1', 'chat2']. When provided, chat search will only match results on these chats. Empty to search all accessible chats."- ),- importance: zod- .boolean()- .nullish()- .describe(- 'Filter by chat importance. None to ignore, true to pass through (no clause), false to short-circuit and return nothing.'- ),- notification_filters: zod- .object({- done: zod- .boolean()- .nullish()- .describe(- 'Filter by notification done state. `Some(true)` selects done\nnotifications; `Some(false)` selects not-done notifications.'- ),- seen: zod- .boolean()- .nullish()- .describe(- 'Filter by notification seen state. `Some(true)` selects seen\nnotifications; `Some(false)` selects not-seen notifications.'- ),- })- .optional()- .describe('Notification state filters for channel message queries.'),- owners: zod- .array(zod.string())- .optional()+ attended: zod+ .boolean()+ .nullish().describe(- "Filter by chat owner. Examples: ['macro|[email protected]'], ['macro|[email protected]', 'macro|[email protected]']. Empty to search all owners."+ 'Legacy filter by whether the requesting user attended the call.\nPrefer [`CallFilters::status`] for new callers.\n`None` = no filter, `Some(true)` = only calls the user joined,\n`Some(false)` = only calls the user did not join.'),- project_ids: zod+ call_ids: zod.array(zod.string()).optional().describe(- "A list of project ids to search within. Examples: ['project1']. Empty to ignore project filtering."+ 'Call record IDs to filter by. Empty to include all calls.'),- role: zod+ channel_ids: zod.array(zod.string()).optional().describe(- "Chat message roles to search. Examples: ['user'], ['assistant']. Empty to search all roles."+ 'Channel IDs to filter calls by. Empty to include all calls.'),- })- .optional()- .describe(- 'The chat filters used to filter down what chats you search over.'- ),- crm_company_filters: zod- .object({- company_ids: zod+ speaker_ids: zod.array(zod.string()).optional()- .describe(- "CRM company ids to filter by. Examples: ['11111111-...']. Empty to\ninclude all of the team's visible CRM companies."- ),- hidden: zod- .boolean()- .nullish()- .describe(- "Optional `crm_companies.hidden` filter. `None` = visible only\n(default for back-compat with non-admin callers). `Some(false)` =\nvisible only (explicit). `Some(true)` = hidden only — requires\nadmin\/owner team role; enforced upstream in soup's axum router."- ),+ .describe('Speaker macro user ids. Empty to include all.'),+ status: zod+ .union([+ zod.null(),+ zod+ .enum(['ATTENDED', 'MISSED', 'UNATTENDED'])+ .describe(+ 'Viewer-relative attendance status for a call record.\nSerializes as `ATTENDED`, `MISSED`, or `UNATTENDED`.'+ ),+ ])+ .optional(),}).optional()- .describe(- 'The crm company filters used to narrow which CRM companies appear in soup.'- ),- document_filters: zod+ .describe('Filters for call records.'),+ channel_filters: zod.object({- document_ids: zod+ channel_ids: zod.array(zod.string()).optional().describe(- "Document ids to search over. Examples: ['doc1'], ['doc1', 'doc2']. Empty to search all accessible documents."+ "Channel IDs to search within. Examples: ['general']. Empty to search all accessible channels."),- file_types: zod+ channel_types: zod.array(zod.string()).optional().describe(- "Document file types to search. Examples: ['pdf'], ['md', 'txt']. Empty to search all file types."+ "Channel types to filter by. Examples: ['public'], ['direct_message', 'private']. Empty to search all channel types."),importance: zod.boolean().nullish().describe(- 'Filter by document importance. None to ignore, true to pass through (no clause), false to short-circuit and return nothing.'+ 'Filter by channel importance. None to ignore, true to pass through (no clause), false to short-circuit and return nothing.'),- is_email_attachment: zod- .boolean()- .nullish()+ mentions: zod+ .array(zod.string())+ .optional().describe(- 'Filter by email attachment status. true = only email attachments, false = only non-email attachments, None = both.'+ "Channel user mentions to search for. Examples: ['@username']. Empty if not filtering by mentions."),notification_filters: zod.object({@@ -7899,101 +8045,48 @@ export const postItemsSoupBody = zod}).optional().describe('Notification state filters for channel message queries.'),- owners: zod- .array(zod.string())- .optional()+ org_id: zod+ .number()+ .nullish().describe(- "Filter by document owner. Examples: ['macro|[email protected]'], ['macro|[email protected]', 'macro|[email protected]']. Empty to search all owners."+ 'Channel organization ID to search within. Empty to ignore organization filtering.'),- project_ids: zod+ sender_ids: zod.array(zod.string()).optional().describe(- "A list of project ids to search within. Examples: ['project1'].\nfiltering. Empty to ignore project filtering."+ "Sender IDs to search within. Examples: ['user1']. Empty to search all accessible senders."),- sub_types: zod+ team_id: zod+ .string()+ .nullish()+ .describe(+ 'Channel team ID to search within. Empty to ignore team filtering.'+ ),+ thread_ids: zod.array(zod.string()).optional().describe(- "Filter by document sub type. Examples: ['task']. Empty to search all sub types."+ "Channel thread IDs to search within. Examples: ['thread123']. Empty to search all threads."),- task_filters: zod- .object({- include_cbm_atm_nc: zod- .boolean()- .nullish()- .describe(- 'Include tasks that are created by me, assigned to me, and not completed,\neven when they do not match other document filters.'- ),- })- .optional()- .describe('Task-only filters nested under document filters.'),}).optional().describe(- 'The document filters used to filter down what documents you search over.'+ 'The channel message filters used to filter down what channel messages you search over.'),- email_filters: zod+ chat_filters: zod.object({- bcc: zod- .array(zod.string())- .optional()- .describe(- "Email BCC addresses to filter by. Examples: ['[email protected]']. Empty if not filtering by BCC."- ),- calendar_only: zod- .boolean()- .nullish()- .describe(- 'When `Some(true)`, only include threads that have at least one message\nwith an iCalendar attachment (`.ics` filename or `application\/ics` mime\ntype). `Some(false)` and `None` apply no constraint.'- ),- cc: zod- .array(zod.string())- .optional()- .describe(- "Email CC addresses to filter by. Examples: ['[email protected]']. Empty if not filtering by CC."- ),- crm_addresses: zod- .array(zod.string())- .optional()- .describe(- "CRM-scoped address filter. When non-empty, expands visibility to every\nteammate's mailbox and restricts to threads involving any of these\nfully-qualified addresses. Each address is authorized against\n`crm_contacts` + `crm_companies` (contact must not be hidden, company\nmust not be hidden, `email_sync` must be true).\nMutually exclusive with `crm_domains`."- ),- crm_domains: zod- .array(zod.string())- .optional()- .describe(- "CRM-scoped domain filter. When non-empty, expands visibility to every\nteammate's mailbox and restricts to threads involving any of these\ndomains (in any of sender\/cc\/bcc\/recipient). Each domain is authorized\nagainst `crm_domains` + `crm_companies` (must exist for the caller's\nteam, company must not be hidden, `email_sync` must be true).\nMutually exclusive with `crm_addresses`."- ),- email_thread_ids: zod- .array(zod.string())- .optional()- .describe(- "Email thread IDs to filter by. Examples: ['thread-uuid-1']. Empty to search all threads."- ),- exclude_labels: zod+ chat_ids: zod.array(zod.string()).optional().describe(- 'Exclude emails that have any of these labels. Supports both Gmail system labels (e.g. \"CATEGORY_PROMOTIONS\") and user-created labels. Empty to not exclude any labels.\nNote: SPAM and TRASH emails are not indexed in OpenSearch, so they are already excluded by default.'+ "Chat ids to search over. Examples: ['chat1'], ['chat1', 'chat2']. When provided, chat search will only match results on these chats. Empty to search all accessible chats."),importance: zod.boolean().nullish().describe(- 'Filter by email importance. None to not filter. True to show only important emails\n(drafts, personal, sent, or uncategorized). False to show only unimportant emails\n(those categorized as promotions, social, updates, or forums).'- ),- include_labels: zod- .array(zod.string())- .optional()- .describe(- 'Only include emails that have at least one of these labels. Supports both Gmail system labels (e.g. \"INBOX\", \"CATEGORY_PROMOTIONS\") and user-created labels (e.g. \"github\"). Empty to not filter by included labels.\nNote: SPAM and TRASH emails are not indexed in OpenSearch, so they will never appear in results regardless of this filter.'- ),- link_ids: zod- .array(zod.string())- .optional()- .describe(- 'Restrict to specific inboxes by email_links.id. Empty means \"any inbox the\ncaller can access\" (soup expands to the full set at the router edge).'+ 'Filter by chat importance. None to ignore, true to pass through (no clause), false to short-circuit and return nothing.'),notification_filters: zod.object({@@ -8012,2831 +8105,3618 @@ export const postItemsSoupBody = zod}).optional().describe('Notification state filters for channel message queries.'),- project_ids: zod+ owners: zod.array(zod.string()).optional().describe(- 'A list of project ids to search within. Empty to ignore project filtering.'+ "Filter by chat owner. Examples: ['macro|[email protected]'], ['macro|[email protected]', 'macro|[email protected]']. Empty to search all owners."),- recipients: zod+ project_ids: zod.array(zod.string()).optional().describe(- "Email Recipient addresses to filter by. Examples: ['[email protected]']. Empty if not filtering by Recipient."+ "A list of project ids to search within. Examples: ['project1']. Empty to ignore project filtering."),- senders: zod+ role: zod.array(zod.string()).optional().describe(- "Email sender addresses to filter by. Examples: ['[email protected]']. Empty to search all senders."- ),- shared: zod- .enum(['exclude', 'include', 'only'])- .optional()- .describe(- 'Controls whether shared email threads are included in results.'+ "Chat message roles to search. Examples: ['user'], ['assistant']. Empty to search all roles."),}).optional().describe(- 'The email filters used to filter down what emails you search over.'+ 'The chat filters used to filter down what chats you search over.'),- foreign_entity_filters: zod- .object({- foreign_entity_ids: zod- .array(zod.string())- .optional()- .describe(- 'External entity identifiers to filter by. Empty to include all external IDs.'- ),- foreign_entity_sources: zod- .array(zod.string())- .optional()- .describe(- 'External source names to filter by. Empty to include all sources.'- ),- ids: zod- .array(zod.string())- .optional()- .describe(- 'Internal foreign entity record IDs to filter by. Empty to include all records.'- ),- includes_me: zod- .boolean()- .optional()- .describe(- 'When true, only return foreign entities whose metadata lists the requesting user as a\nparticipant (GitHub `involves:me` semantics for `github_pull_request` records). False or\nabsent applies no filter. Serialized in filter ASTs as the `\"me\"` literal.'- ),- notification_filters: zod- .object({- done: zod- .boolean()- .nullish()- .describe(- 'Filter by notification done state. `Some(true)` selects done\nnotifications; `Some(false)` selects not-done notifications.'- ),- seen: zod- .boolean()- .nullish()- .describe(- 'Filter by notification seen state. `Some(true)` selects seen\nnotifications; `Some(false)` selects not-seen notifications.'- ),- })- .optional()- .describe('Notification state filters for channel message queries.'),- })- .optional()- .describe('Filters for foreign entity records.'),- project_filters: zod- .object({- importance: zod- .boolean()- .nullish()- .describe(- 'Filter by project importance. None to ignore, true to pass through (no clause), false to short-circuit and return nothing.'- ),- include_root: zod- .boolean()- .optional()- .describe(- 'When true, `project_ids` also matches the projects themselves in addition to their children.'- ),- notification_filters: zod- .object({- done: zod- .boolean()- .nullish()- .describe(- 'Filter by notification done state. `Some(true)` selects done\nnotifications; `Some(false)` selects not-done notifications.'- ),- seen: zod- .boolean()- .nullish()- .describe(- 'Filter by notification seen state. `Some(true)` selects seen\nnotifications; `Some(false)` selects not-seen notifications.'- ),- })- .optional()- .describe('Notification state filters for channel message queries.'),- owners: zod+ crm_company_filters: zod+ .object({+ company_ids: zod.array(zod.string()).optional().describe(- "Filter by project owner. Examples: ['macro|[email protected]'], ['macro|[email protected]', 'macro|[email protected]']. Empty to search all owners."+ "CRM company ids to filter by. Examples: ['11111111-...']. Empty to\ninclude all of the team's visible CRM companies."),- project_ids: zod- .array(zod.string())- .optional()+ hidden: zod+ .boolean()+ .nullish().describe(- "Project IDs to search within. Examples: ['project1']. Empty to search all accessible projects.\nBy default matches children of these projects; set `include_root` to also match the projects themselves."+ "Optional `crm_companies.hidden` filter. `None` = visible only\n(default for back-compat with non-admin callers). `Some(false)` =\nvisible only (explicit). `Some(true)` = hidden only — requires\nadmin\/owner team role; enforced upstream in soup's axum router."),}).optional()- .describe(- 'The project filters used to filter down what projects you search over.'- ),- property_filters: zod- .array(- zod- .object({- entity_ids: zod- .array(zod.string())- .optional()- .describe(- "Entity reference IDs to match. Multiple values are OR'd together."- ),- entity_type: zod- .string()- .nullish()- .describe(- 'The entity type for the property lookup (e.g., \"TASK\", \"DOCUMENT\", \"PROJECT\").\nWhen None, matches across all entity types.'- ),- option_ids: zod- .array(zod.string())- .optional()- .describe(- "Select option UUIDs to match. Multiple values are OR'd together."- ),- property_definition_id: zod- .string()- .describe('The UUID of the property definition to filter on.'),- })- .describe(- "A single property-based filter condition.\n\nEach filter targets a specific property definition on entities of a given type,\nmatching against select option UUIDs or entity reference IDs.\nMultiple values within a single filter are OR'd together.\nMultiple filters are AND'd together."- )- )- .optional()- .describe('property-based filters applied across entity types'),- })- .describe('a bundle of all of the filters for each entity type')- .and(- zod.object({- expand: zod- .boolean()- .nullish()- .describe('Whether to expand projects. Defaults to true.'),- limit: zod- .number()- .min(postItemsSoupBodyLimitMin)- .nullish()- .describe(- 'Limit the number of items returned. Defaults to 20. Max 500.'- ),- sort_method: zod- .union([- zod.null(),- zod.enum([- 'viewed_at',- 'created_at',- 'updated_at',- 'viewed_updated',- 'frecency',- ]),- ])- .optional(),- })- )- .and(- zod.object({- emailView: zod- .string()- .optional()- .describe('the view of specific emails to display'),- })- );--export const postItemsSoupResponseItemsItemDataChannelOrgIdMin = 0;--export const postItemsSoupResponse = zod.object({- items: zod.array(- zod- .union([- zod.object({- data: zod.object({- branchedFromId: zod- .uuid()- .nullish()- .describe('The id of the document this document branched from'),- branchedFromVersionId: zod- .number()- .nullish()- .describe(- 'The id of the version this document branched from\nThis could be either DocumentInstance or DocumentBom id depending on the file type'- ),- createdAt: zod.iso- .datetime({})- .describe('The time the document was created'),- deletedAt: zod.iso- .datetime({})- .nullish()- .describe('The time the document was deleted'),- documentFamilyId: zod- .number()- .nullish()- .describe(- 'The id of the document family this document belongs to'- ),- documentVersionId: zod- .number()- .describe(- 'The version of the document\nThis could be the document_instance_id or document_bom_id depending on the file type'- ),- fileType: zod- .string()- .nullish()- .describe('The file type of the document (e.g. pdf, docx)'),- id: zod.uuid().describe('The document id'),- name: zod.string().describe('The name of the document'),- ownerId: zod.string().describe('The owner of the document'),- projectId: zod- .uuid()- .nullish()- .describe('The id of the project that this document belongs to'),- properties: zod- .array(- zod- .object({- definition: zod- .object({- created_at: zod.iso.datetime({}),- data_type: zod- .enum([- 'BOOLEAN',- 'DATE',- 'NUMBER',- 'STRING',- 'SELECT_NUMBER',- 'SELECT_STRING',- 'ENTITY',- 'LINK',- ])- .describe(- 'Data type for property values, determining storage and validation.'- ),- display_name: zod.string(),- id: zod.uuid(),- is_metadata: zod- .boolean()- .describe(- 'Flag to indicate if this is a system-generated metadata property.\nNot stored in database - computed at service layer.'- ),- is_multi_select: zod.boolean(),- is_system: zod- .boolean()- .describe(- 'Flag to indicate if this is a system property (stored in DB).'- ),- owner: zod- .union([- zod- .object({- scope: zod.enum(['user']),- user_id: zod.string(),- })- .describe('User-scoped property only'),- zod- .object({- organization_id: zod.number(),- scope: zod.enum(['organization']),- })- .describe('Organization-scoped property only'),- zod- .object({- organization_id: zod.number(),- scope: zod.enum(['user_and_organization']),- user_id: zod.string(),- })- .describe('Both user and organization-scoped'),- zod- .object({- scope: zod.enum(['system']),- })- .describe(- 'System-owned property (no user or org owner)'- ),- ])- .describe(- 'Defines who owns a property - user-scoped, org-scoped, system, or both user and org.'- ),- specific_entity_type: zod- .union([- zod.null(),- zod- .enum([- 'CHANNEL',- 'CHAT',- 'COMPANY',- 'DOCUMENT',- 'PROJECT',- 'TASK',- 'THREAD',- 'USER',- ])- .describe(- 'Type of entity that can be referenced by entity properties.'- ),- ])- .optional(),- updated_at: zod.iso.datetime({}),- })- .describe(- 'Property definition model (service representation).'- ),- value: zod- .union([- zod.null(),- zod- .union([- zod- .object({- type: zod.enum(['Boolean']),- value: zod- .boolean()- .describe(- 'Boolean value\nSerializes as: {\"type\": \"Boolean\", \"value\": true}'- ),- })- .describe(- 'Boolean value\nSerializes as: {\"type\": \"Boolean\", \"value\": true}'- ),- zod- .object({- type: zod.enum(['Number']),- value: zod- .number()- .describe(- 'Numeric value\nSerializes as: {\"type\": \"Number\", \"value\": 42.5}'- ),- })- .describe(- 'Numeric value\nSerializes as: {\"type\": \"Number\", \"value\": 42.5}'- ),- zod- .object({- type: zod.enum(['String']),- value: zod- .string()- .describe(- 'String value\nSerializes as: {\"type\": \"String\", \"value\": \"text\"}'- ),- })- .describe(- 'String value\nSerializes as: {\"type\": \"String\", \"value\": \"text\"}'- ),- zod- .object({- type: zod.enum(['Date']),- value: zod.iso- .datetime({})- .describe(- 'Date\/timestamp value\nSerializes as: {\"type\": \"Date\", \"value\": \"2025-01-01T00:00:00Z\"}'- ),- })- .describe(- 'Date\/timestamp value\nSerializes as: {\"type\": \"Date\", \"value\": \"2025-01-01T00:00:00Z\"}'- ),- zod- .object({- type: zod.enum(['SelectOption']),- value: zod- .array(zod.uuid())- .describe(- 'Select option(s) - always an array (check is_multi_select to determine if single or multi)\nSingle-select: {\"type\": \"SelectOption\", \"value\": [\"uuid\"]} (length 0 or 1)\nMulti-select: {\"type\": \"SelectOption\", \"value\": [\"uuid1\", \"uuid2\", ...]} (length 0+)'- ),- })- .describe(- 'Select option(s) - always an array (check is_multi_select to determine if single or multi)\nSingle-select: {\"type\": \"SelectOption\", \"value\": [\"uuid\"]} (length 0 or 1)\nMulti-select: {\"type\": \"SelectOption\", \"value\": [\"uuid1\", \"uuid2\", ...]} (length 0+)'- ),- zod- .object({- type: zod.enum(['EntityReference']),- value: zod- .array(- zod- .object({- entity_id: zod.string(),- entity_type: zod- .enum([- 'CHANNEL',- 'CHAT',- 'COMPANY',- 'DOCUMENT',- 'PROJECT',- 'TASK',- 'THREAD',- 'USER',- ])- .describe(- 'Type of entity that can be referenced by entity properties.'- ),- specific_message_id: zod- .uuid()- .nullish()- .describe(- 'For CHANNEL, CHAT, THREAD entity types - optional specific message ID.\nThis allows referencing a specific message within a thread\/channel\/chat.'- ),- })- .describe(- 'Entity reference for entity-type property values.'- )- )- .describe(- 'Entity reference(s) - always an array (check is_multi_select to determine if single or multi)\nSingle-select: {\"type\": \"EntityReference\", \"value\": [{...}]} (length 0 or 1)\nMulti-select: {\"type\": \"EntityReference\", \"value\": [{...}, {...}, ...]} (length 0+)'- ),- })- .describe(- 'Entity reference(s) - always an array (check is_multi_select to determine if single or multi)\nSingle-select: {\"type\": \"EntityReference\", \"value\": [{...}]} (length 0 or 1)\nMulti-select: {\"type\": \"EntityReference\", \"value\": [{...}, {...}, ...]} (length 0+)'- ),- zod- .object({- type: zod.enum(['Link']),- value: zod- .array(zod.string())- .describe(- 'Link value(s) - always an array (check is_multi_select to determine if single or multi)\nSingle-select: {\"type\": \"Link\", \"value\": [\"https:\/\/example.com\"]} (length 0 or 1)\nMulti-select: {\"type\": \"Link\", \"value\": [\"https:\/\/example.com\", \"https:\/\/other.com\"]} (length 0+)'- ),- })- .describe(- 'Link value(s) - always an array (check is_multi_select to determine if single or multi)\nSingle-select: {\"type\": \"Link\", \"value\": [\"https:\/\/example.com\"]} (length 0 or 1)\nMulti-select: {\"type\": \"Link\", \"value\": [\"https:\/\/example.com\", \"https:\/\/other.com\"]} (length 0+)'- ),- ])- .describe(- 'Property value (service representation).\n\nRepresents the actual value stored for an entity property.\nThis is serialized to\/from JSONB in the database.'- ),- ])- .optional(),- })- .describe(- 'A property attached to a Soup item.\n\nThis is a simplified representation that includes only the definition and value,\nomitting the entity property assignment metadata and options.'- )- )- .describe('Properties'),- sha: zod- .string()+ .describe(+ 'The crm company filters used to narrow which CRM companies appear in soup.'+ ),+ document_filters: zod+ .object({+ document_ids: zod+ .array(zod.string())+ .optional()+ .describe(+ "Document ids to search over. Examples: ['doc1'], ['doc1', 'doc2']. Empty to search all accessible documents."+ ),+ file_types: zod+ .array(zod.string())+ .optional()+ .describe(+ "Document file types to search. Examples: ['pdf'], ['md', 'txt']. Empty to search all file types."+ ),+ importance: zod+ .boolean()+ .nullish()+ .describe(+ 'Filter by document importance. None to ignore, true to pass through (no clause), false to short-circuit and return nothing.'+ ),+ is_email_attachment: zod+ .boolean()+ .nullish()+ .describe(+ 'Filter by email attachment status. true = only email attachments, false = only non-email attachments, None = both.'+ ),+ notification_filters: zod+ .object({+ done: zod+ .boolean().nullish().describe(- 'If the document is a PDF, this is the SHA of the pdf\nIf the document is a DOCX, this will not be present'+ 'Filter by notification done state. `Some(true)` selects done\nnotifications; `Some(false)` selects not-done notifications.'),- subType: zod- .union([- zod.null(),- zod- .union([- zod- .object({- is_completed: zod- .boolean()- .describe(- 'Whether the task is completed.\nTrue if the Status property is set to \"Completed\".'- ),- type: zod.enum(['task']),- })- .describe(- 'A task document with its associated properties'- ),- zod- .object({- type: zod.enum(['snippet']),- })- .describe('A snippet document — reusable markdown'),- ])- .describe(- 'Sub type of a document with associated properties encoded in each variant.\nThis ensures type-safety: task properties only exist when the document is a task.'- ),- ])- .optional(),- updatedAt: zod.iso- .datetime({})+ seen: zod+ .boolean()+ .nullish().describe(- 'The time the document instance \/ document BOM was updated'+ 'Filter by notification seen state. `Some(true)` selects seen\nnotifications; `Some(false)` selects not-seen notifications.'),- viewedAt: zod.iso- .datetime({})- .nullish()- .describe('The time the document was last viewed'),- }),- tag: zod.enum(['document']),- }),- zod.object({- data: zod.object({- createdAt: zod.iso- .datetime({})- .describe('The time the chat was created'),- deletedAt: zod.iso- .datetime({})- .nullish()- .describe('The time the chat was deleted'),- id: zod.uuid().describe('The chat uuid'),- isPersistent: zod+ })+ .optional()+ .describe('Notification state filters for channel message queries.'),+ owners: zod+ .array(zod.string())+ .optional()+ .describe(+ "Filter by document owner. Examples: ['macro|[email protected]'], ['macro|[email protected]', 'macro|[email protected]']. Empty to search all owners."+ ),+ project_ids: zod+ .array(zod.string())+ .optional()+ .describe(+ "A list of project ids to search within. Examples: ['project1'].\nfiltering. Empty to ignore project filtering."+ ),+ sub_types: zod+ .array(zod.string())+ .optional()+ .describe(+ "Filter by document sub type. Examples: ['task']. Empty to search all sub types."+ ),+ task_filters: zod+ .object({+ include_cbm_atm_nc: zod.boolean()- .describe('Whether the chat is persistent or not'),- name: zod.string().describe('The name of the chat'),- ownerId: zod.string().describe('Who the chat belongs to'),- projectId: zod- .uuid().nullish()- .describe('The project id of the chat'),- properties: zod- .array(- zod- .object({- definition: zod- .object({- created_at: zod.iso.datetime({}),- data_type: zod- .enum([- 'BOOLEAN',- 'DATE',- 'NUMBER',- 'STRING',- 'SELECT_NUMBER',- 'SELECT_STRING',- 'ENTITY',- 'LINK',- ])- .describe(- 'Data type for property values, determining storage and validation.'- ),- display_name: zod.string(),- id: zod.uuid(),- is_metadata: zod- .boolean()- .describe(- 'Flag to indicate if this is a system-generated metadata property.\nNot stored in database - computed at service layer.'- ),- is_multi_select: zod.boolean(),- is_system: zod- .boolean()- .describe(- 'Flag to indicate if this is a system property (stored in DB).'- ),- owner: zod- .union([- zod- .object({- scope: zod.enum(['user']),- user_id: zod.string(),- })- .describe('User-scoped property only'),- zod- .object({- organization_id: zod.number(),- scope: zod.enum(['organization']),- })- .describe('Organization-scoped property only'),- zod- .object({- organization_id: zod.number(),- scope: zod.enum(['user_and_organization']),- user_id: zod.string(),- })- .describe('Both user and organization-scoped'),- zod- .object({- scope: zod.enum(['system']),- })- .describe(- 'System-owned property (no user or org owner)'- ),- ])- .describe(- 'Defines who owns a property - user-scoped, org-scoped, system, or both user and org.'- ),- specific_entity_type: zod- .union([- zod.null(),- zod- .enum([- 'CHANNEL',- 'CHAT',- 'COMPANY',- 'DOCUMENT',- 'PROJECT',- 'TASK',- 'THREAD',- 'USER',- ])- .describe(- 'Type of entity that can be referenced by entity properties.'- ),- ])- .optional(),- updated_at: zod.iso.datetime({}),- })- .describe(- 'Property definition model (service representation).'- ),- value: zod- .union([- zod.null(),- zod- .union([- zod- .object({- type: zod.enum(['Boolean']),- value: zod- .boolean()- .describe(- 'Boolean value\nSerializes as: {\"type\": \"Boolean\", \"value\": true}'- ),- })- .describe(- 'Boolean value\nSerializes as: {\"type\": \"Boolean\", \"value\": true}'- ),- zod- .object({- type: zod.enum(['Number']),- value: zod- .number()- .describe(- 'Numeric value\nSerializes as: {\"type\": \"Number\", \"value\": 42.5}'- ),- })- .describe(- 'Numeric value\nSerializes as: {\"type\": \"Number\", \"value\": 42.5}'- ),- zod- .object({- type: zod.enum(['String']),- value: zod- .string()- .describe(- 'String value\nSerializes as: {\"type\": \"String\", \"value\": \"text\"}'- ),- })- .describe(- 'String value\nSerializes as: {\"type\": \"String\", \"value\": \"text\"}'- ),- zod- .object({- type: zod.enum(['Date']),- value: zod.iso- .datetime({})- .describe(- 'Date\/timestamp value\nSerializes as: {\"type\": \"Date\", \"value\": \"2025-01-01T00:00:00Z\"}'- ),- })- .describe(- 'Date\/timestamp value\nSerializes as: {\"type\": \"Date\", \"value\": \"2025-01-01T00:00:00Z\"}'- ),- zod- .object({- type: zod.enum(['SelectOption']),- value: zod- .array(zod.uuid())- .describe(- 'Select option(s) - always an array (check is_multi_select to determine if single or multi)\nSingle-select: {\"type\": \"SelectOption\", \"value\": [\"uuid\"]} (length 0 or 1)\nMulti-select: {\"type\": \"SelectOption\", \"value\": [\"uuid1\", \"uuid2\", ...]} (length 0+)'- ),- })- .describe(- 'Select option(s) - always an array (check is_multi_select to determine if single or multi)\nSingle-select: {\"type\": \"SelectOption\", \"value\": [\"uuid\"]} (length 0 or 1)\nMulti-select: {\"type\": \"SelectOption\", \"value\": [\"uuid1\", \"uuid2\", ...]} (length 0+)'- ),- zod- .object({- type: zod.enum(['EntityReference']),- value: zod- .array(- zod- .object({- entity_id: zod.string(),- entity_type: zod- .enum([- 'CHANNEL',- 'CHAT',- 'COMPANY',- 'DOCUMENT',- 'PROJECT',- 'TASK',- 'THREAD',- 'USER',- ])- .describe(- 'Type of entity that can be referenced by entity properties.'- ),- specific_message_id: zod- .uuid()- .nullish()- .describe(- 'For CHANNEL, CHAT, THREAD entity types - optional specific message ID.\nThis allows referencing a specific message within a thread\/channel\/chat.'- ),- })- .describe(- 'Entity reference for entity-type property values.'- )- )- .describe(- 'Entity reference(s) - always an array (check is_multi_select to determine if single or multi)\nSingle-select: {\"type\": \"EntityReference\", \"value\": [{...}]} (length 0 or 1)\nMulti-select: {\"type\": \"EntityReference\", \"value\": [{...}, {...}, ...]} (length 0+)'- ),- })- .describe(- 'Entity reference(s) - always an array (check is_multi_select to determine if single or multi)\nSingle-select: {\"type\": \"EntityReference\", \"value\": [{...}]} (length 0 or 1)\nMulti-select: {\"type\": \"EntityReference\", \"value\": [{...}, {...}, ...]} (length 0+)'- ),- zod- .object({- type: zod.enum(['Link']),- value: zod- .array(zod.string())- .describe(- 'Link value(s) - always an array (check is_multi_select to determine if single or multi)\nSingle-select: {\"type\": \"Link\", \"value\": [\"https:\/\/example.com\"]} (length 0 or 1)\nMulti-select: {\"type\": \"Link\", \"value\": [\"https:\/\/example.com\", \"https:\/\/other.com\"]} (length 0+)'- ),- })- .describe(- 'Link value(s) - always an array (check is_multi_select to determine if single or multi)\nSingle-select: {\"type\": \"Link\", \"value\": [\"https:\/\/example.com\"]} (length 0 or 1)\nMulti-select: {\"type\": \"Link\", \"value\": [\"https:\/\/example.com\", \"https:\/\/other.com\"]} (length 0+)'- ),- ])- .describe(- 'Property value (service representation).\n\nRepresents the actual value stored for an entity property.\nThis is serialized to\/from JSONB in the database.'- ),- ])- .optional(),- })- .describe(- 'A property attached to a Soup item.\n\nThis is a simplified representation that includes only the definition and value,\nomitting the entity property assignment metadata and options.'- )- )- .describe('Properties'),- updatedAt: zod.iso- .datetime({})- .describe('The time the chat was last updated'),- viewedAt: zod.iso- .datetime({})+ .describe(+ 'Include tasks that are created by me, assigned to me, and not completed,\neven when they do not match other document filters.'+ ),+ })+ .optional()+ .describe('Task-only filters nested under document filters.'),+ })+ .optional()+ .describe(+ 'The document filters used to filter down what documents you search over.'+ ),+ email_filters: zod+ .object({+ bcc: zod+ .array(zod.string())+ .optional()+ .describe(+ "Email BCC addresses to filter by. Examples: ['[email protected]']. Empty if not filtering by BCC."+ ),+ calendar_only: zod+ .boolean()+ .nullish()+ .describe(+ 'When `Some(true)`, only include threads that have at least one message\nwith an iCalendar attachment (`.ics` filename or `application\/ics` mime\ntype). `Some(false)` and `None` apply no constraint.'+ ),+ cc: zod+ .array(zod.string())+ .optional()+ .describe(+ "Email CC addresses to filter by. Examples: ['[email protected]']. Empty if not filtering by CC."+ ),+ crm_addresses: zod+ .array(zod.string())+ .optional()+ .describe(+ "CRM-scoped address filter. When non-empty, expands visibility to every\nteammate's mailbox and restricts to threads involving any of these\nfully-qualified addresses. Each address is authorized against\n`crm_contacts` + `crm_companies` (contact must not be hidden, company\nmust not be hidden, `email_sync` must be true).\nMutually exclusive with `crm_domains`."+ ),+ crm_domains: zod+ .array(zod.string())+ .optional()+ .describe(+ "CRM-scoped domain filter. When non-empty, expands visibility to every\nteammate's mailbox and restricts to threads involving any of these\ndomains (in any of sender\/cc\/bcc\/recipient). Each domain is authorized\nagainst `crm_domains` + `crm_companies` (must exist for the caller's\nteam, company must not be hidden, `email_sync` must be true).\nMutually exclusive with `crm_addresses`."+ ),+ email_thread_ids: zod+ .array(zod.string())+ .optional()+ .describe(+ "Email thread IDs to filter by. Examples: ['thread-uuid-1']. Empty to search all threads."+ ),+ exclude_labels: zod+ .array(zod.string())+ .optional()+ .describe(+ 'Exclude emails that have any of these labels. Supports both Gmail system labels (e.g. \"CATEGORY_PROMOTIONS\") and user-created labels. Empty to not exclude any labels.\nNote: SPAM and TRASH emails are not indexed in OpenSearch, so they are already excluded by default.'+ ),+ importance: zod+ .boolean()+ .nullish()+ .describe(+ 'Filter by email importance. None to not filter. True to show only important emails\n(drafts, personal, sent, or uncategorized). False to show only unimportant emails\n(those categorized as promotions, social, updates, or forums).'+ ),+ include_labels: zod+ .array(zod.string())+ .optional()+ .describe(+ 'Only include emails that have at least one of these labels. Supports both Gmail system labels (e.g. \"INBOX\", \"CATEGORY_PROMOTIONS\") and user-created labels (e.g. \"github\"). Empty to not filter by included labels.\nNote: SPAM and TRASH emails are not indexed in OpenSearch, so they will never appear in results regardless of this filter.'+ ),+ link_ids: zod+ .array(zod.string())+ .optional()+ .describe(+ 'Restrict to specific inboxes by email_links.id. Empty means \"any inbox the\ncaller can access\" (soup expands to the full set at the router edge).'+ ),+ notification_filters: zod+ .object({+ done: zod+ .boolean().nullish()- .describe('The time the chat was last viewed'),- }),- tag: zod.enum(['chat']),- }),- zod.object({- data: zod.object({- createdAt: zod.iso- .datetime({})- .describe('The time the project was created'),- deletedAt: zod.iso- .datetime({})+ .describe(+ 'Filter by notification done state. `Some(true)` selects done\nnotifications; `Some(false)` selects not-done notifications.'+ ),+ seen: zod+ .boolean().nullish()- .describe('The time the project was deleted'),- id: zod.uuid().describe('The id of the project'),- name: zod.string().describe('The name of the project'),- ownerId: zod- .string()- .describe('The user id of who created the project'),- parentId: zod.uuid().nullish().describe('The parent project id'),- properties: zod- .array(- zod- .object({- definition: zod- .object({- created_at: zod.iso.datetime({}),- data_type: zod- .enum([- 'BOOLEAN',- 'DATE',- 'NUMBER',- 'STRING',- 'SELECT_NUMBER',- 'SELECT_STRING',- 'ENTITY',- 'LINK',- ])- .describe(- 'Data type for property values, determining storage and validation.'- ),- display_name: zod.string(),- id: zod.uuid(),- is_metadata: zod- .boolean()- .describe(- 'Flag to indicate if this is a system-generated metadata property.\nNot stored in database - computed at service layer.'- ),- is_multi_select: zod.boolean(),- is_system: zod- .boolean()- .describe(- 'Flag to indicate if this is a system property (stored in DB).'- ),- owner: zod- .union([- zod- .object({- scope: zod.enum(['user']),- user_id: zod.string(),- })- .describe('User-scoped property only'),- zod- .object({- organization_id: zod.number(),- scope: zod.enum(['organization']),- })- .describe('Organization-scoped property only'),- zod- .object({- organization_id: zod.number(),- scope: zod.enum(['user_and_organization']),- user_id: zod.string(),- })- .describe('Both user and organization-scoped'),- zod- .object({- scope: zod.enum(['system']),- })- .describe(- 'System-owned property (no user or org owner)'- ),- ])- .describe(- 'Defines who owns a property - user-scoped, org-scoped, system, or both user and org.'- ),- specific_entity_type: zod- .union([- zod.null(),- zod- .enum([- 'CHANNEL',- 'CHAT',- 'COMPANY',- 'DOCUMENT',- 'PROJECT',- 'TASK',- 'THREAD',- 'USER',- ])- .describe(- 'Type of entity that can be referenced by entity properties.'- ),- ])- .optional(),- updated_at: zod.iso.datetime({}),- })- .describe(- 'Property definition model (service representation).'- ),- value: zod- .union([- zod.null(),- zod- .union([- zod- .object({- type: zod.enum(['Boolean']),- value: zod- .boolean()- .describe(- 'Boolean value\nSerializes as: {\"type\": \"Boolean\", \"value\": true}'- ),- })- .describe(- 'Boolean value\nSerializes as: {\"type\": \"Boolean\", \"value\": true}'- ),- zod- .object({- type: zod.enum(['Number']),- value: zod- .number()- .describe(- 'Numeric value\nSerializes as: {\"type\": \"Number\", \"value\": 42.5}'- ),- })- .describe(- 'Numeric value\nSerializes as: {\"type\": \"Number\", \"value\": 42.5}'- ),- zod- .object({- type: zod.enum(['String']),- value: zod- .string()- .describe(- 'String value\nSerializes as: {\"type\": \"String\", \"value\": \"text\"}'- ),- })- .describe(- 'String value\nSerializes as: {\"type\": \"String\", \"value\": \"text\"}'- ),- zod- .object({- type: zod.enum(['Date']),- value: zod.iso- .datetime({})- .describe(- 'Date\/timestamp value\nSerializes as: {\"type\": \"Date\", \"value\": \"2025-01-01T00:00:00Z\"}'- ),- })- .describe(- 'Date\/timestamp value\nSerializes as: {\"type\": \"Date\", \"value\": \"2025-01-01T00:00:00Z\"}'- ),- zod- .object({- type: zod.enum(['SelectOption']),- value: zod- .array(zod.uuid())- .describe(- 'Select option(s) - always an array (check is_multi_select to determine if single or multi)\nSingle-select: {\"type\": \"SelectOption\", \"value\": [\"uuid\"]} (length 0 or 1)\nMulti-select: {\"type\": \"SelectOption\", \"value\": [\"uuid1\", \"uuid2\", ...]} (length 0+)'- ),- })- .describe(- 'Select option(s) - always an array (check is_multi_select to determine if single or multi)\nSingle-select: {\"type\": \"SelectOption\", \"value\": [\"uuid\"]} (length 0 or 1)\nMulti-select: {\"type\": \"SelectOption\", \"value\": [\"uuid1\", \"uuid2\", ...]} (length 0+)'- ),- zod- .object({- type: zod.enum(['EntityReference']),- value: zod- .array(- zod- .object({- entity_id: zod.string(),- entity_type: zod- .enum([- 'CHANNEL',- 'CHAT',- 'COMPANY',- 'DOCUMENT',- 'PROJECT',- 'TASK',- 'THREAD',- 'USER',- ])- .describe(- 'Type of entity that can be referenced by entity properties.'- ),- specific_message_id: zod- .uuid()- .nullish()- .describe(- 'For CHANNEL, CHAT, THREAD entity types - optional specific message ID.\nThis allows referencing a specific message within a thread\/channel\/chat.'- ),- })- .describe(- 'Entity reference for entity-type property values.'- )- )- .describe(- 'Entity reference(s) - always an array (check is_multi_select to determine if single or multi)\nSingle-select: {\"type\": \"EntityReference\", \"value\": [{...}]} (length 0 or 1)\nMulti-select: {\"type\": \"EntityReference\", \"value\": [{...}, {...}, ...]} (length 0+)'- ),- })- .describe(- 'Entity reference(s) - always an array (check is_multi_select to determine if single or multi)\nSingle-select: {\"type\": \"EntityReference\", \"value\": [{...}]} (length 0 or 1)\nMulti-select: {\"type\": \"EntityReference\", \"value\": [{...}, {...}, ...]} (length 0+)'- ),- zod- .object({- type: zod.enum(['Link']),- value: zod- .array(zod.string())- .describe(- 'Link value(s) - always an array (check is_multi_select to determine if single or multi)\nSingle-select: {\"type\": \"Link\", \"value\": [\"https:\/\/example.com\"]} (length 0 or 1)\nMulti-select: {\"type\": \"Link\", \"value\": [\"https:\/\/example.com\", \"https:\/\/other.com\"]} (length 0+)'- ),- })- .describe(- 'Link value(s) - always an array (check is_multi_select to determine if single or multi)\nSingle-select: {\"type\": \"Link\", \"value\": [\"https:\/\/example.com\"]} (length 0 or 1)\nMulti-select: {\"type\": \"Link\", \"value\": [\"https:\/\/example.com\", \"https:\/\/other.com\"]} (length 0+)'- ),- ])- .describe(- 'Property value (service representation).\n\nRepresents the actual value stored for an entity property.\nThis is serialized to\/from JSONB in the database.'- ),- ])- .optional(),- })- .describe(- 'A property attached to a Soup item.\n\nThis is a simplified representation that includes only the definition and value,\nomitting the entity property assignment metadata and options.'- )- )- .describe('Properties'),- updatedAt: zod.iso- .datetime({})- .describe('The time the project was updated'),- viewedAt: zod.iso- .datetime({})+ .describe(+ 'Filter by notification seen state. `Some(true)` selects seen\nnotifications; `Some(false)` selects not-seen notifications.'+ ),+ })+ .optional()+ .describe('Notification state filters for channel message queries.'),+ project_ids: zod+ .array(zod.string())+ .optional()+ .describe(+ 'A list of project ids to search within. Empty to ignore project filtering.'+ ),+ recipients: zod+ .array(zod.string())+ .optional()+ .describe(+ "Email Recipient addresses to filter by. Examples: ['[email protected]']. Empty if not filtering by Recipient."+ ),+ senders: zod+ .array(zod.string())+ .optional()+ .describe(+ "Email sender addresses to filter by. Examples: ['[email protected]']. Empty to search all senders."+ ),+ shared: zod+ .enum(['exclude', 'include', 'only'])+ .optional()+ .describe(+ 'Controls whether shared email threads are included in results.'+ ),+ })+ .optional()+ .describe(+ 'The email filters used to filter down what emails you search over.'+ ),+ foreign_entity_filters: zod+ .object({+ foreign_entity_ids: zod+ .array(zod.string())+ .optional()+ .describe(+ 'External entity identifiers to filter by. Empty to include all external IDs.'+ ),+ foreign_entity_sources: zod+ .array(zod.string())+ .optional()+ .describe(+ 'External source names to filter by. Empty to include all sources.'+ ),+ ids: zod+ .array(zod.string())+ .optional()+ .describe(+ 'Internal foreign entity record IDs to filter by. Empty to include all records.'+ ),+ includes_me: zod+ .boolean()+ .optional()+ .describe(+ 'When true, only return foreign entities whose metadata lists the requesting user as a\nparticipant (GitHub `involves:me` semantics for `github_pull_request` records). False or\nabsent applies no filter. Serialized in filter ASTs as the `\"me\"` literal.'+ ),+ notification_filters: zod+ .object({+ done: zod+ .boolean().nullish()- .describe('The time the document was last viewed'),- }),- tag: zod.enum(['project']),- }),- zod.object({- data: zod+ .describe(+ 'Filter by notification done state. `Some(true)` selects done\nnotifications; `Some(false)` selects not-done notifications.'+ ),+ seen: zod+ .boolean()+ .nullish()+ .describe(+ 'Filter by notification seen state. `Some(true)` selects seen\nnotifications; `Some(false)` selects not-seen notifications.'+ ),+ })+ .optional()+ .describe('Notification state filters for channel message queries.'),+ })+ .optional()+ .describe('Filters for foreign entity records.'),+ project_filters: zod+ .object({+ importance: zod+ .boolean()+ .nullish()+ .describe(+ 'Filter by project importance. None to ignore, true to pass through (no clause), false to short-circuit and return nothing.'+ ),+ include_root: zod+ .boolean()+ .optional()+ .describe(+ 'When true, `project_ids` also matches the projects themselves in addition to their children.'+ ),+ notification_filters: zod+ .object({+ done: zod+ .boolean()+ .nullish()+ .describe(+ 'Filter by notification done state. `Some(true)` selects done\nnotifications; `Some(false)` selects not-done notifications.'+ ),+ seen: zod+ .boolean()+ .nullish()+ .describe(+ 'Filter by notification seen state. `Some(true)` selects seen\nnotifications; `Some(false)` selects not-seen notifications.'+ ),+ })+ .optional()+ .describe('Notification state filters for channel message queries.'),+ owners: zod+ .array(zod.string())+ .optional()+ .describe(+ "Filter by project owner. Examples: ['macro|[email protected]'], ['macro|[email protected]', 'macro|[email protected]']. Empty to search all owners."+ ),+ project_ids: zod+ .array(zod.string())+ .optional()+ .describe(+ "Project IDs to search within. Examples: ['project1']. Empty to search all accessible projects.\nBy default matches children of these projects; set `include_root` to also match the projects themselves."+ ),+ })+ .optional()+ .describe(+ 'The project filters used to filter down what projects you search over.'+ ),+ property_filters: zod+ .array(+ zod+ .object({+ entity_ids: zod+ .array(zod.string())+ .optional()+ .describe(+ "Entity reference IDs to match. Multiple values are OR'd together."+ ),+ entity_type: zod+ .string()+ .nullish()+ .describe(+ 'The entity type for the property lookup (e.g., \"TASK\", \"DOCUMENT\", \"PROJECT\").\nWhen None, matches across all entity types.'+ ),+ option_ids: zod+ .array(zod.string())+ .optional()+ .describe(+ "Select option UUIDs to match. Multiple values are OR'd together."+ ),+ property_definition_id: zod+ .string()+ .describe('The UUID of the property definition to filter on.'),+ })+ .describe(+ "A single property-based filter condition.\n\nEach filter targets a specific property definition on entities of a given type,\nmatching against select option UUIDs or entity reference IDs.\nMultiple values within a single filter are OR'd together.\nMultiple filters are AND'd together."+ )+ )+ .optional()+ .describe('property-based filters applied across entity types'),+ })+ .describe('a bundle of all of the filters for each entity type')+ .and(+ zod+ .object({+ expand: zod+ .boolean()+ .nullish()+ .describe('Whether to expand projects. Defaults to true.'),+ limit: zod+ .number()+ .min(postItemsSoupBodyLimitMin)+ .nullish()+ .describe(+ 'Limit the number of items returned. Defaults to 20. Max 500.'+ ),+ sort_method: zod+ .union([+ zod.null(),+ zod+ .enum([+ 'viewed_at',+ 'created_at',+ 'updated_at',+ 'viewed_updated',+ 'frecency',+ ])+ .describe(+ 'Sort options accepted by non-grouped soup API endpoints.'+ ),+ ])+ .optional(),+ })+ .describe('Query parameters shared by soup endpoints.')+ )+ .and(+ zod.object({+ emailView: zod+ .string()+ .optional()+ .describe('the view of specific emails to display'),+ })+ )+ .describe('Request body for the typed soup endpoint.');++export const postItemsSoupResponseItemsItemDataChannelOrgIdMin = 0;++export const postItemsSoupResponse = zod+ .object({+ items: zod.array(+ zod+ .union([+ zod.object({- createdAt: zod.iso.datetime({}),- id: zod.uuid(),- inboxVisible: zod.boolean(),- isDraft: zod.boolean(),- isImportant: zod.boolean(),- isRead: zod.boolean(),- name: zod.string().nullish(),- ownerId: zod.string(),- projectId: zod.string().nullish(),- providerId: zod.string().nullish(),- senderEmail: zod.string().nullish(),- senderName: zod.string().nullish(),- senderPhotoUrl: zod.string().nullish(),- snippet: zod.string().nullish(),- sortTs: zod.iso.datetime({}),- updatedAt: zod.iso.datetime({}),- viewedAt: zod.iso.datetime({}).nullish(),- })- .and(- zod.object({- attachments: zod.array(- zod.object({- contentId: zod.string().nullish(),- createdAt: zod.iso.datetime({}),- filename: zod.string().nullish(),- id: zod.uuid(),- messageId: zod.uuid(),- mimeType: zod.string().nullish(),- providerAttachmentId: zod.string().nullish(),- sizeBytes: zod.number().nullish(),- })- ),- labels: zod.array(- zod.object({- createdAt: zod.iso.datetime({}),- id: zod.uuid(),- labelListVisibility: zod.enum([- 'labelShow',- 'labelShowIfUnread',- 'labelHide',- ]),- linkId: zod.uuid(),- messageListVisibility: zod.enum(['show', 'hide']),- name: zod.string(),- providerLabelId: zod.string(),- type: zod.enum(['system', 'user']),- })- ),- participants: zod.array(- zod.object({- emailAddress: zod.string().nullish(),- id: zod.uuid(),- linkId: zod.uuid(),- name: zod.string().nullish(),- sfsPhotoUrl: zod.string().nullish(),- })- ),- properties: zod.array(- zod- .object({- definition: zod- .object({- created_at: zod.iso.datetime({}),- data_type: zod- .enum([- 'BOOLEAN',- 'DATE',- 'NUMBER',- 'STRING',- 'SELECT_NUMBER',- 'SELECT_STRING',- 'ENTITY',- 'LINK',- ])- .describe(- 'Data type for property values, determining storage and validation.'- ),- display_name: zod.string(),- id: zod.uuid(),- is_metadata: zod- .boolean()- .describe(- 'Flag to indicate if this is a system-generated metadata property.\nNot stored in database - computed at service layer.'- ),- is_multi_select: zod.boolean(),- is_system: zod- .boolean()- .describe(- 'Flag to indicate if this is a system property (stored in DB).'- ),- owner: zod- .union([- zod- .object({- scope: zod.enum(['user']),- user_id: zod.string(),- })- .describe('User-scoped property only'),- zod- .object({- organization_id: zod.number(),- scope: zod.enum(['organization']),- })- .describe('Organization-scoped property only'),- zod- .object({- organization_id: zod.number(),- scope: zod.enum(['user_and_organization']),- user_id: zod.string(),- })- .describe('Both user and organization-scoped'),- zod- .object({- scope: zod.enum(['system']),- })+ data: zod+ .object({+ branchedFromId: zod+ .uuid()+ .nullish()+ .describe(+ 'The id of the document this document branched from'+ ),+ branchedFromVersionId: zod+ .number()+ .nullish()+ .describe(+ 'The id of the version this document branched from\nThis could be either DocumentInstance or DocumentBom id depending on the file type'+ ),+ createdAt: zod.iso+ .datetime({})+ .describe('The time the document was created'),+ deletedAt: zod.iso+ .datetime({})+ .nullish()+ .describe('The time the document was deleted'),+ documentFamilyId: zod+ .number()+ .nullish()+ .describe(+ 'The id of the document family this document belongs to'+ ),+ documentVersionId: zod+ .number()+ .describe(+ 'The version of the document\nThis could be the document_instance_id or document_bom_id depending on the file type'+ ),+ fileType: zod+ .string()+ .nullish()+ .describe('The file type of the document (e.g. pdf, docx)'),+ id: zod.uuid().describe('The document id'),+ name: zod.string().describe('The name of the document'),+ ownerId: zod.string().describe('The owner of the document'),+ projectId: zod+ .uuid()+ .nullish()+ .describe(+ 'The id of the project that this document belongs to'+ ),+ properties: zod+ .array(+ zod+ .object({+ definition: zod+ .object({+ created_at: zod.iso.datetime({}),+ data_type: zod+ .enum([+ 'BOOLEAN',+ 'DATE',+ 'NUMBER',+ 'STRING',+ 'SELECT_NUMBER',+ 'SELECT_STRING',+ 'ENTITY',+ 'LINK',+ ]).describe(- 'System-owned property (no user or org owner)'+ 'Data type for property values, determining storage and validation.'),- ])+ display_name: zod.string(),+ id: zod.uuid(),+ is_metadata: zod+ .boolean()+ .describe(+ 'Flag to indicate if this is a system-generated metadata property.\nNot stored in database - computed at service layer.'+ ),+ is_multi_select: zod.boolean(),+ is_system: zod+ .boolean()+ .describe(+ 'Flag to indicate if this is a system property (stored in DB).'+ ),+ owner: zod+ .union([+ zod+ .object({+ scope: zod.enum(['user']),+ user_id: zod.string(),+ })+ .describe('User-scoped property only'),+ zod+ .object({+ organization_id: zod.number(),+ scope: zod.enum(['organization']),+ })+ .describe(+ 'Organization-scoped property only'+ ),+ zod+ .object({+ organization_id: zod.number(),+ scope: zod.enum([+ 'user_and_organization',+ ]),+ user_id: zod.string(),+ })+ .describe(+ 'Both user and organization-scoped'+ ),+ zod+ .object({+ scope: zod.enum(['system']),+ })+ .describe(+ 'System-owned property (no user or org owner)'+ ),+ ])+ .describe(+ 'Defines who owns a property - user-scoped, org-scoped, system, or both user and org.'+ ),+ specific_entity_type: zod+ .union([+ zod.null(),+ zod+ .enum([+ 'CHANNEL',+ 'CHAT',+ 'COMPANY',+ 'DOCUMENT',+ 'PROJECT',+ 'TASK',+ 'THREAD',+ 'USER',+ ])+ .describe(+ 'Type of entity that can be referenced by entity properties.'+ ),+ ])+ .optional(),+ updated_at: zod.iso.datetime({}),+ }).describe(- 'Defines who owns a property - user-scoped, org-scoped, system, or both user and org.'+ 'Property definition model (service representation).'),- specific_entity_type: zod+ value: zod.union([zod.null(),zod- .enum([- 'CHANNEL',- 'CHAT',- 'COMPANY',- 'DOCUMENT',- 'PROJECT',- 'TASK',- 'THREAD',- 'USER',+ .union([+ zod+ .object({+ type: zod.enum(['Boolean']),+ value: zod+ .boolean()+ .describe(+ 'Boolean value\nSerializes as: {\"type\": \"Boolean\", \"value\": true}'+ ),+ })+ .describe(+ 'Boolean value\nSerializes as: {\"type\": \"Boolean\", \"value\": true}'+ ),+ zod+ .object({+ type: zod.enum(['Number']),+ value: zod+ .number()+ .describe(+ 'Numeric value\nSerializes as: {\"type\": \"Number\", \"value\": 42.5}'+ ),+ })+ .describe(+ 'Numeric value\nSerializes as: {\"type\": \"Number\", \"value\": 42.5}'+ ),+ zod+ .object({+ type: zod.enum(['String']),+ value: zod+ .string()+ .describe(+ 'String value\nSerializes as: {\"type\": \"String\", \"value\": \"text\"}'+ ),+ })+ .describe(+ 'String value\nSerializes as: {\"type\": \"String\", \"value\": \"text\"}'+ ),+ zod+ .object({+ type: zod.enum(['Date']),+ value: zod.iso+ .datetime({})+ .describe(+ 'Date\/timestamp value\nSerializes as: {\"type\": \"Date\", \"value\": \"2025-01-01T00:00:00Z\"}'+ ),+ })+ .describe(+ 'Date\/timestamp value\nSerializes as: {\"type\": \"Date\", \"value\": \"2025-01-01T00:00:00Z\"}'+ ),+ zod+ .object({+ type: zod.enum(['SelectOption']),+ value: zod+ .array(zod.uuid())+ .describe(+ 'Select option(s) - always an array (check is_multi_select to determine if single or multi)\nSingle-select: {\"type\": \"SelectOption\", \"value\": [\"uuid\"]} (length 0 or 1)\nMulti-select: {\"type\": \"SelectOption\", \"value\": [\"uuid1\", \"uuid2\", ...]} (length 0+)'+ ),+ })+ .describe(+ 'Select option(s) - always an array (check is_multi_select to determine if single or multi)\nSingle-select: {\"type\": \"SelectOption\", \"value\": [\"uuid\"]} (length 0 or 1)\nMulti-select: {\"type\": \"SelectOption\", \"value\": [\"uuid1\", \"uuid2\", ...]} (length 0+)'+ ),+ zod+ .object({+ type: zod.enum(['EntityReference']),+ value: zod+ .array(+ zod+ .object({+ entity_id: zod.string(),+ entity_type: zod+ .enum([+ 'CHANNEL',+ 'CHAT',+ 'COMPANY',+ 'DOCUMENT',+ 'PROJECT',+ 'TASK',+ 'THREAD',+ 'USER',+ ])+ .describe(+ 'Type of entity that can be referenced by entity properties.'+ ),+ specific_message_id: zod+ .uuid()+ .nullish()+ .describe(+ 'For CHANNEL, CHAT, THREAD entity types - optional specific message ID.\nThis allows referencing a specific message within a thread\/channel\/chat.'+ ),+ })+ .describe(+ 'Entity reference for entity-type property values.'+ )+ )+ .describe(+ 'Entity reference(s) - always an array (check is_multi_select to determine if single or multi)\nSingle-select: {\"type\": \"EntityReference\", \"value\": [{...}]} (length 0 or 1)\nMulti-select: {\"type\": \"EntityReference\", \"value\": [{...}, {...}, ...]} (length 0+)'+ ),+ })+ .describe(+ 'Entity reference(s) - always an array (check is_multi_select to determine if single or multi)\nSingle-select: {\"type\": \"EntityReference\", \"value\": [{...}]} (length 0 or 1)\nMulti-select: {\"type\": \"EntityReference\", \"value\": [{...}, {...}, ...]} (length 0+)'+ ),+ zod+ .object({+ type: zod.enum(['Link']),+ value: zod+ .array(zod.string())+ .describe(+ 'Link value(s) - always an array (check is_multi_select to determine if single or multi)\nSingle-select: {\"type\": \"Link\", \"value\": [\"https:\/\/example.com\"]} (length 0 or 1)\nMulti-select: {\"type\": \"Link\", \"value\": [\"https:\/\/example.com\", \"https:\/\/other.com\"]} (length 0+)'+ ),+ })+ .describe(+ 'Link value(s) - always an array (check is_multi_select to determine if single or multi)\nSingle-select: {\"type\": \"Link\", \"value\": [\"https:\/\/example.com\"]} (length 0 or 1)\nMulti-select: {\"type\": \"Link\", \"value\": [\"https:\/\/example.com\", \"https:\/\/other.com\"]} (length 0+)'+ ),]).describe(- 'Type of entity that can be referenced by entity properties.'+ 'Property value (service representation).\n\nRepresents the actual value stored for an entity property.\nThis is serialized to\/from JSONB in the database.'),]).optional(),- updated_at: zod.iso.datetime({}),}).describe(- 'Property definition model (service representation).'- ),- value: zod+ 'A property attached to a Soup item.\n\nThis is a simplified representation that includes only the definition and value,\nomitting the entity property assignment metadata and options.'+ )+ )+ .describe('Properties'),+ sha: zod+ .string()+ .nullish()+ .describe(+ 'If the document is a PDF, this is the SHA of the pdf\nIf the document is a DOCX, this will not be present'+ ),+ subType: zod+ .union([+ zod.null(),+ zod.union([- zod.null(),zod- .union([- zod- .object({- type: zod.enum(['Boolean']),- value: zod- .boolean()- .describe(- 'Boolean value\nSerializes as: {\"type\": \"Boolean\", \"value\": true}'- ),- })+ .object({+ is_completed: zod+ .boolean().describe(- 'Boolean value\nSerializes as: {\"type\": \"Boolean\", \"value\": true}'+ 'Whether the task is completed.\nTrue if the Status property is set to \"Completed\".'),- zod- .object({- type: zod.enum(['Number']),- value: zod- .number()- .describe(- 'Numeric value\nSerializes as: {\"type\": \"Number\", \"value\": 42.5}'- ),- })+ type: zod.enum(['task']),+ })+ .describe(+ 'A task document with its associated properties'+ ),+ zod+ .object({+ type: zod.enum(['snippet']),+ })+ .describe('A snippet document — reusable markdown'),+ ])+ .describe(+ 'Sub type of a document with associated properties encoded in each variant.\nThis ensures type-safety: task properties only exist when the document is a task.'+ ),+ ])+ .optional(),+ updatedAt: zod.iso+ .datetime({})+ .describe(+ 'The time the document instance \/ document BOM was updated'+ ),+ viewedAt: zod.iso+ .datetime({})+ .nullish()+ .describe('The time the document was last viewed'),+ })+ .describe('A document as displayed in Soup.'),+ tag: zod.enum(['document']),+ })+ .describe('Document item.'),+ zod+ .object({+ data: zod+ .object({+ createdAt: zod.iso+ .datetime({})+ .describe('The time the chat was created'),+ deletedAt: zod.iso+ .datetime({})+ .nullish()+ .describe('The time the chat was deleted'),+ id: zod.uuid().describe('The chat uuid'),+ isPersistent: zod+ .boolean()+ .describe('Whether the chat is persistent or not'),+ name: zod.string().describe('The name of the chat'),+ ownerId: zod.string().describe('Who the chat belongs to'),+ projectId: zod+ .uuid()+ .nullish()+ .describe('The project id of the chat'),+ properties: zod+ .array(+ zod+ .object({+ definition: zod+ .object({+ created_at: zod.iso.datetime({}),+ data_type: zod+ .enum([+ 'BOOLEAN',+ 'DATE',+ 'NUMBER',+ 'STRING',+ 'SELECT_NUMBER',+ 'SELECT_STRING',+ 'ENTITY',+ 'LINK',+ ]).describe(- 'Numeric value\nSerializes as: {\"type\": \"Number\", \"value\": 42.5}'+ 'Data type for property values, determining storage and validation.'),- zod- .object({- type: zod.enum(['String']),- value: zod- .string()- .describe(- 'String value\nSerializes as: {\"type\": \"String\", \"value\": \"text\"}'- ),- })+ display_name: zod.string(),+ id: zod.uuid(),+ is_metadata: zod+ .boolean().describe(- 'String value\nSerializes as: {\"type\": \"String\", \"value\": \"text\"}'+ 'Flag to indicate if this is a system-generated metadata property.\nNot stored in database - computed at service layer.'),- zod- .object({- type: zod.enum(['Date']),- value: zod.iso- .datetime({})- .describe(- 'Date\/timestamp value\nSerializes as: {\"type\": \"Date\", \"value\": \"2025-01-01T00:00:00Z\"}'- ),- })+ is_multi_select: zod.boolean(),+ is_system: zod+ .boolean().describe(- 'Date\/timestamp value\nSerializes as: {\"type\": \"Date\", \"value\": \"2025-01-01T00:00:00Z\"}'+ 'Flag to indicate if this is a system property (stored in DB).'),- zod- .object({- type: zod.enum(['SelectOption']),- value: zod- .array(zod.uuid())+ owner: zod+ .union([+ zod+ .object({+ scope: zod.enum(['user']),+ user_id: zod.string(),+ })+ .describe('User-scoped property only'),+ zod+ .object({+ organization_id: zod.number(),+ scope: zod.enum(['organization']),+ }).describe(- 'Select option(s) - always an array (check is_multi_select to determine if single or multi)\nSingle-select: {\"type\": \"SelectOption\", \"value\": [\"uuid\"]} (length 0 or 1)\nMulti-select: {\"type\": \"SelectOption\", \"value\": [\"uuid1\", \"uuid2\", ...]} (length 0+)'+ 'Organization-scoped property only'),- })+ zod+ .object({+ organization_id: zod.number(),+ scope: zod.enum([+ 'user_and_organization',+ ]),+ user_id: zod.string(),+ })+ .describe(+ 'Both user and organization-scoped'+ ),+ zod+ .object({+ scope: zod.enum(['system']),+ })+ .describe(+ 'System-owned property (no user or org owner)'+ ),+ ]).describe(- 'Select option(s) - always an array (check is_multi_select to determine if single or multi)\nSingle-select: {\"type\": \"SelectOption\", \"value\": [\"uuid\"]} (length 0 or 1)\nMulti-select: {\"type\": \"SelectOption\", \"value\": [\"uuid1\", \"uuid2\", ...]} (length 0+)'+ 'Defines who owns a property - user-scoped, org-scoped, system, or both user and org.'),+ specific_entity_type: zod+ .union([+ zod.null(),+ zod+ .enum([+ 'CHANNEL',+ 'CHAT',+ 'COMPANY',+ 'DOCUMENT',+ 'PROJECT',+ 'TASK',+ 'THREAD',+ 'USER',+ ])+ .describe(+ 'Type of entity that can be referenced by entity properties.'+ ),+ ])+ .optional(),+ updated_at: zod.iso.datetime({}),+ })+ .describe(+ 'Property definition model (service representation).'+ ),+ value: zod+ .union([+ zod.null(),zod- .object({- type: zod.enum(['EntityReference']),- value: zod- .array(- zod- .object({- entity_id: zod.string(),- entity_type: zod- .enum([- 'CHANNEL',- 'CHAT',- 'COMPANY',- 'DOCUMENT',- 'PROJECT',- 'TASK',- 'THREAD',- 'USER',- ])- .describe(- 'Type of entity that can be referenced by entity properties.'- ),- specific_message_id: zod- .uuid()- .nullish()- .describe(- 'For CHANNEL, CHAT, THREAD entity types - optional specific message ID.\nThis allows referencing a specific message within a thread\/channel\/chat.'- ),- })+ .union([+ zod+ .object({+ type: zod.enum(['Boolean']),+ value: zod+ .boolean()+ .describe(+ 'Boolean value\nSerializes as: {\"type\": \"Boolean\", \"value\": true}'+ ),+ })+ .describe(+ 'Boolean value\nSerializes as: {\"type\": \"Boolean\", \"value\": true}'+ ),+ zod+ .object({+ type: zod.enum(['Number']),+ value: zod+ .number()+ .describe(+ 'Numeric value\nSerializes as: {\"type\": \"Number\", \"value\": 42.5}'+ ),+ })+ .describe(+ 'Numeric value\nSerializes as: {\"type\": \"Number\", \"value\": 42.5}'+ ),+ zod+ .object({+ type: zod.enum(['String']),+ value: zod+ .string()+ .describe(+ 'String value\nSerializes as: {\"type\": \"String\", \"value\": \"text\"}'+ ),+ })+ .describe(+ 'String value\nSerializes as: {\"type\": \"String\", \"value\": \"text\"}'+ ),+ zod+ .object({+ type: zod.enum(['Date']),+ value: zod.iso+ .datetime({})+ .describe(+ 'Date\/timestamp value\nSerializes as: {\"type\": \"Date\", \"value\": \"2025-01-01T00:00:00Z\"}'+ ),+ })+ .describe(+ 'Date\/timestamp value\nSerializes as: {\"type\": \"Date\", \"value\": \"2025-01-01T00:00:00Z\"}'+ ),+ zod+ .object({+ type: zod.enum(['SelectOption']),+ value: zod+ .array(zod.uuid()).describe(- 'Entity reference for entity-type property values.'+ 'Select option(s) - always an array (check is_multi_select to determine if single or multi)\nSingle-select: {\"type\": \"SelectOption\", \"value\": [\"uuid\"]} (length 0 or 1)\nMulti-select: {\"type\": \"SelectOption\", \"value\": [\"uuid1\", \"uuid2\", ...]} (length 0+)'+ ),+ })+ .describe(+ 'Select option(s) - always an array (check is_multi_select to determine if single or multi)\nSingle-select: {\"type\": \"SelectOption\", \"value\": [\"uuid\"]} (length 0 or 1)\nMulti-select: {\"type\": \"SelectOption\", \"value\": [\"uuid1\", \"uuid2\", ...]} (length 0+)'+ ),+ zod+ .object({+ type: zod.enum(['EntityReference']),+ value: zod+ .array(+ zod+ .object({+ entity_id: zod.string(),+ entity_type: zod+ .enum([+ 'CHANNEL',+ 'CHAT',+ 'COMPANY',+ 'DOCUMENT',+ 'PROJECT',+ 'TASK',+ 'THREAD',+ 'USER',+ ])+ .describe(+ 'Type of entity that can be referenced by entity properties.'+ ),+ specific_message_id: zod+ .uuid()+ .nullish()+ .describe(+ 'For CHANNEL, CHAT, THREAD entity types - optional specific message ID.\nThis allows referencing a specific message within a thread\/channel\/chat.'+ ),+ })+ .describe(+ 'Entity reference for entity-type property values.'+ ))- )+ .describe(+ 'Entity reference(s) - always an array (check is_multi_select to determine if single or multi)\nSingle-select: {\"type\": \"EntityReference\", \"value\": [{...}]} (length 0 or 1)\nMulti-select: {\"type\": \"EntityReference\", \"value\": [{...}, {...}, ...]} (length 0+)'+ ),+ }).describe('Entity reference(s) - always an array (check is_multi_select to determine if single or multi)\nSingle-select: {\"type\": \"EntityReference\", \"value\": [{...}]} (length 0 or 1)\nMulti-select: {\"type\": \"EntityReference\", \"value\": [{...}, {...}, ...]} (length 0+)'),- })- .describe(- 'Entity reference(s) - always an array (check is_multi_select to determine if single or multi)\nSingle-select: {\"type\": \"EntityReference\", \"value\": [{...}]} (length 0 or 1)\nMulti-select: {\"type\": \"EntityReference\", \"value\": [{...}, {...}, ...]} (length 0+)'- ),- zod- .object({- type: zod.enum(['Link']),- value: zod- .array(zod.string())+ zod+ .object({+ type: zod.enum(['Link']),+ value: zod+ .array(zod.string())+ .describe(+ 'Link value(s) - always an array (check is_multi_select to determine if single or multi)\nSingle-select: {\"type\": \"Link\", \"value\": [\"https:\/\/example.com\"]} (length 0 or 1)\nMulti-select: {\"type\": \"Link\", \"value\": [\"https:\/\/example.com\", \"https:\/\/other.com\"]} (length 0+)'+ ),+ }).describe('Link value(s) - always an array (check is_multi_select to determine if single or multi)\nSingle-select: {\"type\": \"Link\", \"value\": [\"https:\/\/example.com\"]} (length 0 or 1)\nMulti-select: {\"type\": \"Link\", \"value\": [\"https:\/\/example.com\", \"https:\/\/other.com\"]} (length 0+)'),- })+ ]).describe(- 'Link value(s) - always an array (check is_multi_select to determine if single or multi)\nSingle-select: {\"type\": \"Link\", \"value\": [\"https:\/\/example.com\"]} (length 0 or 1)\nMulti-select: {\"type\": \"Link\", \"value\": [\"https:\/\/example.com\", \"https:\/\/other.com\"]} (length 0+)'+ 'Property value (service representation).\n\nRepresents the actual value stored for an entity property.\nThis is serialized to\/from JSONB in the database.'),])- .describe(- 'Property value (service representation).\n\nRepresents the actual value stored for an entity property.\nThis is serialized to\/from JSONB in the database.'- ),- ])- .optional(),- })- .describe(- 'A property attached to a Soup item.\n\nThis is a simplified representation that includes only the definition and value,\nomitting the entity property assignment metadata and options.'+ .optional(),+ })+ .describe(+ 'A property attached to a Soup item.\n\nThis is a simplified representation that includes only the definition and value,\nomitting the entity property assignment metadata and options.'+ ))- ),- })- ),- tag: zod.enum(['emailThread']),- }),- zod.object({- data: zod- .object({- channel: zod- .object({- channel_type: zod- .enum(['public', 'private', 'direct_message', 'team'])- .describe('Type of channel.'),- created_at: zod.iso+ .describe('Properties'),+ updatedAt: zod.iso.datetime({})- .describe('Creation timestamp.'),- id: zod.uuid().describe('Channel id.'),- name: zod- .string()- .nullish()- .describe('Channel display name.'),- org_id: zod- .number()- .min(postItemsSoupResponseItemsItemDataChannelOrgIdMin)- .nullish()- .describe('Organization id.'),- owner_id: zod.string().describe('Channel owner.'),- team_id: zod.uuid().nullish().describe('Team id.'),- updated_at: zod.iso+ .describe('The time the chat was last updated'),+ viewedAt: zod.iso.datetime({})- .describe('Update timestamp.'),- })- .describe('Channel metadata in soup payloads.'),- participants: zod.array(- zod.object({- channel_id: zod.uuid(),- joined_at: zod.iso.datetime({}),- left_at: zod.iso.datetime({}).nullish(),- role: zod- .enum(['owner', 'admin', 'member'])- .describe('The role a user has within a channel.'),- user_id: zod.string(),+ .nullish()+ .describe('The time the chat was last viewed'),})- ),+ .describe('A chat as displayed in Soup.'),+ tag: zod.enum(['chat']),})- .and(- zod+ .describe('Chat item.'),+ zod+ .object({+ data: zod.object({- latest_message: zod- .union([- zod.null(),- zod- .object({- content: zod.string().describe('Message content.'),- created_at: zod.iso- .datetime({})- .describe('Creation timestamp.'),- deleted_at: zod.iso- .datetime({})- .nullish()- .describe('Deletion timestamp.'),- mentions: zod- .array(zod.string())- .describe(- 'Message mentions formatted as `{ENTITY_TYPE}:{ENTITY_ID}`.'- ),- message_id: zod.uuid().describe('Message id.'),- sender_id: zod.string().describe('Sender id.'),- thread_id: zod- .uuid()- .nullish()- .describe('Thread parent id.'),- updated_at: zod.iso- .datetime({})- .describe('Update timestamp.'),- })- .describe(- 'Lightweight channel message for soup payloads.'- ),- ])- .optional(),- latest_non_thread_message: zod- .union([- zod.null(),+ createdAt: zod.iso+ .datetime({})+ .describe('The time the project was created'),+ deletedAt: zod.iso+ .datetime({})+ .nullish()+ .describe('The time the project was deleted'),+ id: zod.uuid().describe('The id of the project'),+ name: zod.string().describe('The name of the project'),+ ownerId: zod+ .string()+ .describe('The user id of who created the project'),+ parentId: zod+ .uuid()+ .nullish()+ .describe('The parent project id'),+ properties: zod+ .array(zod.object({- content: zod.string().describe('Message content.'),- created_at: zod.iso- .datetime({})- .describe('Creation timestamp.'),- deleted_at: zod.iso- .datetime({})- .nullish()- .describe('Deletion timestamp.'),- mentions: zod- .array(zod.string())+ definition: zod+ .object({+ created_at: zod.iso.datetime({}),+ data_type: zod+ .enum([+ 'BOOLEAN',+ 'DATE',+ 'NUMBER',+ 'STRING',+ 'SELECT_NUMBER',+ 'SELECT_STRING',+ 'ENTITY',+ 'LINK',+ ])+ .describe(+ 'Data type for property values, determining storage and validation.'+ ),+ display_name: zod.string(),+ id: zod.uuid(),+ is_metadata: zod+ .boolean()+ .describe(+ 'Flag to indicate if this is a system-generated metadata property.\nNot stored in database - computed at service layer.'+ ),+ is_multi_select: zod.boolean(),+ is_system: zod+ .boolean()+ .describe(+ 'Flag to indicate if this is a system property (stored in DB).'+ ),+ owner: zod+ .union([+ zod+ .object({+ scope: zod.enum(['user']),+ user_id: zod.string(),+ })+ .describe('User-scoped property only'),+ zod+ .object({+ organization_id: zod.number(),+ scope: zod.enum(['organization']),+ })+ .describe(+ 'Organization-scoped property only'+ ),+ zod+ .object({+ organization_id: zod.number(),+ scope: zod.enum([+ 'user_and_organization',+ ]),+ user_id: zod.string(),+ })+ .describe(+ 'Both user and organization-scoped'+ ),+ zod+ .object({+ scope: zod.enum(['system']),+ })+ .describe(+ 'System-owned property (no user or org owner)'+ ),+ ])+ .describe(+ 'Defines who owns a property - user-scoped, org-scoped, system, or both user and org.'+ ),+ specific_entity_type: zod+ .union([+ zod.null(),+ zod+ .enum([+ 'CHANNEL',+ 'CHAT',+ 'COMPANY',+ 'DOCUMENT',+ 'PROJECT',+ 'TASK',+ 'THREAD',+ 'USER',+ ])+ .describe(+ 'Type of entity that can be referenced by entity properties.'+ ),+ ])+ .optional(),+ updated_at: zod.iso.datetime({}),+ }).describe(- 'Message mentions formatted as `{ENTITY_TYPE}:{ENTITY_ID}`.'+ 'Property definition model (service representation).'),- message_id: zod.uuid().describe('Message id.'),- sender_id: zod.string().describe('Sender id.'),- thread_id: zod- .uuid()- .nullish()- .describe('Thread parent id.'),- updated_at: zod.iso- .datetime({})- .describe('Update timestamp.'),- })- .describe(- 'Lightweight channel message for soup payloads.'- ),- ])- .optional(),- })- .describe('Latest-message bundle for soup payloads.')- )- .and(- zod.object({- interacted_at: zod.iso.datetime({}).nullish(),- viewed_at: zod.iso.datetime({}).nullish(),- })- ),- tag: zod.enum(['channel']),- }),- zod.object({- data: zod- .object({- attended: zod- .boolean()- .describe(- 'Whether the requesting user attended this call. Kept for compatibility\nand derived from `status == ATTENDED`.'- ),- callId: zod.uuid().describe('The call identifier.'),- channelId: zod- .uuid()- .describe('The channel this call belongs to.'),- channelName: zod- .string()- .nullish()- .describe('Resolved display name for the channel.'),- createdBy: zod.string().describe('User who created the call.'),- customName: zod- .string()- .nullish()- .describe(- 'User-supplied or AI-generated display name for the call.'- ),- durationMs: zod- .number()- .nullish()- .describe(- 'Call duration in milliseconds (None if still active).'- ),- endedAt: zod.iso- .datetime({})- .nullish()- .describe('When the call ended (None if still active).'),- isActive: zod- .boolean()- .describe('Whether the call is currently active.'),- participants: zod- .array(- zod- .object({- joinedAt: zod.iso- .datetime({})- .describe('When the user joined the call.'),- leftAt: zod.iso- .datetime({})- .nullish()- .describe(- 'When the user left (None if still in an active call).'- ),- userId: zod.string().describe('The user id.'),- })- .describe(- 'A participant in a call record, as displayed in Soup.'- )- )- .describe('Participants in the call.'),- startedAt: zod.iso- .datetime({})- .describe('When the call started.'),- status: zod- .enum(['ATTENDED', 'MISSED', 'UNATTENDED'])- .describe(- 'Viewer-relative attendance status for a call record.\nSerializes as `ATTENDED`, `MISSED`, or `UNATTENDED`.'- ),- summary: zod- .string()- .nullish()- .describe(- 'AI-generated summary of the call. Only set on archived\n`call_records` once summarization has run; active calls always\nreturn `None`.'- ),- })- .describe(- 'A call record as displayed in Soup. Excludes room_name, egress_id,\nand transcript — fields that are irrelevant for the soup feed.'- ),- tag: zod.enum(['call']),- }),- zod.object({- data: zod- .object({- createdAt: zod.iso- .datetime({})- .describe('When the company was created.'),- description: zod- .string()- .nullish()- .describe(- "Display description from the primary domain's directory entry."- ),- domains: zod- .array(- zod- .object({- companyId: zod- .uuid()- .describe(- 'The id of the company the domain belongs to.'- ),- createdAt: zod.iso- .datetime({})- .describe('When the domain record was created.'),- domain: zod- .string()+ value: zod+ .union([+ zod.null(),+ zod+ .union([+ zod+ .object({+ type: zod.enum(['Boolean']),+ value: zod+ .boolean()+ .describe(+ 'Boolean value\nSerializes as: {\"type\": \"Boolean\", \"value\": true}'+ ),+ })+ .describe(+ 'Boolean value\nSerializes as: {\"type\": \"Boolean\", \"value\": true}'+ ),+ zod+ .object({+ type: zod.enum(['Number']),+ value: zod+ .number()+ .describe(+ 'Numeric value\nSerializes as: {\"type\": \"Number\", \"value\": 42.5}'+ ),+ })+ .describe(+ 'Numeric value\nSerializes as: {\"type\": \"Number\", \"value\": 42.5}'+ ),+ zod+ .object({+ type: zod.enum(['String']),+ value: zod+ .string()+ .describe(+ 'String value\nSerializes as: {\"type\": \"String\", \"value\": \"text\"}'+ ),+ })+ .describe(+ 'String value\nSerializes as: {\"type\": \"String\", \"value\": \"text\"}'+ ),+ zod+ .object({+ type: zod.enum(['Date']),+ value: zod.iso+ .datetime({})+ .describe(+ 'Date\/timestamp value\nSerializes as: {\"type\": \"Date\", \"value\": \"2025-01-01T00:00:00Z\"}'+ ),+ })+ .describe(+ 'Date\/timestamp value\nSerializes as: {\"type\": \"Date\", \"value\": \"2025-01-01T00:00:00Z\"}'+ ),+ zod+ .object({+ type: zod.enum(['SelectOption']),+ value: zod+ .array(zod.uuid())+ .describe(+ 'Select option(s) - always an array (check is_multi_select to determine if single or multi)\nSingle-select: {\"type\": \"SelectOption\", \"value\": [\"uuid\"]} (length 0 or 1)\nMulti-select: {\"type\": \"SelectOption\", \"value\": [\"uuid1\", \"uuid2\", ...]} (length 0+)'+ ),+ })+ .describe(+ 'Select option(s) - always an array (check is_multi_select to determine if single or multi)\nSingle-select: {\"type\": \"SelectOption\", \"value\": [\"uuid\"]} (length 0 or 1)\nMulti-select: {\"type\": \"SelectOption\", \"value\": [\"uuid1\", \"uuid2\", ...]} (length 0+)'+ ),+ zod+ .object({+ type: zod.enum(['EntityReference']),+ value: zod+ .array(+ zod+ .object({+ entity_id: zod.string(),+ entity_type: zod+ .enum([+ 'CHANNEL',+ 'CHAT',+ 'COMPANY',+ 'DOCUMENT',+ 'PROJECT',+ 'TASK',+ 'THREAD',+ 'USER',+ ])+ .describe(+ 'Type of entity that can be referenced by entity properties.'+ ),+ specific_message_id: zod+ .uuid()+ .nullish()+ .describe(+ 'For CHANNEL, CHAT, THREAD entity types - optional specific message ID.\nThis allows referencing a specific message within a thread\/channel\/chat.'+ ),+ })+ .describe(+ 'Entity reference for entity-type property values.'+ )+ )+ .describe(+ 'Entity reference(s) - always an array (check is_multi_select to determine if single or multi)\nSingle-select: {\"type\": \"EntityReference\", \"value\": [{...}]} (length 0 or 1)\nMulti-select: {\"type\": \"EntityReference\", \"value\": [{...}, {...}, ...]} (length 0+)'+ ),+ })+ .describe(+ 'Entity reference(s) - always an array (check is_multi_select to determine if single or multi)\nSingle-select: {\"type\": \"EntityReference\", \"value\": [{...}]} (length 0 or 1)\nMulti-select: {\"type\": \"EntityReference\", \"value\": [{...}, {...}, ...]} (length 0+)'+ ),+ zod+ .object({+ type: zod.enum(['Link']),+ value: zod+ .array(zod.string())+ .describe(+ 'Link value(s) - always an array (check is_multi_select to determine if single or multi)\nSingle-select: {\"type\": \"Link\", \"value\": [\"https:\/\/example.com\"]} (length 0 or 1)\nMulti-select: {\"type\": \"Link\", \"value\": [\"https:\/\/example.com\", \"https:\/\/other.com\"]} (length 0+)'+ ),+ })+ .describe(+ 'Link value(s) - always an array (check is_multi_select to determine if single or multi)\nSingle-select: {\"type\": \"Link\", \"value\": [\"https:\/\/example.com\"]} (length 0 or 1)\nMulti-select: {\"type\": \"Link\", \"value\": [\"https:\/\/example.com\", \"https:\/\/other.com\"]} (length 0+)'+ ),+ ])+ .describe(+ 'Property value (service representation).\n\nRepresents the actual value stored for an entity property.\nThis is serialized to\/from JSONB in the database.'+ ),+ ])+ .optional(),+ }).describe(- 'The domain (lowercased, e.g. \"acme.com\").'- ),- id: zod.uuid().describe('The id of the domain record.'),- })- .describe(- "A CRM domain as displayed in Soup. Mirrors the crm crate's\n[`CrmDomain`] with a stable wire shape that the FE can rely on."+ 'A property attached to a Soup item.\n\nThis is a simplified representation that includes only the definition and value,\nomitting the entity property assignment metadata and options.'+ ))- )- .describe(- 'Domains associated with this company, ordered by creation time\nascending (primary first).'- ),- emailSync: zod- .boolean()- .describe('Whether email sync is enabled for this company.'),- hidden: zod- .boolean()- .describe(- 'Whether the company is hidden from CRM listings. Soup filters\nthese out by default.'- ),- id: zod.uuid().describe('The id of the company.'),- name: zod- .string()- .nullish()- .describe(- "Display name from the primary domain's directory entry, or\n`None` when unresolved."- ),- teamId: zod- .uuid()- .describe('The id of the team that owns this company record.'),- updatedAt: zod.iso- .datetime({})- .describe('When the company was last updated.'),- viewedAt: zod.iso- .datetime({})- .nullish()- .describe(- 'When the requesting user last viewed this company, or `None` if\nnever viewed. Mirrors the `viewed_at` other soup entities carry.'- ),+ .describe('Properties'),+ updatedAt: zod.iso+ .datetime({})+ .describe('The time the project was updated'),+ viewedAt: zod.iso+ .datetime({})+ .nullish()+ .describe('The time the document was last viewed'),+ })+ .describe('A project as displayed in Soup.'),+ tag: zod.enum(['project']),})- .describe(- 'A CRM company as displayed in Soup. Carries the core company\nfields plus display metadata resolved from `crm_domain_directory`\nagainst the primary (earliest-created) domain.'- ),- tag: zod.enum(['crmCompany']),- }),- zod.object({- data: zod+ .describe('Project item.'),+ zod.object({- createdAt: zod.iso- .datetime({})- .describe('Timestamp when the record was created.'),- foreignEntityId: zod- .string()- .describe('Identifier assigned by the external system.'),- foreignEntitySource: zod- .string()- .describe('Source system that owns the external identifier.'),- id: zod- .uuid()- .describe(- 'Internal primary key for this foreign entity record.'- ),- metadata: zod- .object({})- .describe('Arbitrary metadata stored with the mapping.'),- storedForAuthEntity: zod- .string()- .describe(- 'Internal auth entity namespace this foreign entity is stored for.'- ),- storedForId: zod- .string()- .describe(- 'Internal entity identifier this foreign entity is stored for.'- ),- updatedAt: zod.iso- .datetime({})- .describe('Timestamp when the record was last updated.'),- })- .describe('A foreign entity record as displayed in Soup.'),- tag: zod.enum(['foreignEntity']),- }),- ])- .and(- zod.object({- frecency_score: zod.number(),- })- )- ),- next_cursor: zod.string().nullish(),-});--/**- * @summary Gets the items the user has access to using AST filters- */-export const postItemsSoupAstQueryParams = zod.object({- cursor: zod.string().optional().describe('Base64 encoded cursor value.'),-});--export const postItemsSoupAstBodyLimitMin = 0;--export const postItemsSoupAstBody = zod- .object({- callf: zod- .unknown()- .optional()- .describe('the filters that should be applied to the call entity'),- ccf: zod- .unknown()- .optional()- .describe(- "Filters applied to the crm_company entity (wire key `ccf`).\nEmpty\/omitted = team's full visible list."- ),- cf: zod- .unknown()- .optional()- .describe('the filters that should be applied to the chat entity'),- chanf: zod- .unknown()- .optional()- .describe('the filters that should be applied to the channel entity'),- df: zod- .unknown()- .optional()- .describe('the filters that should be applied to the document entity'),- eca: zod- .array(zod.string())- .optional()- .describe(- 'CRM-scoped address filter (wire key: `eca`). Symmetric counterpart\nto `ecd` for fully-qualified email addresses.'- ),- ecd: zod- .array(zod.string())- .optional()- .describe(- 'CRM-scoped domain filter (wire key: `ecd`). Parallel to the\nfreeform `ef` AST. Expanded by the router into an any-direction\nOR sub-tree AND-merged into `ef`, plus a `CrmScope` tag stamped\non the resulting [`item_filters::ast::EmailFilterAst::crm_scope`].\nDrives the per-team CRM authorization pre-check and candidate-set\nwidening downstream. Mutually exclusive with `eca`.'- ),- ef: zod- .unknown()- .optional()- .describe(- 'the filters that should be applied to the email entity (raw AST\ntree only; CRM scope is carried by the `ecd` \/ `eca` sibling\nfields). On this endpoint the email filter stays a bare tree,\nunlike the materialized [`EntityFilterAst`] used for cursors.'- ),- fef: zod- .unknown()- .optional()- .describe('the filters that should be applied to foreign entity records'),- pf: zod- .unknown()- .optional()- .describe('the filters that should be applied to the project entity'),- propf: zod- .unknown()- .optional()- .describe(- 'the filters that should be applied based on entity properties'- ),- })- .and(- zod.object({- expand: zod- .boolean()- .nullish()- .describe('Whether to expand projects. Defaults to true.'),- limit: zod- .number()- .min(postItemsSoupAstBodyLimitMin)- .nullish()- .describe(- 'Limit the number of items returned. Defaults to 20. Max 500.'- ),- sort_method: zod- .union([- zod.null(),- zod.enum([- 'viewed_at',- 'created_at',- 'updated_at',- 'viewed_updated',- 'frecency',- ]),- ])- .optional(),- })- )- .and(- zod.object({- emailView: zod- .string()- .optional()- .describe('the view of specific emails to display'),- })- );--export const postItemsSoupAstResponseItemsItemDataChannelOrgIdMin = 0;--export const postItemsSoupAstResponse = zod.object({- items: zod.array(- zod- .union([- zod.object({- data: zod.object({- branchedFromId: zod- .uuid()- .nullish()- .describe('The id of the document this document branched from'),- branchedFromVersionId: zod- .number()- .nullish()- .describe(- 'The id of the version this document branched from\nThis could be either DocumentInstance or DocumentBom id depending on the file type'- ),- createdAt: zod.iso- .datetime({})- .describe('The time the document was created'),- deletedAt: zod.iso- .datetime({})- .nullish()- .describe('The time the document was deleted'),- documentFamilyId: zod- .number()- .nullish()- .describe(- 'The id of the document family this document belongs to'- ),- documentVersionId: zod- .number()- .describe(- 'The version of the document\nThis could be the document_instance_id or document_bom_id depending on the file type'- ),- fileType: zod- .string()- .nullish()- .describe('The file type of the document (e.g. pdf, docx)'),- id: zod.uuid().describe('The document id'),- name: zod.string().describe('The name of the document'),- ownerId: zod.string().describe('The owner of the document'),- projectId: zod- .uuid()- .nullish()- .describe('The id of the project that this document belongs to'),- properties: zod- .array(- zod- .object({- definition: zod- .object({- created_at: zod.iso.datetime({}),- data_type: zod- .enum([- 'BOOLEAN',- 'DATE',- 'NUMBER',- 'STRING',- 'SELECT_NUMBER',- 'SELECT_STRING',- 'ENTITY',- 'LINK',- ])- .describe(- 'Data type for property values, determining storage and validation.'- ),- display_name: zod.string(),- id: zod.uuid(),- is_metadata: zod- .boolean()- .describe(- 'Flag to indicate if this is a system-generated metadata property.\nNot stored in database - computed at service layer.'- ),- is_multi_select: zod.boolean(),- is_system: zod- .boolean()- .describe(- 'Flag to indicate if this is a system property (stored in DB).'- ),- owner: zod- .union([- zod- .object({- scope: zod.enum(['user']),- user_id: zod.string(),- })- .describe('User-scoped property only'),- zod- .object({- organization_id: zod.number(),- scope: zod.enum(['organization']),- })- .describe('Organization-scoped property only'),- zod- .object({- organization_id: zod.number(),- scope: zod.enum(['user_and_organization']),- user_id: zod.string(),- })- .describe('Both user and organization-scoped'),- zod- .object({- scope: zod.enum(['system']),- })+ data: zod+ .object({+ createdAt: zod.iso+ .datetime({})+ .describe('Timestamp when the thread was created.'),+ id: zod.uuid().describe('Thread id.'),+ inboxVisible: zod+ .boolean()+ .describe('Whether the thread should appear in the inbox.'),+ isDraft: zod+ .boolean()+ .describe('Whether the thread contains a draft.'),+ isImportant: zod+ .boolean()+ .describe('Whether the thread is marked important.'),+ isRead: zod+ .boolean()+ .describe('Whether the thread has been read.'),+ name: zod+ .string()+ .nullish()+ .describe('Thread display name or subject.'),+ ownerId: zod.string().describe('Owner user id.'),+ projectId: zod+ .string()+ .nullish()+ .describe('Project id associated with the thread.'),+ providerId: zod+ .string()+ .nullish()+ .describe('Provider-specific thread id.'),+ senderEmail: zod+ .string()+ .nullish()+ .describe('Sender email address for the preview.'),+ senderName: zod+ .string()+ .nullish()+ .describe('Sender display name for the preview.'),+ senderPhotoUrl: zod+ .string()+ .nullish()+ .describe('Sender photo URL for the preview.'),+ snippet: zod.string().nullish().describe('Thread snippet.'),+ sortTs: zod.iso+ .datetime({})+ .describe('Timestamp used for email thread sorting.'),+ updatedAt: zod.iso+ .datetime({})+ .describe('Timestamp when the thread was last updated.'),+ viewedAt: zod.iso+ .datetime({})+ .nullish()+ .describe(+ 'Timestamp when the requesting user last viewed the thread.'+ ),+ })+ .describe('Email thread preview data as displayed in Soup.')+ .and(+ zod.object({+ attachments: zod+ .array(+ zod+ .object({+ contentId: zod+ .string()+ .nullish()+ .describe('Content id for inline attachments.'),+ createdAt: zod.iso+ .datetime({}).describe(- 'System-owned property (no user or org owner)'+ 'Timestamp when the attachment was created.'),- ])- .describe(- 'Defines who owns a property - user-scoped, org-scoped, system, or both user and org.'- ),- specific_entity_type: zod- .union([- zod.null(),- zod+ filename: zod+ .string()+ .nullish()+ .describe('Attachment filename.'),+ id: zod.uuid().describe('Attachment id.'),+ messageId: zod+ .uuid()+ .describe(+ 'Message id that owns this attachment.'+ ),+ mimeType: zod+ .string()+ .nullish()+ .describe('Attachment MIME type.'),+ providerAttachmentId: zod+ .string()+ .nullish()+ .describe('Provider-specific attachment id.'),+ sizeBytes: zod+ .number()+ .nullish()+ .describe('Attachment size in bytes.'),+ })+ .describe('An email attachment as displayed in Soup.')+ )+ .describe('Attachments on the thread.'),+ labels: zod+ .array(+ zod+ .object({+ createdAt: zod.iso+ .datetime({})+ .describe(+ 'Timestamp when the label was created.'+ ),+ id: zod.uuid().describe('Label id.'),+ labelListVisibility: zod.enum([- 'CHANNEL',- 'CHAT',- 'COMPANY',- 'DOCUMENT',- 'PROJECT',- 'TASK',- 'THREAD',- 'USER',+ 'labelShow',+ 'labelShowIfUnread',+ 'labelHide',])+ .describe('Gmail-style label list visibility.'),+ linkId: zod+ .uuid().describe(- 'Type of entity that can be referenced by entity properties.'+ 'Connected account link id for the label.'),- ])- .optional(),- updated_at: zod.iso.datetime({}),- })- .describe(- 'Property definition model (service representation).'- ),- value: zod- .union([- zod.null(),+ messageListVisibility: zod+ .enum(['show', 'hide'])+ .describe(+ 'Gmail-style message list visibility for a label.'+ ),+ name: zod.string().describe('Label display name.'),+ providerLabelId: zod+ .string()+ .describe('Provider-specific label id.'),+ type: zod+ .enum(['system', 'user'])+ .describe(+ 'Whether an email label is provider-created or user-created.'+ ),+ })+ .describe('An email label as displayed in Soup.')+ )+ .describe('Labels attached to the thread.'),+ participants: zod+ .array(zod- .union([- zod- .object({- type: zod.enum(['Boolean']),- value: zod- .boolean()- .describe(- 'Boolean value\nSerializes as: {\"type\": \"Boolean\", \"value\": true}'- ),- })+ .object({+ emailAddress: zod+ .string()+ .nullish()+ .describe('Contact email address.'),+ id: zod.uuid().describe('Contact id.'),+ linkId: zod+ .uuid().describe(- 'Boolean value\nSerializes as: {\"type\": \"Boolean\", \"value\": true}'+ 'Connected account link id for the contact.'),- zod- .object({- type: zod.enum(['Number']),- value: zod- .number()- .describe(- 'Numeric value\nSerializes as: {\"type\": \"Number\", \"value\": 42.5}'- ),- })+ name: zod+ .string()+ .nullish()+ .describe('Contact display name.'),+ sfsPhotoUrl: zod+ .string()+ .nullish().describe(- 'Numeric value\nSerializes as: {\"type\": \"Number\", \"value\": 42.5}'+ 'Contact photo URL from SFS, if available.'),- zod+ })+ .describe(+ 'A contact participating in an email thread as displayed in Soup.'+ )+ )+ .describe('Contacts participating in the thread.'),+ properties: zod+ .array(+ zod+ .object({+ definition: zod.object({- type: zod.enum(['String']),- value: zod- .string()+ created_at: zod.iso.datetime({}),+ data_type: zod+ .enum([+ 'BOOLEAN',+ 'DATE',+ 'NUMBER',+ 'STRING',+ 'SELECT_NUMBER',+ 'SELECT_STRING',+ 'ENTITY',+ 'LINK',+ ]).describe(- 'String value\nSerializes as: {\"type\": \"String\", \"value\": \"text\"}'+ 'Data type for property values, determining storage and validation.'),- })- .describe(- 'String value\nSerializes as: {\"type\": \"String\", \"value\": \"text\"}'- ),- zod- .object({- type: zod.enum(['Date']),- value: zod.iso- .datetime({})+ display_name: zod.string(),+ id: zod.uuid(),+ is_metadata: zod+ .boolean().describe(- 'Date\/timestamp value\nSerializes as: {\"type\": \"Date\", \"value\": \"2025-01-01T00:00:00Z\"}'+ 'Flag to indicate if this is a system-generated metadata property.\nNot stored in database - computed at service layer.'),- })- .describe(- 'Date\/timestamp value\nSerializes as: {\"type\": \"Date\", \"value\": \"2025-01-01T00:00:00Z\"}'- ),- zod- .object({- type: zod.enum(['SelectOption']),- value: zod- .array(zod.uuid())+ is_multi_select: zod.boolean(),+ is_system: zod+ .boolean()+ .describe(+ 'Flag to indicate if this is a system property (stored in DB).'+ ),+ owner: zod+ .union([+ zod+ .object({+ scope: zod.enum(['user']),+ user_id: zod.string(),+ })+ .describe('User-scoped property only'),+ zod+ .object({+ organization_id: zod.number(),+ scope: zod.enum(['organization']),+ })+ .describe(+ 'Organization-scoped property only'+ ),+ zod+ .object({+ organization_id: zod.number(),+ scope: zod.enum([+ 'user_and_organization',+ ]),+ user_id: zod.string(),+ })+ .describe(+ 'Both user and organization-scoped'+ ),+ zod+ .object({+ scope: zod.enum(['system']),+ })+ .describe(+ 'System-owned property (no user or org owner)'+ ),+ ]).describe(- 'Select option(s) - always an array (check is_multi_select to determine if single or multi)\nSingle-select: {\"type\": \"SelectOption\", \"value\": [\"uuid\"]} (length 0 or 1)\nMulti-select: {\"type\": \"SelectOption\", \"value\": [\"uuid1\", \"uuid2\", ...]} (length 0+)'+ 'Defines who owns a property - user-scoped, org-scoped, system, or both user and org.'),+ specific_entity_type: zod+ .union([+ zod.null(),+ zod+ .enum([+ 'CHANNEL',+ 'CHAT',+ 'COMPANY',+ 'DOCUMENT',+ 'PROJECT',+ 'TASK',+ 'THREAD',+ 'USER',+ ])+ .describe(+ 'Type of entity that can be referenced by entity properties.'+ ),+ ])+ .optional(),+ updated_at: zod.iso.datetime({}),}).describe(- 'Select option(s) - always an array (check is_multi_select to determine if single or multi)\nSingle-select: {\"type\": \"SelectOption\", \"value\": [\"uuid\"]} (length 0 or 1)\nMulti-select: {\"type\": \"SelectOption\", \"value\": [\"uuid1\", \"uuid2\", ...]} (length 0+)'+ 'Property definition model (service representation).'),- zod- .object({- type: zod.enum(['EntityReference']),- value: zod- .array(+ value: zod+ .union([+ zod.null(),+ zod+ .union([+ zod+ .object({+ type: zod.enum(['Boolean']),+ value: zod+ .boolean()+ .describe(+ 'Boolean value\nSerializes as: {\"type\": \"Boolean\", \"value\": true}'+ ),+ })+ .describe(+ 'Boolean value\nSerializes as: {\"type\": \"Boolean\", \"value\": true}'+ ),+ zod+ .object({+ type: zod.enum(['Number']),+ value: zod+ .number()+ .describe(+ 'Numeric value\nSerializes as: {\"type\": \"Number\", \"value\": 42.5}'+ ),+ })+ .describe(+ 'Numeric value\nSerializes as: {\"type\": \"Number\", \"value\": 42.5}'+ ),+ zod+ .object({+ type: zod.enum(['String']),+ value: zod+ .string()+ .describe(+ 'String value\nSerializes as: {\"type\": \"String\", \"value\": \"text\"}'+ ),+ })+ .describe(+ 'String value\nSerializes as: {\"type\": \"String\", \"value\": \"text\"}'+ ),+ zod+ .object({+ type: zod.enum(['Date']),+ value: zod.iso+ .datetime({})+ .describe(+ 'Date\/timestamp value\nSerializes as: {\"type\": \"Date\", \"value\": \"2025-01-01T00:00:00Z\"}'+ ),+ })+ .describe(+ 'Date\/timestamp value\nSerializes as: {\"type\": \"Date\", \"value\": \"2025-01-01T00:00:00Z\"}'+ ),zod.object({- entity_id: zod.string(),- entity_type: zod- .enum([- 'CHANNEL',- 'CHAT',- 'COMPANY',- 'DOCUMENT',- 'PROJECT',- 'TASK',- 'THREAD',- 'USER',- ])+ type: zod.enum(['SelectOption']),+ value: zod+ .array(zod.uuid()).describe(- 'Type of entity that can be referenced by entity properties.'+ 'Select option(s) - always an array (check is_multi_select to determine if single or multi)\nSingle-select: {\"type\": \"SelectOption\", \"value\": [\"uuid\"]} (length 0 or 1)\nMulti-select: {\"type\": \"SelectOption\", \"value\": [\"uuid1\", \"uuid2\", ...]} (length 0+)'),- specific_message_id: zod- .uuid()- .nullish()+ })+ .describe(+ 'Select option(s) - always an array (check is_multi_select to determine if single or multi)\nSingle-select: {\"type\": \"SelectOption\", \"value\": [\"uuid\"]} (length 0 or 1)\nMulti-select: {\"type\": \"SelectOption\", \"value\": [\"uuid1\", \"uuid2\", ...]} (length 0+)'+ ),+ zod+ .object({+ type: zod.enum(['EntityReference']),+ value: zod+ .array(+ zod+ .object({+ entity_id: zod.string(),+ entity_type: zod+ .enum([+ 'CHANNEL',+ 'CHAT',+ 'COMPANY',+ 'DOCUMENT',+ 'PROJECT',+ 'TASK',+ 'THREAD',+ 'USER',+ ])+ .describe(+ 'Type of entity that can be referenced by entity properties.'+ ),+ specific_message_id: zod+ .uuid()+ .nullish()+ .describe(+ 'For CHANNEL, CHAT, THREAD entity types - optional specific message ID.\nThis allows referencing a specific message within a thread\/channel\/chat.'+ ),+ })+ .describe(+ 'Entity reference for entity-type property values.'+ )+ ).describe(- 'For CHANNEL, CHAT, THREAD entity types - optional specific message ID.\nThis allows referencing a specific message within a thread\/channel\/chat.'+ 'Entity reference(s) - always an array (check is_multi_select to determine if single or multi)\nSingle-select: {\"type\": \"EntityReference\", \"value\": [{...}]} (length 0 or 1)\nMulti-select: {\"type\": \"EntityReference\", \"value\": [{...}, {...}, ...]} (length 0+)'),}).describe(- 'Entity reference for entity-type property values.'- )- )- .describe(- 'Entity reference(s) - always an array (check is_multi_select to determine if single or multi)\nSingle-select: {\"type\": \"EntityReference\", \"value\": [{...}]} (length 0 or 1)\nMulti-select: {\"type\": \"EntityReference\", \"value\": [{...}, {...}, ...]} (length 0+)'- ),- })- .describe(- 'Entity reference(s) - always an array (check is_multi_select to determine if single or multi)\nSingle-select: {\"type\": \"EntityReference\", \"value\": [{...}]} (length 0 or 1)\nMulti-select: {\"type\": \"EntityReference\", \"value\": [{...}, {...}, ...]} (length 0+)'- ),- zod- .object({- type: zod.enum(['Link']),- value: zod- .array(zod.string())+ 'Entity reference(s) - always an array (check is_multi_select to determine if single or multi)\nSingle-select: {\"type\": \"EntityReference\", \"value\": [{...}]} (length 0 or 1)\nMulti-select: {\"type\": \"EntityReference\", \"value\": [{...}, {...}, ...]} (length 0+)'+ ),+ zod+ .object({+ type: zod.enum(['Link']),+ value: zod+ .array(zod.string())+ .describe(+ 'Link value(s) - always an array (check is_multi_select to determine if single or multi)\nSingle-select: {\"type\": \"Link\", \"value\": [\"https:\/\/example.com\"]} (length 0 or 1)\nMulti-select: {\"type\": \"Link\", \"value\": [\"https:\/\/example.com\", \"https:\/\/other.com\"]} (length 0+)'+ ),+ })+ .describe(+ 'Link value(s) - always an array (check is_multi_select to determine if single or multi)\nSingle-select: {\"type\": \"Link\", \"value\": [\"https:\/\/example.com\"]} (length 0 or 1)\nMulti-select: {\"type\": \"Link\", \"value\": [\"https:\/\/example.com\", \"https:\/\/other.com\"]} (length 0+)'+ ),+ ]).describe(- 'Link value(s) - always an array (check is_multi_select to determine if single or multi)\nSingle-select: {\"type\": \"Link\", \"value\": [\"https:\/\/example.com\"]} (length 0 or 1)\nMulti-select: {\"type\": \"Link\", \"value\": [\"https:\/\/example.com\", \"https:\/\/other.com\"]} (length 0+)'+ 'Property value (service representation).\n\nRepresents the actual value stored for an entity property.\nThis is serialized to\/from JSONB in the database.'),- })- .describe(- 'Link value(s) - always an array (check is_multi_select to determine if single or multi)\nSingle-select: {\"type\": \"Link\", \"value\": [\"https:\/\/example.com\"]} (length 0 or 1)\nMulti-select: {\"type\": \"Link\", \"value\": [\"https:\/\/example.com\", \"https:\/\/other.com\"]} (length 0+)'- ),- ])+ ])+ .optional(),+ }).describe(- 'Property value (service representation).\n\nRepresents the actual value stored for an entity property.\nThis is serialized to\/from JSONB in the database.'- ),- ])- .optional(),+ 'A property attached to a Soup item.\n\nThis is a simplified representation that includes only the definition and value,\nomitting the entity property assignment metadata and options.'+ )+ )+ .describe('Properties attached to the thread.'),})- .describe(- 'A property attached to a Soup item.\n\nThis is a simplified representation that includes only the definition and value,\nomitting the entity property assignment metadata and options.'- )- )- .describe('Properties'),- sha: zod- .string()- .nullish()- .describe(- 'If the document is a PDF, this is the SHA of the pdf\nIf the document is a DOCX, this will not be present'- ),- subType: zod- .union([- zod.null(),- zod- .union([- zod- .object({- is_completed: zod- .boolean()- .describe(- 'Whether the task is completed.\nTrue if the Status property is set to \"Completed\".'- ),- type: zod.enum(['task']),- })- .describe(- 'A task document with its associated properties'- ),- zod- .object({- type: zod.enum(['snippet']),- })- .describe('A snippet document — reusable markdown'),- ])- .describe(- 'Sub type of a document with associated properties encoded in each variant.\nThis ensures type-safety: task properties only exist when the document is a task.'- ),- ])- .optional(),- updatedAt: zod.iso- .datetime({})- .describe(- 'The time the document instance \/ document BOM was updated'- ),- viewedAt: zod.iso- .datetime({})- .nullish()- .describe('The time the document was last viewed'),- }),- tag: zod.enum(['document']),- }),- zod.object({- data: zod.object({- createdAt: zod.iso- .datetime({})- .describe('The time the chat was created'),- deletedAt: zod.iso- .datetime({})- .nullish()- .describe('The time the chat was deleted'),- id: zod.uuid().describe('The chat uuid'),- isPersistent: zod- .boolean()- .describe('Whether the chat is persistent or not'),- name: zod.string().describe('The name of the chat'),- ownerId: zod.string().describe('Who the chat belongs to'),- projectId: zod- .uuid()- .nullish()- .describe('The project id of the chat'),- properties: zod- .array(- zod- .object({- definition: zod- .object({- created_at: zod.iso.datetime({}),- data_type: zod- .enum([- 'BOOLEAN',- 'DATE',- 'NUMBER',- 'STRING',- 'SELECT_NUMBER',- 'SELECT_STRING',- 'ENTITY',- 'LINK',- ])- .describe(- 'Data type for property values, determining storage and validation.'- ),- display_name: zod.string(),- id: zod.uuid(),- is_metadata: zod- .boolean()- .describe(- 'Flag to indicate if this is a system-generated metadata property.\nNot stored in database - computed at service layer.'- ),- is_multi_select: zod.boolean(),- is_system: zod- .boolean()- .describe(- 'Flag to indicate if this is a system property (stored in DB).'- ),- owner: zod- .union([- zod- .object({- scope: zod.enum(['user']),- user_id: zod.string(),- })- .describe('User-scoped property only'),- zod- .object({- organization_id: zod.number(),- scope: zod.enum(['organization']),- })- .describe('Organization-scoped property only'),- zod- .object({- organization_id: zod.number(),- scope: zod.enum(['user_and_organization']),- user_id: zod.string(),- })- .describe('Both user and organization-scoped'),- zod- .object({- scope: zod.enum(['system']),- })- .describe(- 'System-owned property (no user or org owner)'- ),- ])- .describe(- 'Defines who owns a property - user-scoped, org-scoped, system, or both user and org.'- ),- specific_entity_type: zod- .union([- zod.null(),- zod- .enum([- 'CHANNEL',- 'CHAT',- 'COMPANY',- 'DOCUMENT',- 'PROJECT',- 'TASK',- 'THREAD',- 'USER',- ])- .describe(- 'Type of entity that can be referenced by entity properties.'- ),- ])- .optional(),- updated_at: zod.iso.datetime({}),- })+ )+ .describe(+ 'Email thread preview enriched with related metadata for Soup.'+ ),+ tag: zod.enum(['emailThread']),+ })+ .describe('Email thread item.'),+ zod+ .object({+ data: zod+ .object({+ channel: zod+ .object({+ channel_type: zod+ .enum(['public', 'private', 'direct_message', 'team'])+ .describe('Type of channel.'),+ created_at: zod.iso+ .datetime({})+ .describe('Creation timestamp.'),+ id: zod.uuid().describe('Channel id.'),+ name: zod+ .string()+ .nullish()+ .describe('Channel display name.'),+ org_id: zod+ .number()+ .min(postItemsSoupResponseItemsItemDataChannelOrgIdMin)+ .nullish()+ .describe('Organization id.'),+ owner_id: zod.string().describe('Channel owner.'),+ team_id: zod.uuid().nullish().describe('Team id.'),+ updated_at: zod.iso+ .datetime({})+ .describe('Update timestamp.'),+ })+ .describe('Channel metadata in soup payloads.'),+ participants: zod+ .array(+ zod+ .object({+ channel_id: zod+ .uuid()+ .describe(+ 'Channel id for the participant membership.'+ ),+ joined_at: zod.iso+ .datetime({})+ .describe(+ 'Timestamp when the participant joined the channel.'+ ),+ left_at: zod.iso+ .datetime({})+ .nullish()+ .describe(+ 'Timestamp when the participant left the channel, if any.'+ ),+ role: zod+ .enum(['owner', 'admin', 'member'])+ .describe('The role a user has within a channel.'),+ user_id: zod+ .string()+ .describe('Participant user id.'),+ })+ .describe("A user's membership in a channel.")+ )+ .describe('Participants in the channel.'),+ })+ .describe('Channel metadata together with its participants.')+ .and(+ zod+ .object({+ latest_message: zod+ .union([+ zod.null(),+ zod+ .object({+ content: zod+ .string()+ .describe('Message content.'),+ created_at: zod.iso+ .datetime({})+ .describe('Creation timestamp.'),+ deleted_at: zod.iso+ .datetime({})+ .nullish()+ .describe('Deletion timestamp.'),+ mentions: zod+ .array(zod.string())+ .describe(+ 'Message mentions formatted as `{ENTITY_TYPE}:{ENTITY_ID}`.'+ ),+ message_id: zod.uuid().describe('Message id.'),+ sender_id: zod.string().describe('Sender id.'),+ thread_id: zod+ .uuid()+ .nullish()+ .describe('Thread parent id.'),+ updated_at: zod.iso+ .datetime({})+ .describe('Update timestamp.'),+ })+ .describe(+ 'Lightweight channel message for soup payloads.'+ ),+ ])+ .optional(),+ latest_non_thread_message: zod+ .union([+ zod.null(),+ zod+ .object({+ content: zod+ .string()+ .describe('Message content.'),+ created_at: zod.iso+ .datetime({})+ .describe('Creation timestamp.'),+ deleted_at: zod.iso+ .datetime({})+ .nullish()+ .describe('Deletion timestamp.'),+ mentions: zod+ .array(zod.string())+ .describe(+ 'Message mentions formatted as `{ENTITY_TYPE}:{ENTITY_ID}`.'+ ),+ message_id: zod.uuid().describe('Message id.'),+ sender_id: zod.string().describe('Sender id.'),+ thread_id: zod+ .uuid()+ .nullish()+ .describe('Thread parent id.'),+ updated_at: zod.iso+ .datetime({})+ .describe('Update timestamp.'),+ })+ .describe(+ 'Lightweight channel message for soup payloads.'+ ),+ ])+ .optional(),+ })+ .describe('Latest-message bundle for soup payloads.')+ )+ .and(+ zod.object({+ interacted_at: zod.iso+ .datetime({})+ .nullish()+ .describe(+ 'Timestamp when the requesting user last interacted with this channel.'+ ),+ viewed_at: zod.iso+ .datetime({})+ .nullish().describe(- 'Property definition model (service representation).'+ 'Timestamp when the requesting user last viewed this channel.'),- value: zod- .union([- zod.null(),+ })+ )+ .describe('A channel as displayed in Soup.'),+ tag: zod.enum(['channel']),+ })+ .describe('Channel item.'),+ zod+ .object({+ data: zod+ .object({+ channel_id: zod+ .uuid()+ .describe('Channel that owns the thread.'),+ messages: zod+ .array(+ zod+ .object({+ content: zod.string().describe('Message content.'),+ created_at: zod.iso+ .datetime({})+ .describe('Creation timestamp.'),+ deleted_at: zod.iso+ .datetime({})+ .nullish()+ .describe('Deletion timestamp.'),+ mentions: zod+ .array(zod.string())+ .describe(+ 'Message mentions formatted as `{ENTITY_TYPE}:{ENTITY_ID}`.'+ ),+ message_id: zod.uuid().describe('Message id.'),+ sender_id: zod.string().describe('Sender id.'),+ thread_id: zod+ .uuid()+ .nullish()+ .describe('Thread parent id.'),+ updated_at: zod.iso+ .datetime({})+ .describe('Update timestamp.'),+ })+ .describe(+ 'Lightweight channel message for soup payloads.'+ )+ )+ .describe(+ 'Thread replies, using the same lightweight channel message shape.'+ ),+ root_message: zod+ .object({+ content: zod.string().describe('Message content.'),+ created_at: zod.iso+ .datetime({})+ .describe('Creation timestamp.'),+ deleted_at: zod.iso+ .datetime({})+ .nullish()+ .describe('Deletion timestamp.'),+ mentions: zod+ .array(zod.string())+ .describe(+ 'Message mentions formatted as `{ENTITY_TYPE}:{ENTITY_ID}`.'+ ),+ message_id: zod.uuid().describe('Message id.'),+ sender_id: zod.string().describe('Sender id.'),+ thread_id: zod+ .uuid()+ .nullish()+ .describe('Thread parent id.'),+ updated_at: zod.iso+ .datetime({})+ .describe('Update timestamp.'),+ })+ .describe('Lightweight channel message for soup payloads.'),+ })+ .describe(+ 'A top-level channel message thread for soup payloads.\n\nThis reuses the existing lightweight [`ChannelMessage`] shape used by\n[`SoupChannel`] latest-message data.'+ ),+ tag: zod.enum(['channelThread']),+ })+ .describe('Channel thread item.'),+ zod+ .object({+ data: zod+ .object({+ attended: zod+ .boolean()+ .describe(+ 'Whether the requesting user attended this call. Kept for compatibility\nand derived from `status == ATTENDED`.'+ ),+ callId: zod.uuid().describe('The call identifier.'),+ channelId: zod+ .uuid()+ .describe('The channel this call belongs to.'),+ channelName: zod+ .string()+ .nullish()+ .describe('Resolved display name for the channel.'),+ createdBy: zod+ .string()+ .describe('User who created the call.'),+ customName: zod+ .string()+ .nullish()+ .describe(+ 'User-supplied or AI-generated display name for the call.'+ ),+ durationMs: zod+ .number()+ .nullish()+ .describe(+ 'Call duration in milliseconds (None if still active).'+ ),+ endedAt: zod.iso+ .datetime({})+ .nullish()+ .describe('When the call ended (None if still active).'),+ isActive: zod+ .boolean()+ .describe('Whether the call is currently active.'),+ participants: zod+ .array(+ zod+ .object({+ joinedAt: zod.iso+ .datetime({})+ .describe('When the user joined the call.'),+ leftAt: zod.iso+ .datetime({})+ .nullish()+ .describe(+ 'When the user left (None if still in an active call).'+ ),+ userId: zod.string().describe('The user id.'),+ })+ .describe(+ 'A participant in a call record, as displayed in Soup.'+ )+ )+ .describe('Participants in the call.'),+ startedAt: zod.iso+ .datetime({})+ .describe('When the call started.'),+ status: zod+ .enum(['ATTENDED', 'MISSED', 'UNATTENDED'])+ .describe(+ 'Viewer-relative attendance status for a call record.\nSerializes as `ATTENDED`, `MISSED`, or `UNATTENDED`.'+ ),+ summary: zod+ .string()+ .nullish()+ .describe(+ 'AI-generated summary of the call. Only set on archived\n`call_records` once summarization has run; active calls always\nreturn `None`.'+ ),+ })+ .describe(+ 'A call record as displayed in Soup. Excludes room_name, egress_id,\nand transcript — fields that are irrelevant for the soup feed.'+ ),+ tag: zod.enum(['call']),+ })+ .describe('Call record item.'),+ zod+ .object({+ data: zod+ .object({+ createdAt: zod.iso+ .datetime({})+ .describe('When the company was created.'),+ description: zod+ .string()+ .nullish()+ .describe(+ "Display description from the primary domain's directory entry."+ ),+ domains: zod+ .array(+ zod+ .object({+ companyId: zod+ .uuid()+ .describe(+ 'The id of the company the domain belongs to.'+ ),+ createdAt: zod.iso+ .datetime({})+ .describe('When the domain record was created.'),+ domain: zod+ .string()+ .describe(+ 'The domain (lowercased, e.g. \"acme.com\").'+ ),+ id: zod+ .uuid()+ .describe('The id of the domain record.'),+ })+ .describe(+ "A CRM domain as displayed in Soup. Mirrors the crm crate's\n[`CrmDomain`] with a stable wire shape that the FE can rely on."+ )+ )+ .describe(+ 'Domains associated with this company, ordered by creation time\nascending (primary first).'+ ),+ emailSync: zod+ .boolean()+ .describe(+ 'Whether email sync is enabled for this company.'+ ),+ hidden: zod+ .boolean()+ .describe(+ 'Whether the company is hidden from CRM listings. Soup filters\nthese out by default.'+ ),+ id: zod.uuid().describe('The id of the company.'),+ name: zod+ .string()+ .nullish()+ .describe(+ "Display name from the primary domain's directory entry, or\n`None` when unresolved."+ ),+ teamId: zod+ .uuid()+ .describe(+ 'The id of the team that owns this company record.'+ ),+ updatedAt: zod.iso+ .datetime({})+ .describe('When the company was last updated.'),+ viewedAt: zod.iso+ .datetime({})+ .nullish()+ .describe(+ 'When the requesting user last viewed this company, or `None` if\nnever viewed. Mirrors the `viewed_at` other soup entities carry.'+ ),+ })+ .describe(+ 'A CRM company as displayed in Soup. Carries the core company\nfields plus display metadata resolved from `crm_domain_directory`\nagainst the primary (earliest-created) domain.'+ ),+ tag: zod.enum(['crmCompany']),+ })+ .describe('CRM company item.'),+ zod+ .object({+ data: zod+ .object({+ createdAt: zod.iso+ .datetime({})+ .describe('Timestamp when the record was created.'),+ foreignEntityId: zod+ .string()+ .describe('Identifier assigned by the external system.'),+ foreignEntitySource: zod+ .string()+ .describe(+ 'Source system that owns the external identifier.'+ ),+ id: zod+ .uuid()+ .describe(+ 'Internal primary key for this foreign entity record.'+ ),+ metadata: zod+ .object({})+ .describe('Arbitrary metadata stored with the mapping.'),+ storedForAuthEntity: zod+ .string()+ .describe(+ 'Internal auth entity namespace this foreign entity is stored for.'+ ),+ storedForId: zod+ .string()+ .describe(+ 'Internal entity identifier this foreign entity is stored for.'+ ),+ updatedAt: zod.iso+ .datetime({})+ .describe('Timestamp when the record was last updated.'),+ })+ .describe('A foreign entity record as displayed in Soup.'),+ tag: zod.enum(['foreignEntity']),+ })+ .describe('Foreign entity item.'),+ ])+ .describe('A single item in the Soup feed.')+ .and(+ zod.object({+ frecency_score: zod.number(),+ })+ )+ .describe('API representation of a soup item with its frecency score.')+ ),+ next_cursor: zod.string().nullish(),+ })+ .describe('Response page for non-grouped soup endpoints.');++/**+ * @summary Gets the items the user has access to using AST filters+ */+export const postItemsSoupAstQueryParams = zod.object({+ cursor: zod.string().optional().describe('Base64 encoded cursor value.'),+});++export const postItemsSoupAstBodyLimitMin = 0;++export const postItemsSoupAstBody = zod+ .object({+ callf: zod+ .unknown()+ .optional()+ .describe('the filters that should be applied to the call entity'),+ ccf: zod+ .unknown()+ .optional()+ .describe(+ "Filters applied to the crm_company entity (wire key `ccf`).\nEmpty\/omitted = team's full visible list."+ ),+ cf: zod+ .unknown()+ .optional()+ .describe('the filters that should be applied to the chat entity'),+ chanf: zod+ .unknown()+ .optional()+ .describe('the filters that should be applied to the channel entity'),+ df: zod+ .unknown()+ .optional()+ .describe('the filters that should be applied to the document entity'),+ eca: zod+ .array(zod.string())+ .optional()+ .describe(+ 'CRM-scoped address filter (wire key: `eca`). Symmetric counterpart\nto `ecd` for fully-qualified email addresses.'+ ),+ ecd: zod+ .array(zod.string())+ .optional()+ .describe(+ 'CRM-scoped domain filter (wire key: `ecd`). Parallel to the\nfreeform `ef` AST. Expanded by the router into an any-direction\nOR sub-tree AND-merged into `ef`, plus a `CrmScope` tag stamped\non the resulting [`item_filters::ast::EmailFilterAst::crm_scope`].\nDrives the per-team CRM authorization pre-check and candidate-set\nwidening downstream. Mutually exclusive with `eca`.'+ ),+ ef: zod+ .unknown()+ .optional()+ .describe(+ 'the filters that should be applied to the email entity (raw AST\ntree only; CRM scope is carried by the `ecd` \/ `eca` sibling\nfields). On this endpoint the email filter stays a bare tree,\nunlike the materialized [`EntityFilterAst`] used for cursors.'+ ),+ fef: zod+ .unknown()+ .optional()+ .describe('the filters that should be applied to foreign entity records'),+ pf: zod+ .unknown()+ .optional()+ .describe('the filters that should be applied to the project entity'),+ propf: zod+ .unknown()+ .optional()+ .describe(+ 'the filters that should be applied based on entity properties'+ ),+ })+ .describe('Wire-format entity filter AST accepted by soup AST endpoints.')+ .and(+ zod+ .object({+ expand: zod+ .boolean()+ .nullish()+ .describe('Whether to expand projects. Defaults to true.'),+ limit: zod+ .number()+ .min(postItemsSoupAstBodyLimitMin)+ .nullish()+ .describe(+ 'Limit the number of items returned. Defaults to 20. Max 500.'+ ),+ sort_method: zod+ .union([+ zod.null(),+ zod+ .enum([+ 'viewed_at',+ 'created_at',+ 'updated_at',+ 'viewed_updated',+ 'frecency',+ ])+ .describe(+ 'Sort options accepted by non-grouped soup API endpoints.'+ ),+ ])+ .optional(),+ })+ .describe('Query parameters shared by soup endpoints.')+ )+ .and(+ zod.object({+ emailView: zod+ .string()+ .optional()+ .describe('the view of specific emails to display'),+ })+ )+ .describe('Request body for the AST soup endpoint.');++export const postItemsSoupAstResponseItemsItemDataChannelOrgIdMin = 0;++export const postItemsSoupAstResponse = zod+ .object({+ items: zod.array(+ zod+ .union([+ zod+ .object({+ data: zod+ .object({+ branchedFromId: zod+ .uuid()+ .nullish()+ .describe(+ 'The id of the document this document branched from'+ ),+ branchedFromVersionId: zod+ .number()+ .nullish()+ .describe(+ 'The id of the version this document branched from\nThis could be either DocumentInstance or DocumentBom id depending on the file type'+ ),+ createdAt: zod.iso+ .datetime({})+ .describe('The time the document was created'),+ deletedAt: zod.iso+ .datetime({})+ .nullish()+ .describe('The time the document was deleted'),+ documentFamilyId: zod+ .number()+ .nullish()+ .describe(+ 'The id of the document family this document belongs to'+ ),+ documentVersionId: zod+ .number()+ .describe(+ 'The version of the document\nThis could be the document_instance_id or document_bom_id depending on the file type'+ ),+ fileType: zod+ .string()+ .nullish()+ .describe('The file type of the document (e.g. pdf, docx)'),+ id: zod.uuid().describe('The document id'),+ name: zod.string().describe('The name of the document'),+ ownerId: zod.string().describe('The owner of the document'),+ projectId: zod+ .uuid()+ .nullish()+ .describe(+ 'The id of the project that this document belongs to'+ ),+ properties: zod+ .array(+ zod+ .object({+ definition: zod+ .object({+ created_at: zod.iso.datetime({}),+ data_type: zod+ .enum([+ 'BOOLEAN',+ 'DATE',+ 'NUMBER',+ 'STRING',+ 'SELECT_NUMBER',+ 'SELECT_STRING',+ 'ENTITY',+ 'LINK',+ ])+ .describe(+ 'Data type for property values, determining storage and validation.'+ ),+ display_name: zod.string(),+ id: zod.uuid(),+ is_metadata: zod+ .boolean()+ .describe(+ 'Flag to indicate if this is a system-generated metadata property.\nNot stored in database - computed at service layer.'+ ),+ is_multi_select: zod.boolean(),+ is_system: zod+ .boolean()+ .describe(+ 'Flag to indicate if this is a system property (stored in DB).'+ ),+ owner: zod+ .union([+ zod+ .object({+ scope: zod.enum(['user']),+ user_id: zod.string(),+ })+ .describe('User-scoped property only'),+ zod+ .object({+ organization_id: zod.number(),+ scope: zod.enum(['organization']),+ })+ .describe(+ 'Organization-scoped property only'+ ),+ zod+ .object({+ organization_id: zod.number(),+ scope: zod.enum([+ 'user_and_organization',+ ]),+ user_id: zod.string(),+ })+ .describe(+ 'Both user and organization-scoped'+ ),+ zod+ .object({+ scope: zod.enum(['system']),+ })+ .describe(+ 'System-owned property (no user or org owner)'+ ),+ ])+ .describe(+ 'Defines who owns a property - user-scoped, org-scoped, system, or both user and org.'+ ),+ specific_entity_type: zod+ .union([+ zod.null(),+ zod+ .enum([+ 'CHANNEL',+ 'CHAT',+ 'COMPANY',+ 'DOCUMENT',+ 'PROJECT',+ 'TASK',+ 'THREAD',+ 'USER',+ ])+ .describe(+ 'Type of entity that can be referenced by entity properties.'+ ),+ ])+ .optional(),+ updated_at: zod.iso.datetime({}),+ })+ .describe(+ 'Property definition model (service representation).'+ ),+ value: zod+ .union([+ zod.null(),+ zod+ .union([+ zod+ .object({+ type: zod.enum(['Boolean']),+ value: zod+ .boolean()+ .describe(+ 'Boolean value\nSerializes as: {\"type\": \"Boolean\", \"value\": true}'+ ),+ })+ .describe(+ 'Boolean value\nSerializes as: {\"type\": \"Boolean\", \"value\": true}'+ ),+ zod+ .object({+ type: zod.enum(['Number']),+ value: zod+ .number()+ .describe(+ 'Numeric value\nSerializes as: {\"type\": \"Number\", \"value\": 42.5}'+ ),+ })+ .describe(+ 'Numeric value\nSerializes as: {\"type\": \"Number\", \"value\": 42.5}'+ ),+ zod+ .object({+ type: zod.enum(['String']),+ value: zod+ .string()+ .describe(+ 'String value\nSerializes as: {\"type\": \"String\", \"value\": \"text\"}'+ ),+ })+ .describe(+ 'String value\nSerializes as: {\"type\": \"String\", \"value\": \"text\"}'+ ),+ zod+ .object({+ type: zod.enum(['Date']),+ value: zod.iso+ .datetime({})+ .describe(+ 'Date\/timestamp value\nSerializes as: {\"type\": \"Date\", \"value\": \"2025-01-01T00:00:00Z\"}'+ ),+ })+ .describe(+ 'Date\/timestamp value\nSerializes as: {\"type\": \"Date\", \"value\": \"2025-01-01T00:00:00Z\"}'+ ),+ zod+ .object({+ type: zod.enum(['SelectOption']),+ value: zod+ .array(zod.uuid())+ .describe(+ 'Select option(s) - always an array (check is_multi_select to determine if single or multi)\nSingle-select: {\"type\": \"SelectOption\", \"value\": [\"uuid\"]} (length 0 or 1)\nMulti-select: {\"type\": \"SelectOption\", \"value\": [\"uuid1\", \"uuid2\", ...]} (length 0+)'+ ),+ })+ .describe(+ 'Select option(s) - always an array (check is_multi_select to determine if single or multi)\nSingle-select: {\"type\": \"SelectOption\", \"value\": [\"uuid\"]} (length 0 or 1)\nMulti-select: {\"type\": \"SelectOption\", \"value\": [\"uuid1\", \"uuid2\", ...]} (length 0+)'+ ),+ zod+ .object({+ type: zod.enum(['EntityReference']),+ value: zod+ .array(+ zod+ .object({+ entity_id: zod.string(),+ entity_type: zod+ .enum([+ 'CHANNEL',+ 'CHAT',+ 'COMPANY',+ 'DOCUMENT',+ 'PROJECT',+ 'TASK',+ 'THREAD',+ 'USER',+ ])+ .describe(+ 'Type of entity that can be referenced by entity properties.'+ ),+ specific_message_id: zod+ .uuid()+ .nullish()+ .describe(+ 'For CHANNEL, CHAT, THREAD entity types - optional specific message ID.\nThis allows referencing a specific message within a thread\/channel\/chat.'+ ),+ })+ .describe(+ 'Entity reference for entity-type property values.'+ )+ )+ .describe(+ 'Entity reference(s) - always an array (check is_multi_select to determine if single or multi)\nSingle-select: {\"type\": \"EntityReference\", \"value\": [{...}]} (length 0 or 1)\nMulti-select: {\"type\": \"EntityReference\", \"value\": [{...}, {...}, ...]} (length 0+)'+ ),+ })+ .describe(+ 'Entity reference(s) - always an array (check is_multi_select to determine if single or multi)\nSingle-select: {\"type\": \"EntityReference\", \"value\": [{...}]} (length 0 or 1)\nMulti-select: {\"type\": \"EntityReference\", \"value\": [{...}, {...}, ...]} (length 0+)'+ ),+ zod+ .object({+ type: zod.enum(['Link']),+ value: zod+ .array(zod.string())+ .describe(+ 'Link value(s) - always an array (check is_multi_select to determine if single or multi)\nSingle-select: {\"type\": \"Link\", \"value\": [\"https:\/\/example.com\"]} (length 0 or 1)\nMulti-select: {\"type\": \"Link\", \"value\": [\"https:\/\/example.com\", \"https:\/\/other.com\"]} (length 0+)'+ ),+ })+ .describe(+ 'Link value(s) - always an array (check is_multi_select to determine if single or multi)\nSingle-select: {\"type\": \"Link\", \"value\": [\"https:\/\/example.com\"]} (length 0 or 1)\nMulti-select: {\"type\": \"Link\", \"value\": [\"https:\/\/example.com\", \"https:\/\/other.com\"]} (length 0+)'+ ),+ ])+ .describe(+ 'Property value (service representation).\n\nRepresents the actual value stored for an entity property.\nThis is serialized to\/from JSONB in the database.'+ ),+ ])+ .optional(),+ })+ .describe(+ 'A property attached to a Soup item.\n\nThis is a simplified representation that includes only the definition and value,\nomitting the entity property assignment metadata and options.'+ )+ )+ .describe('Properties'),+ sha: zod+ .string()+ .nullish()+ .describe(+ 'If the document is a PDF, this is the SHA of the pdf\nIf the document is a DOCX, this will not be present'+ ),+ subType: zod+ .union([+ zod.null(),+ zod+ .union([+ zod+ .object({+ is_completed: zod+ .boolean()+ .describe(+ 'Whether the task is completed.\nTrue if the Status property is set to \"Completed\".'+ ),+ type: zod.enum(['task']),+ })+ .describe(+ 'A task document with its associated properties'+ ),+ zod+ .object({+ type: zod.enum(['snippet']),+ })+ .describe('A snippet document — reusable markdown'),+ ])+ .describe(+ 'Sub type of a document with associated properties encoded in each variant.\nThis ensures type-safety: task properties only exist when the document is a task.'+ ),+ ])+ .optional(),+ updatedAt: zod.iso+ .datetime({})+ .describe(+ 'The time the document instance \/ document BOM was updated'+ ),+ viewedAt: zod.iso+ .datetime({})+ .nullish()+ .describe('The time the document was last viewed'),+ })+ .describe('A document as displayed in Soup.'),+ tag: zod.enum(['document']),+ })+ .describe('Document item.'),+ zod+ .object({+ data: zod+ .object({+ createdAt: zod.iso+ .datetime({})+ .describe('The time the chat was created'),+ deletedAt: zod.iso+ .datetime({})+ .nullish()+ .describe('The time the chat was deleted'),+ id: zod.uuid().describe('The chat uuid'),+ isPersistent: zod+ .boolean()+ .describe('Whether the chat is persistent or not'),+ name: zod.string().describe('The name of the chat'),+ ownerId: zod.string().describe('Who the chat belongs to'),+ projectId: zod+ .uuid()+ .nullish()+ .describe('The project id of the chat'),+ properties: zod+ .array(+ zod+ .object({+ definition: zod+ .object({+ created_at: zod.iso.datetime({}),+ data_type: zod+ .enum([+ 'BOOLEAN',+ 'DATE',+ 'NUMBER',+ 'STRING',+ 'SELECT_NUMBER',+ 'SELECT_STRING',+ 'ENTITY',+ 'LINK',+ ])+ .describe(+ 'Data type for property values, determining storage and validation.'+ ),+ display_name: zod.string(),+ id: zod.uuid(),+ is_metadata: zod+ .boolean()+ .describe(+ 'Flag to indicate if this is a system-generated metadata property.\nNot stored in database - computed at service layer.'+ ),+ is_multi_select: zod.boolean(),+ is_system: zod+ .boolean()+ .describe(+ 'Flag to indicate if this is a system property (stored in DB).'+ ),+ owner: zod+ .union([+ zod+ .object({+ scope: zod.enum(['user']),+ user_id: zod.string(),+ })+ .describe('User-scoped property only'),+ zod+ .object({+ organization_id: zod.number(),+ scope: zod.enum(['organization']),+ })+ .describe(+ 'Organization-scoped property only'+ ),+ zod+ .object({+ organization_id: zod.number(),+ scope: zod.enum([+ 'user_and_organization',+ ]),+ user_id: zod.string(),+ })+ .describe(+ 'Both user and organization-scoped'+ ),+ zod+ .object({+ scope: zod.enum(['system']),+ })+ .describe(+ 'System-owned property (no user or org owner)'+ ),+ ])+ .describe(+ 'Defines who owns a property - user-scoped, org-scoped, system, or both user and org.'+ ),+ specific_entity_type: zod+ .union([+ zod.null(),+ zod+ .enum([+ 'CHANNEL',+ 'CHAT',+ 'COMPANY',+ 'DOCUMENT',+ 'PROJECT',+ 'TASK',+ 'THREAD',+ 'USER',+ ])+ .describe(+ 'Type of entity that can be referenced by entity properties.'+ ),+ ])+ .optional(),+ updated_at: zod.iso.datetime({}),+ })+ .describe(+ 'Property definition model (service representation).'+ ),+ value: zod+ .union([+ zod.null(),+ zod+ .union([+ zod+ .object({+ type: zod.enum(['Boolean']),+ value: zod+ .boolean()+ .describe(+ 'Boolean value\nSerializes as: {\"type\": \"Boolean\", \"value\": true}'+ ),+ })+ .describe(+ 'Boolean value\nSerializes as: {\"type\": \"Boolean\", \"value\": true}'+ ),+ zod+ .object({+ type: zod.enum(['Number']),+ value: zod+ .number()+ .describe(+ 'Numeric value\nSerializes as: {\"type\": \"Number\", \"value\": 42.5}'+ ),+ })+ .describe(+ 'Numeric value\nSerializes as: {\"type\": \"Number\", \"value\": 42.5}'+ ),+ zod+ .object({+ type: zod.enum(['String']),+ value: zod+ .string()+ .describe(+ 'String value\nSerializes as: {\"type\": \"String\", \"value\": \"text\"}'+ ),+ })+ .describe(+ 'String value\nSerializes as: {\"type\": \"String\", \"value\": \"text\"}'+ ),+ zod+ .object({+ type: zod.enum(['Date']),+ value: zod.iso+ .datetime({})+ .describe(+ 'Date\/timestamp value\nSerializes as: {\"type\": \"Date\", \"value\": \"2025-01-01T00:00:00Z\"}'+ ),+ })+ .describe(+ 'Date\/timestamp value\nSerializes as: {\"type\": \"Date\", \"value\": \"2025-01-01T00:00:00Z\"}'+ ),+ zod+ .object({+ type: zod.enum(['SelectOption']),+ value: zod+ .array(zod.uuid())+ .describe(+ 'Select option(s) - always an array (check is_multi_select to determine if single or multi)\nSingle-select: {\"type\": \"SelectOption\", \"value\": [\"uuid\"]} (length 0 or 1)\nMulti-select: {\"type\": \"SelectOption\", \"value\": [\"uuid1\", \"uuid2\", ...]} (length 0+)'+ ),+ })+ .describe(+ 'Select option(s) - always an array (check is_multi_select to determine if single or multi)\nSingle-select: {\"type\": \"SelectOption\", \"value\": [\"uuid\"]} (length 0 or 1)\nMulti-select: {\"type\": \"SelectOption\", \"value\": [\"uuid1\", \"uuid2\", ...]} (length 0+)'+ ),+ zod+ .object({+ type: zod.enum(['EntityReference']),+ value: zod+ .array(+ zod+ .object({+ entity_id: zod.string(),+ entity_type: zod+ .enum([+ 'CHANNEL',+ 'CHAT',+ 'COMPANY',+ 'DOCUMENT',+ 'PROJECT',+ 'TASK',+ 'THREAD',+ 'USER',+ ])+ .describe(+ 'Type of entity that can be referenced by entity properties.'+ ),+ specific_message_id: zod+ .uuid()+ .nullish()+ .describe(+ 'For CHANNEL, CHAT, THREAD entity types - optional specific message ID.\nThis allows referencing a specific message within a thread\/channel\/chat.'+ ),+ })+ .describe(+ 'Entity reference for entity-type property values.'+ )+ )+ .describe(+ 'Entity reference(s) - always an array (check is_multi_select to determine if single or multi)\nSingle-select: {\"type\": \"EntityReference\", \"value\": [{...}]} (length 0 or 1)\nMulti-select: {\"type\": \"EntityReference\", \"value\": [{...}, {...}, ...]} (length 0+)'+ ),+ })+ .describe(+ 'Entity reference(s) - always an array (check is_multi_select to determine if single or multi)\nSingle-select: {\"type\": \"EntityReference\", \"value\": [{...}]} (length 0 or 1)\nMulti-select: {\"type\": \"EntityReference\", \"value\": [{...}, {...}, ...]} (length 0+)'+ ),+ zod+ .object({+ type: zod.enum(['Link']),+ value: zod+ .array(zod.string())+ .describe(+ 'Link value(s) - always an array (check is_multi_select to determine if single or multi)\nSingle-select: {\"type\": \"Link\", \"value\": [\"https:\/\/example.com\"]} (length 0 or 1)\nMulti-select: {\"type\": \"Link\", \"value\": [\"https:\/\/example.com\", \"https:\/\/other.com\"]} (length 0+)'+ ),+ })+ .describe(+ 'Link value(s) - always an array (check is_multi_select to determine if single or multi)\nSingle-select: {\"type\": \"Link\", \"value\": [\"https:\/\/example.com\"]} (length 0 or 1)\nMulti-select: {\"type\": \"Link\", \"value\": [\"https:\/\/example.com\", \"https:\/\/other.com\"]} (length 0+)'+ ),+ ])+ .describe(+ 'Property value (service representation).\n\nRepresents the actual value stored for an entity property.\nThis is serialized to\/from JSONB in the database.'+ ),+ ])+ .optional(),+ })+ .describe(+ 'A property attached to a Soup item.\n\nThis is a simplified representation that includes only the definition and value,\nomitting the entity property assignment metadata and options.'+ )+ )+ .describe('Properties'),+ updatedAt: zod.iso+ .datetime({})+ .describe('The time the chat was last updated'),+ viewedAt: zod.iso+ .datetime({})+ .nullish()+ .describe('The time the chat was last viewed'),+ })+ .describe('A chat as displayed in Soup.'),+ tag: zod.enum(['chat']),+ })+ .describe('Chat item.'),+ zod+ .object({+ data: zod+ .object({+ createdAt: zod.iso+ .datetime({})+ .describe('The time the project was created'),+ deletedAt: zod.iso+ .datetime({})+ .nullish()+ .describe('The time the project was deleted'),+ id: zod.uuid().describe('The id of the project'),+ name: zod.string().describe('The name of the project'),+ ownerId: zod+ .string()+ .describe('The user id of who created the project'),+ parentId: zod+ .uuid()+ .nullish()+ .describe('The parent project id'),+ properties: zod+ .array(+ zod+ .object({+ definition: zod+ .object({+ created_at: zod.iso.datetime({}),+ data_type: zod+ .enum([+ 'BOOLEAN',+ 'DATE',+ 'NUMBER',+ 'STRING',+ 'SELECT_NUMBER',+ 'SELECT_STRING',+ 'ENTITY',+ 'LINK',+ ])+ .describe(+ 'Data type for property values, determining storage and validation.'+ ),+ display_name: zod.string(),+ id: zod.uuid(),+ is_metadata: zod+ .boolean()+ .describe(+ 'Flag to indicate if this is a system-generated metadata property.\nNot stored in database - computed at service layer.'+ ),+ is_multi_select: zod.boolean(),+ is_system: zod+ .boolean()+ .describe(+ 'Flag to indicate if this is a system property (stored in DB).'+ ),+ owner: zod+ .union([+ zod+ .object({+ scope: zod.enum(['user']),+ user_id: zod.string(),+ })+ .describe('User-scoped property only'),+ zod+ .object({+ organization_id: zod.number(),+ scope: zod.enum(['organization']),+ })+ .describe(+ 'Organization-scoped property only'+ ),+ zod+ .object({+ organization_id: zod.number(),+ scope: zod.enum([+ 'user_and_organization',+ ]),+ user_id: zod.string(),+ })+ .describe(+ 'Both user and organization-scoped'+ ),+ zod+ .object({+ scope: zod.enum(['system']),+ })+ .describe(+ 'System-owned property (no user or org owner)'+ ),+ ])+ .describe(+ 'Defines who owns a property - user-scoped, org-scoped, system, or both user and org.'+ ),+ specific_entity_type: zod+ .union([+ zod.null(),+ zod+ .enum([+ 'CHANNEL',+ 'CHAT',+ 'COMPANY',+ 'DOCUMENT',+ 'PROJECT',+ 'TASK',+ 'THREAD',+ 'USER',+ ])+ .describe(+ 'Type of entity that can be referenced by entity properties.'+ ),+ ])+ .optional(),+ updated_at: zod.iso.datetime({}),+ })+ .describe(+ 'Property definition model (service representation).'+ ),+ value: zod+ .union([+ zod.null(),+ zod+ .union([+ zod+ .object({+ type: zod.enum(['Boolean']),+ value: zod+ .boolean()+ .describe(+ 'Boolean value\nSerializes as: {\"type\": \"Boolean\", \"value\": true}'+ ),+ })+ .describe(+ 'Boolean value\nSerializes as: {\"type\": \"Boolean\", \"value\": true}'+ ),+ zod+ .object({+ type: zod.enum(['Number']),+ value: zod+ .number()+ .describe(+ 'Numeric value\nSerializes as: {\"type\": \"Number\", \"value\": 42.5}'+ ),+ })+ .describe(+ 'Numeric value\nSerializes as: {\"type\": \"Number\", \"value\": 42.5}'+ ),+ zod+ .object({+ type: zod.enum(['String']),+ value: zod+ .string()+ .describe(+ 'String value\nSerializes as: {\"type\": \"String\", \"value\": \"text\"}'+ ),+ })+ .describe(+ 'String value\nSerializes as: {\"type\": \"String\", \"value\": \"text\"}'+ ),+ zod+ .object({+ type: zod.enum(['Date']),+ value: zod.iso+ .datetime({})+ .describe(+ 'Date\/timestamp value\nSerializes as: {\"type\": \"Date\", \"value\": \"2025-01-01T00:00:00Z\"}'+ ),+ })+ .describe(+ 'Date\/timestamp value\nSerializes as: {\"type\": \"Date\", \"value\": \"2025-01-01T00:00:00Z\"}'+ ),+ zod+ .object({+ type: zod.enum(['SelectOption']),+ value: zod+ .array(zod.uuid())+ .describe(+ 'Select option(s) - always an array (check is_multi_select to determine if single or multi)\nSingle-select: {\"type\": \"SelectOption\", \"value\": [\"uuid\"]} (length 0 or 1)\nMulti-select: {\"type\": \"SelectOption\", \"value\": [\"uuid1\", \"uuid2\", ...]} (length 0+)'+ ),+ })+ .describe(+ 'Select option(s) - always an array (check is_multi_select to determine if single or multi)\nSingle-select: {\"type\": \"SelectOption\", \"value\": [\"uuid\"]} (length 0 or 1)\nMulti-select: {\"type\": \"SelectOption\", \"value\": [\"uuid1\", \"uuid2\", ...]} (length 0+)'+ ),+ zod+ .object({+ type: zod.enum(['EntityReference']),+ value: zod+ .array(+ zod+ .object({+ entity_id: zod.string(),+ entity_type: zod+ .enum([+ 'CHANNEL',+ 'CHAT',+ 'COMPANY',+ 'DOCUMENT',+ 'PROJECT',+ 'TASK',+ 'THREAD',+ 'USER',+ ])+ .describe(+ 'Type of entity that can be referenced by entity properties.'+ ),+ specific_message_id: zod+ .uuid()+ .nullish()+ .describe(+ 'For CHANNEL, CHAT, THREAD entity types - optional specific message ID.\nThis allows referencing a specific message within a thread\/channel\/chat.'+ ),+ })+ .describe(+ 'Entity reference for entity-type property values.'+ )+ )+ .describe(+ 'Entity reference(s) - always an array (check is_multi_select to determine if single or multi)\nSingle-select: {\"type\": \"EntityReference\", \"value\": [{...}]} (length 0 or 1)\nMulti-select: {\"type\": \"EntityReference\", \"value\": [{...}, {...}, ...]} (length 0+)'+ ),+ })+ .describe(+ 'Entity reference(s) - always an array (check is_multi_select to determine if single or multi)\nSingle-select: {\"type\": \"EntityReference\", \"value\": [{...}]} (length 0 or 1)\nMulti-select: {\"type\": \"EntityReference\", \"value\": [{...}, {...}, ...]} (length 0+)'+ ),+ zod+ .object({+ type: zod.enum(['Link']),+ value: zod+ .array(zod.string())+ .describe(+ 'Link value(s) - always an array (check is_multi_select to determine if single or multi)\nSingle-select: {\"type\": \"Link\", \"value\": [\"https:\/\/example.com\"]} (length 0 or 1)\nMulti-select: {\"type\": \"Link\", \"value\": [\"https:\/\/example.com\", \"https:\/\/other.com\"]} (length 0+)'+ ),+ })+ .describe(+ 'Link value(s) - always an array (check is_multi_select to determine if single or multi)\nSingle-select: {\"type\": \"Link\", \"value\": [\"https:\/\/example.com\"]} (length 0 or 1)\nMulti-select: {\"type\": \"Link\", \"value\": [\"https:\/\/example.com\", \"https:\/\/other.com\"]} (length 0+)'+ ),+ ])+ .describe(+ 'Property value (service representation).\n\nRepresents the actual value stored for an entity property.\nThis is serialized to\/from JSONB in the database.'+ ),+ ])+ .optional(),+ })+ .describe(+ 'A property attached to a Soup item.\n\nThis is a simplified representation that includes only the definition and value,\nomitting the entity property assignment metadata and options.'+ )+ )+ .describe('Properties'),+ updatedAt: zod.iso+ .datetime({})+ .describe('The time the project was updated'),+ viewedAt: zod.iso+ .datetime({})+ .nullish()+ .describe('The time the document was last viewed'),+ })+ .describe('A project as displayed in Soup.'),+ tag: zod.enum(['project']),+ })+ .describe('Project item.'),+ zod+ .object({+ data: zod+ .object({+ createdAt: zod.iso+ .datetime({})+ .describe('Timestamp when the thread was created.'),+ id: zod.uuid().describe('Thread id.'),+ inboxVisible: zod+ .boolean()+ .describe('Whether the thread should appear in the inbox.'),+ isDraft: zod+ .boolean()+ .describe('Whether the thread contains a draft.'),+ isImportant: zod+ .boolean()+ .describe('Whether the thread is marked important.'),+ isRead: zod+ .boolean()+ .describe('Whether the thread has been read.'),+ name: zod+ .string()+ .nullish()+ .describe('Thread display name or subject.'),+ ownerId: zod.string().describe('Owner user id.'),+ projectId: zod+ .string()+ .nullish()+ .describe('Project id associated with the thread.'),+ providerId: zod+ .string()+ .nullish()+ .describe('Provider-specific thread id.'),+ senderEmail: zod+ .string()+ .nullish()+ .describe('Sender email address for the preview.'),+ senderName: zod+ .string()+ .nullish()+ .describe('Sender display name for the preview.'),+ senderPhotoUrl: zod+ .string()+ .nullish()+ .describe('Sender photo URL for the preview.'),+ snippet: zod.string().nullish().describe('Thread snippet.'),+ sortTs: zod.iso+ .datetime({})+ .describe('Timestamp used for email thread sorting.'),+ updatedAt: zod.iso+ .datetime({})+ .describe('Timestamp when the thread was last updated.'),+ viewedAt: zod.iso+ .datetime({})+ .nullish()+ .describe(+ 'Timestamp when the requesting user last viewed the thread.'+ ),+ })+ .describe('Email thread preview data as displayed in Soup.')+ .and(+ zod.object({+ attachments: zod+ .array(zod- .union([- zod- .object({- type: zod.enum(['Boolean']),- value: zod- .boolean()- .describe(- 'Boolean value\nSerializes as: {\"type\": \"Boolean\", \"value\": true}'- ),- })+ .object({+ contentId: zod+ .string()+ .nullish()+ .describe('Content id for inline attachments.'),+ createdAt: zod.iso+ .datetime({}).describe(- 'Boolean value\nSerializes as: {\"type\": \"Boolean\", \"value\": true}'+ 'Timestamp when the attachment was created.'),- zod- .object({- type: zod.enum(['Number']),- value: zod- .number()- .describe(- 'Numeric value\nSerializes as: {\"type\": \"Number\", \"value\": 42.5}'- ),- })+ filename: zod+ .string()+ .nullish()+ .describe('Attachment filename.'),+ id: zod.uuid().describe('Attachment id.'),+ messageId: zod+ .uuid().describe(- 'Numeric value\nSerializes as: {\"type\": \"Number\", \"value\": 42.5}'+ 'Message id that owns this attachment.'),- zod- .object({- type: zod.enum(['String']),- value: zod- .string()- .describe(- 'String value\nSerializes as: {\"type\": \"String\", \"value\": \"text\"}'- ),- })+ mimeType: zod+ .string()+ .nullish()+ .describe('Attachment MIME type.'),+ providerAttachmentId: zod+ .string()+ .nullish()+ .describe('Provider-specific attachment id.'),+ sizeBytes: zod+ .number()+ .nullish()+ .describe('Attachment size in bytes.'),+ })+ .describe('An email attachment as displayed in Soup.')+ )+ .describe('Attachments on the thread.'),+ labels: zod+ .array(+ zod+ .object({+ createdAt: zod.iso+ .datetime({}).describe(- 'String value\nSerializes as: {\"type\": \"String\", \"value\": \"text\"}'+ 'Timestamp when the label was created.'),- zod- .object({- type: zod.enum(['Date']),- value: zod.iso- .datetime({})- .describe(- 'Date\/timestamp value\nSerializes as: {\"type\": \"Date\", \"value\": \"2025-01-01T00:00:00Z\"}'- ),- })+ id: zod.uuid().describe('Label id.'),+ labelListVisibility: zod+ .enum([+ 'labelShow',+ 'labelShowIfUnread',+ 'labelHide',+ ])+ .describe('Gmail-style label list visibility.'),+ linkId: zod+ .uuid().describe(- 'Date\/timestamp value\nSerializes as: {\"type\": \"Date\", \"value\": \"2025-01-01T00:00:00Z\"}'+ 'Connected account link id for the label.'),- zod- .object({- type: zod.enum(['SelectOption']),- value: zod- .array(zod.uuid())- .describe(- 'Select option(s) - always an array (check is_multi_select to determine if single or multi)\nSingle-select: {\"type\": \"SelectOption\", \"value\": [\"uuid\"]} (length 0 or 1)\nMulti-select: {\"type\": \"SelectOption\", \"value\": [\"uuid1\", \"uuid2\", ...]} (length 0+)'- ),- })+ messageListVisibility: zod+ .enum(['show', 'hide']).describe(- 'Select option(s) - always an array (check is_multi_select to determine if single or multi)\nSingle-select: {\"type\": \"SelectOption\", \"value\": [\"uuid\"]} (length 0 or 1)\nMulti-select: {\"type\": \"SelectOption\", \"value\": [\"uuid1\", \"uuid2\", ...]} (length 0+)'+ 'Gmail-style message list visibility for a label.'),- zod- .object({- type: zod.enum(['EntityReference']),- value: zod- .array(- zod- .object({- entity_id: zod.string(),- entity_type: zod- .enum([- 'CHANNEL',- 'CHAT',- 'COMPANY',- 'DOCUMENT',- 'PROJECT',- 'TASK',- 'THREAD',- 'USER',- ])- .describe(- 'Type of entity that can be referenced by entity properties.'- ),- specific_message_id: zod- .uuid()- .nullish()- .describe(- 'For CHANNEL, CHAT, THREAD entity types - optional specific message ID.\nThis allows referencing a specific message within a thread\/channel\/chat.'- ),- })- .describe(- 'Entity reference for entity-type property values.'- )- )- .describe(- 'Entity reference(s) - always an array (check is_multi_select to determine if single or multi)\nSingle-select: {\"type\": \"EntityReference\", \"value\": [{...}]} (length 0 or 1)\nMulti-select: {\"type\": \"EntityReference\", \"value\": [{...}, {...}, ...]} (length 0+)'- ),- })+ name: zod.string().describe('Label display name.'),+ providerLabelId: zod+ .string()+ .describe('Provider-specific label id.'),+ type: zod+ .enum(['system', 'user']).describe(- 'Entity reference(s) - always an array (check is_multi_select to determine if single or multi)\nSingle-select: {\"type\": \"EntityReference\", \"value\": [{...}]} (length 0 or 1)\nMulti-select: {\"type\": \"EntityReference\", \"value\": [{...}, {...}, ...]} (length 0+)'+ 'Whether an email label is provider-created or user-created.'),- zod- .object({- type: zod.enum(['Link']),- value: zod- .array(zod.string())- .describe(- 'Link value(s) - always an array (check is_multi_select to determine if single or multi)\nSingle-select: {\"type\": \"Link\", \"value\": [\"https:\/\/example.com\"]} (length 0 or 1)\nMulti-select: {\"type\": \"Link\", \"value\": [\"https:\/\/example.com\", \"https:\/\/other.com\"]} (length 0+)'- ),- })+ })+ .describe('An email label as displayed in Soup.')+ )+ .describe('Labels attached to the thread.'),+ participants: zod+ .array(+ zod+ .object({+ emailAddress: zod+ .string()+ .nullish()+ .describe('Contact email address.'),+ id: zod.uuid().describe('Contact id.'),+ linkId: zod+ .uuid().describe(- 'Link value(s) - always an array (check is_multi_select to determine if single or multi)\nSingle-select: {\"type\": \"Link\", \"value\": [\"https:\/\/example.com\"]} (length 0 or 1)\nMulti-select: {\"type\": \"Link\", \"value\": [\"https:\/\/example.com\", \"https:\/\/other.com\"]} (length 0+)'+ 'Connected account link id for the contact.'),- ])- .describe(- 'Property value (service representation).\n\nRepresents the actual value stored for an entity property.\nThis is serialized to\/from JSONB in the database.'- ),- ])- .optional(),- })- .describe(- 'A property attached to a Soup item.\n\nThis is a simplified representation that includes only the definition and value,\nomitting the entity property assignment metadata and options.'- )- )- .describe('Properties'),- updatedAt: zod.iso- .datetime({})- .describe('The time the chat was last updated'),- viewedAt: zod.iso- .datetime({})- .nullish()- .describe('The time the chat was last viewed'),- }),- tag: zod.enum(['chat']),- }),- zod.object({- data: zod.object({- createdAt: zod.iso- .datetime({})- .describe('The time the project was created'),- deletedAt: zod.iso- .datetime({})- .nullish()- .describe('The time the project was deleted'),- id: zod.uuid().describe('The id of the project'),- name: zod.string().describe('The name of the project'),- ownerId: zod- .string()- .describe('The user id of who created the project'),- parentId: zod.uuid().nullish().describe('The parent project id'),- properties: zod- .array(- zod- .object({- definition: zod- .object({- created_at: zod.iso.datetime({}),- data_type: zod- .enum([- 'BOOLEAN',- 'DATE',- 'NUMBER',- 'STRING',- 'SELECT_NUMBER',- 'SELECT_STRING',- 'ENTITY',- 'LINK',- ])- .describe(- 'Data type for property values, determining storage and validation.'- ),- display_name: zod.string(),- id: zod.uuid(),- is_metadata: zod- .boolean()- .describe(- 'Flag to indicate if this is a system-generated metadata property.\nNot stored in database - computed at service layer.'- ),- is_multi_select: zod.boolean(),- is_system: zod- .boolean()- .describe(- 'Flag to indicate if this is a system property (stored in DB).'- ),- owner: zod- .union([- zod- .object({- scope: zod.enum(['user']),- user_id: zod.string(),- })- .describe('User-scoped property only'),- zod- .object({- organization_id: zod.number(),- scope: zod.enum(['organization']),- })- .describe('Organization-scoped property only'),- zod- .object({- organization_id: zod.number(),- scope: zod.enum(['user_and_organization']),- user_id: zod.string(),- })- .describe('Both user and organization-scoped'),- zod- .object({- scope: zod.enum(['system']),- })+ name: zod+ .string()+ .nullish()+ .describe('Contact display name.'),+ sfsPhotoUrl: zod+ .string()+ .nullish().describe(- 'System-owned property (no user or org owner)'+ 'Contact photo URL from SFS, if available.'),- ])+ }).describe(- 'Defines who owns a property - user-scoped, org-scoped, system, or both user and org.'- ),- specific_entity_type: zod- .union([- zod.null(),- zod- .enum([- 'CHANNEL',- 'CHAT',- 'COMPANY',- 'DOCUMENT',- 'PROJECT',- 'TASK',- 'THREAD',- 'USER',- ])- .describe(- 'Type of entity that can be referenced by entity properties.'- ),- ])- .optional(),- updated_at: zod.iso.datetime({}),- })- .describe(- 'Property definition model (service representation).'- ),- value: zod- .union([- zod.null(),+ 'A contact participating in an email thread as displayed in Soup.'+ )+ )+ .describe('Contacts participating in the thread.'),+ properties: zod+ .array(zod- .union([- zod- .object({- type: zod.enum(['Boolean']),- value: zod- .boolean()- .describe(- 'Boolean value\nSerializes as: {\"type\": \"Boolean\", \"value\": true}'- ),- })- .describe(- 'Boolean value\nSerializes as: {\"type\": \"Boolean\", \"value\": true}'- ),- zod+ .object({+ definition: zod.object({- type: zod.enum(['Number']),- value: zod- .number()+ created_at: zod.iso.datetime({}),+ data_type: zod+ .enum([+ 'BOOLEAN',+ 'DATE',+ 'NUMBER',+ 'STRING',+ 'SELECT_NUMBER',+ 'SELECT_STRING',+ 'ENTITY',+ 'LINK',+ ]).describe(- 'Numeric value\nSerializes as: {\"type\": \"Number\", \"value\": 42.5}'+ 'Data type for property values, determining storage and validation.'),- })- .describe(- 'Numeric value\nSerializes as: {\"type\": \"Number\", \"value\": 42.5}'- ),- zod- .object({- type: zod.enum(['String']),- value: zod- .string()+ display_name: zod.string(),+ id: zod.uuid(),+ is_metadata: zod+ .boolean().describe(- 'String value\nSerializes as: {\"type\": \"String\", \"value\": \"text\"}'+ 'Flag to indicate if this is a system-generated metadata property.\nNot stored in database - computed at service layer.'),- })- .describe(- 'String value\nSerializes as: {\"type\": \"String\", \"value\": \"text\"}'- ),- zod- .object({- type: zod.enum(['Date']),- value: zod.iso- .datetime({})+ is_multi_select: zod.boolean(),+ is_system: zod+ .boolean().describe(- 'Date\/timestamp value\nSerializes as: {\"type\": \"Date\", \"value\": \"2025-01-01T00:00:00Z\"}'+ 'Flag to indicate if this is a system property (stored in DB).'),- })- .describe(- 'Date\/timestamp value\nSerializes as: {\"type\": \"Date\", \"value\": \"2025-01-01T00:00:00Z\"}'- ),- zod- .object({- type: zod.enum(['SelectOption']),- value: zod- .array(zod.uuid())+ owner: zod+ .union([+ zod+ .object({+ scope: zod.enum(['user']),+ user_id: zod.string(),+ })+ .describe('User-scoped property only'),+ zod+ .object({+ organization_id: zod.number(),+ scope: zod.enum(['organization']),+ })+ .describe(+ 'Organization-scoped property only'+ ),+ zod+ .object({+ organization_id: zod.number(),+ scope: zod.enum([+ 'user_and_organization',+ ]),+ user_id: zod.string(),+ })+ .describe(+ 'Both user and organization-scoped'+ ),+ zod+ .object({+ scope: zod.enum(['system']),+ })+ .describe(+ 'System-owned property (no user or org owner)'+ ),+ ]).describe(- 'Select option(s) - always an array (check is_multi_select to determine if single or multi)\nSingle-select: {\"type\": \"SelectOption\", \"value\": [\"uuid\"]} (length 0 or 1)\nMulti-select: {\"type\": \"SelectOption\", \"value\": [\"uuid1\", \"uuid2\", ...]} (length 0+)'+ 'Defines who owns a property - user-scoped, org-scoped, system, or both user and org.'),+ specific_entity_type: zod+ .union([+ zod.null(),+ zod+ .enum([+ 'CHANNEL',+ 'CHAT',+ 'COMPANY',+ 'DOCUMENT',+ 'PROJECT',+ 'TASK',+ 'THREAD',+ 'USER',+ ])+ .describe(+ 'Type of entity that can be referenced by entity properties.'+ ),+ ])+ .optional(),+ updated_at: zod.iso.datetime({}),}).describe(- 'Select option(s) - always an array (check is_multi_select to determine if single or multi)\nSingle-select: {\"type\": \"SelectOption\", \"value\": [\"uuid\"]} (length 0 or 1)\nMulti-select: {\"type\": \"SelectOption\", \"value\": [\"uuid1\", \"uuid2\", ...]} (length 0+)'+ 'Property definition model (service representation).'),- zod- .object({- type: zod.enum(['EntityReference']),- value: zod- .array(+ value: zod+ .union([+ zod.null(),+ zod+ .union([zod.object({- entity_id: zod.string(),- entity_type: zod- .enum([- 'CHANNEL',- 'CHAT',- 'COMPANY',- 'DOCUMENT',- 'PROJECT',- 'TASK',- 'THREAD',- 'USER',- ])+ type: zod.enum(['Boolean']),+ value: zod+ .boolean().describe(- 'Type of entity that can be referenced by entity properties.'+ 'Boolean value\nSerializes as: {\"type\": \"Boolean\", \"value\": true}'+ ),+ })+ .describe(+ 'Boolean value\nSerializes as: {\"type\": \"Boolean\", \"value\": true}'+ ),+ zod+ .object({+ type: zod.enum(['Number']),+ value: zod+ .number()+ .describe(+ 'Numeric value\nSerializes as: {\"type\": \"Number\", \"value\": 42.5}'),- specific_message_id: zod- .uuid()- .nullish()+ })+ .describe(+ 'Numeric value\nSerializes as: {\"type\": \"Number\", \"value\": 42.5}'+ ),+ zod+ .object({+ type: zod.enum(['String']),+ value: zod+ .string().describe(- 'For CHANNEL, CHAT, THREAD entity types - optional specific message ID.\nThis allows referencing a specific message within a thread\/channel\/chat.'+ 'String value\nSerializes as: {\"type\": \"String\", \"value\": \"text\"}'),}).describe(- 'Entity reference for entity-type property values.'- )- )- .describe(- 'Entity reference(s) - always an array (check is_multi_select to determine if single or multi)\nSingle-select: {\"type\": \"EntityReference\", \"value\": [{...}]} (length 0 or 1)\nMulti-select: {\"type\": \"EntityReference\", \"value\": [{...}, {...}, ...]} (length 0+)'- ),- })- .describe(- 'Entity reference(s) - always an array (check is_multi_select to determine if single or multi)\nSingle-select: {\"type\": \"EntityReference\", \"value\": [{...}]} (length 0 or 1)\nMulti-select: {\"type\": \"EntityReference\", \"value\": [{...}, {...}, ...]} (length 0+)'- ),- zod- .object({- type: zod.enum(['Link']),- value: zod- .array(zod.string())+ 'String value\nSerializes as: {\"type\": \"String\", \"value\": \"text\"}'+ ),+ zod+ .object({+ type: zod.enum(['Date']),+ value: zod.iso+ .datetime({})+ .describe(+ 'Date\/timestamp value\nSerializes as: {\"type\": \"Date\", \"value\": \"2025-01-01T00:00:00Z\"}'+ ),+ })+ .describe(+ 'Date\/timestamp value\nSerializes as: {\"type\": \"Date\", \"value\": \"2025-01-01T00:00:00Z\"}'+ ),+ zod+ .object({+ type: zod.enum(['SelectOption']),+ value: zod+ .array(zod.uuid())+ .describe(+ 'Select option(s) - always an array (check is_multi_select to determine if single or multi)\nSingle-select: {\"type\": \"SelectOption\", \"value\": [\"uuid\"]} (length 0 or 1)\nMulti-select: {\"type\": \"SelectOption\", \"value\": [\"uuid1\", \"uuid2\", ...]} (length 0+)'+ ),+ })+ .describe(+ 'Select option(s) - always an array (check is_multi_select to determine if single or multi)\nSingle-select: {\"type\": \"SelectOption\", \"value\": [\"uuid\"]} (length 0 or 1)\nMulti-select: {\"type\": \"SelectOption\", \"value\": [\"uuid1\", \"uuid2\", ...]} (length 0+)'+ ),+ zod+ .object({+ type: zod.enum(['EntityReference']),+ value: zod+ .array(+ zod+ .object({+ entity_id: zod.string(),+ entity_type: zod+ .enum([+ 'CHANNEL',+ 'CHAT',+ 'COMPANY',+ 'DOCUMENT',+ 'PROJECT',+ 'TASK',+ 'THREAD',+ 'USER',+ ])+ .describe(+ 'Type of entity that can be referenced by entity properties.'+ ),+ specific_message_id: zod+ .uuid()+ .nullish()+ .describe(+ 'For CHANNEL, CHAT, THREAD entity types - optional specific message ID.\nThis allows referencing a specific message within a thread\/channel\/chat.'+ ),+ })+ .describe(+ 'Entity reference for entity-type property values.'+ )+ )+ .describe(+ 'Entity reference(s) - always an array (check is_multi_select to determine if single or multi)\nSingle-select: {\"type\": \"EntityReference\", \"value\": [{...}]} (length 0 or 1)\nMulti-select: {\"type\": \"EntityReference\", \"value\": [{...}, {...}, ...]} (length 0+)'+ ),+ })+ .describe(+ 'Entity reference(s) - always an array (check is_multi_select to determine if single or multi)\nSingle-select: {\"type\": \"EntityReference\", \"value\": [{...}]} (length 0 or 1)\nMulti-select: {\"type\": \"EntityReference\", \"value\": [{...}, {...}, ...]} (length 0+)'+ ),+ zod+ .object({+ type: zod.enum(['Link']),+ value: zod+ .array(zod.string())+ .describe(+ 'Link value(s) - always an array (check is_multi_select to determine if single or multi)\nSingle-select: {\"type\": \"Link\", \"value\": [\"https:\/\/example.com\"]} (length 0 or 1)\nMulti-select: {\"type\": \"Link\", \"value\": [\"https:\/\/example.com\", \"https:\/\/other.com\"]} (length 0+)'+ ),+ })+ .describe(+ 'Link value(s) - always an array (check is_multi_select to determine if single or multi)\nSingle-select: {\"type\": \"Link\", \"value\": [\"https:\/\/example.com\"]} (length 0 or 1)\nMulti-select: {\"type\": \"Link\", \"value\": [\"https:\/\/example.com\", \"https:\/\/other.com\"]} (length 0+)'+ ),+ ]).describe(- 'Link value(s) - always an array (check is_multi_select to determine if single or multi)\nSingle-select: {\"type\": \"Link\", \"value\": [\"https:\/\/example.com\"]} (length 0 or 1)\nMulti-select: {\"type\": \"Link\", \"value\": [\"https:\/\/example.com\", \"https:\/\/other.com\"]} (length 0+)'+ 'Property value (service representation).\n\nRepresents the actual value stored for an entity property.\nThis is serialized to\/from JSONB in the database.'),- })- .describe(- 'Link value(s) - always an array (check is_multi_select to determine if single or multi)\nSingle-select: {\"type\": \"Link\", \"value\": [\"https:\/\/example.com\"]} (length 0 or 1)\nMulti-select: {\"type\": \"Link\", \"value\": [\"https:\/\/example.com\", \"https:\/\/other.com\"]} (length 0+)'- ),- ])+ ])+ .optional(),+ }).describe(- 'Property value (service representation).\n\nRepresents the actual value stored for an entity property.\nThis is serialized to\/from JSONB in the database.'- ),- ])- .optional(),- })- .describe(- 'A property attached to a Soup item.\n\nThis is a simplified representation that includes only the definition and value,\nomitting the entity property assignment metadata and options.'- )- )- .describe('Properties'),- updatedAt: zod.iso- .datetime({})- .describe('The time the project was updated'),- viewedAt: zod.iso- .datetime({})- .nullish()- .describe('The time the document was last viewed'),- }),- tag: zod.enum(['project']),- }),- zod.object({- data: zod- .object({- createdAt: zod.iso.datetime({}),- id: zod.uuid(),- inboxVisible: zod.boolean(),- isDraft: zod.boolean(),- isImportant: zod.boolean(),- isRead: zod.boolean(),- name: zod.string().nullish(),- ownerId: zod.string(),- projectId: zod.string().nullish(),- providerId: zod.string().nullish(),- senderEmail: zod.string().nullish(),- senderName: zod.string().nullish(),- senderPhotoUrl: zod.string().nullish(),- snippet: zod.string().nullish(),- sortTs: zod.iso.datetime({}),- updatedAt: zod.iso.datetime({}),- viewedAt: zod.iso.datetime({}).nullish(),- })- .and(- zod.object({- attachments: zod.array(- zod.object({- contentId: zod.string().nullish(),- createdAt: zod.iso.datetime({}),- filename: zod.string().nullish(),- id: zod.uuid(),- messageId: zod.uuid(),- mimeType: zod.string().nullish(),- providerAttachmentId: zod.string().nullish(),- sizeBytes: zod.number().nullish(),- })- ),- labels: zod.array(- zod.object({- createdAt: zod.iso.datetime({}),- id: zod.uuid(),- labelListVisibility: zod.enum([- 'labelShow',- 'labelShowIfUnread',- 'labelHide',- ]),- linkId: zod.uuid(),- messageListVisibility: zod.enum(['show', 'hide']),- name: zod.string(),- providerLabelId: zod.string(),- type: zod.enum(['system', 'user']),- })- ),- participants: zod.array(- zod.object({- emailAddress: zod.string().nullish(),- id: zod.uuid(),- linkId: zod.uuid(),- name: zod.string().nullish(),- sfsPhotoUrl: zod.string().nullish(),+ 'A property attached to a Soup item.\n\nThis is a simplified representation that includes only the definition and value,\nomitting the entity property assignment metadata and options.'+ )+ )+ .describe('Properties attached to the thread.'),})+ )+ .describe(+ 'Email thread preview enriched with related metadata for Soup.'),- properties: zod.array(- zod+ tag: zod.enum(['emailThread']),+ })+ .describe('Email thread item.'),+ zod+ .object({+ data: zod+ .object({+ channel: zod.object({- definition: zod+ channel_type: zod+ .enum(['public', 'private', 'direct_message', 'team'])+ .describe('Type of channel.'),+ created_at: zod.iso+ .datetime({})+ .describe('Creation timestamp.'),+ id: zod.uuid().describe('Channel id.'),+ name: zod+ .string()+ .nullish()+ .describe('Channel display name.'),+ org_id: zod+ .number()+ .min(+ postItemsSoupAstResponseItemsItemDataChannelOrgIdMin+ )+ .nullish()+ .describe('Organization id.'),+ owner_id: zod.string().describe('Channel owner.'),+ team_id: zod.uuid().nullish().describe('Team id.'),+ updated_at: zod.iso+ .datetime({})+ .describe('Update timestamp.'),+ })+ .describe('Channel metadata in soup payloads.'),+ participants: zod+ .array(+ zod.object({- created_at: zod.iso.datetime({}),- data_type: zod- .enum([- 'BOOLEAN',- 'DATE',- 'NUMBER',- 'STRING',- 'SELECT_NUMBER',- 'SELECT_STRING',- 'ENTITY',- 'LINK',- ])+ channel_id: zod+ .uuid().describe(- 'Data type for property values, determining storage and validation.'+ 'Channel id for the participant membership.'),- display_name: zod.string(),- id: zod.uuid(),- is_metadata: zod- .boolean()+ joined_at: zod.iso+ .datetime({}).describe(- 'Flag to indicate if this is a system-generated metadata property.\nNot stored in database - computed at service layer.'+ 'Timestamp when the participant joined the channel.'),- is_multi_select: zod.boolean(),- is_system: zod- .boolean()+ left_at: zod.iso+ .datetime({})+ .nullish().describe(- 'Flag to indicate if this is a system property (stored in DB).'+ 'Timestamp when the participant left the channel, if any.'),- owner: zod- .union([- zod- .object({- scope: zod.enum(['user']),- user_id: zod.string(),- })- .describe('User-scoped property only'),- zod- .object({- organization_id: zod.number(),- scope: zod.enum(['organization']),- })- .describe('Organization-scoped property only'),- zod- .object({- organization_id: zod.number(),- scope: zod.enum(['user_and_organization']),- user_id: zod.string(),- })- .describe('Both user and organization-scoped'),- zod- .object({- scope: zod.enum(['system']),- })+ role: zod+ .enum(['owner', 'admin', 'member'])+ .describe('The role a user has within a channel.'),+ user_id: zod+ .string()+ .describe('Participant user id.'),+ })+ .describe("A user's membership in a channel.")+ )+ .describe('Participants in the channel.'),+ })+ .describe('Channel metadata together with its participants.')+ .and(+ zod+ .object({+ latest_message: zod+ .union([+ zod.null(),+ zod+ .object({+ content: zod+ .string()+ .describe('Message content.'),+ created_at: zod.iso+ .datetime({})+ .describe('Creation timestamp.'),+ deleted_at: zod.iso+ .datetime({})+ .nullish()+ .describe('Deletion timestamp.'),+ mentions: zod+ .array(zod.string()).describe(- 'System-owned property (no user or org owner)'+ 'Message mentions formatted as `{ENTITY_TYPE}:{ENTITY_ID}`.'),- ])+ message_id: zod.uuid().describe('Message id.'),+ sender_id: zod.string().describe('Sender id.'),+ thread_id: zod+ .uuid()+ .nullish()+ .describe('Thread parent id.'),+ updated_at: zod.iso+ .datetime({})+ .describe('Update timestamp.'),+ }).describe(- 'Defines who owns a property - user-scoped, org-scoped, system, or both user and org.'+ 'Lightweight channel message for soup payloads.'),- specific_entity_type: zod- .union([- zod.null(),- zod- .enum([- 'CHANNEL',- 'CHAT',- 'COMPANY',- 'DOCUMENT',- 'PROJECT',- 'TASK',- 'THREAD',- 'USER',- ])- .describe(- 'Type of entity that can be referenced by entity properties.'- ),- ])- .optional(),- updated_at: zod.iso.datetime({}),- })- .describe(- 'Property definition model (service representation).'- ),- value: zod+ ])+ .optional(),+ latest_non_thread_message: zod.union([zod.null(),zod- .union([- zod- .object({- type: zod.enum(['Boolean']),- value: zod- .boolean()- .describe(- 'Boolean value\nSerializes as: {\"type\": \"Boolean\", \"value\": true}'- ),- })- .describe(- 'Boolean value\nSerializes as: {\"type\": \"Boolean\", \"value\": true}'- ),- zod- .object({- type: zod.enum(['Number']),- value: zod- .number()- .describe(- 'Numeric value\nSerializes as: {\"type\": \"Number\", \"value\": 42.5}'- ),- })- .describe(- 'Numeric value\nSerializes as: {\"type\": \"Number\", \"value\": 42.5}'- ),- zod- .object({- type: zod.enum(['String']),- value: zod- .string()- .describe(- 'String value\nSerializes as: {\"type\": \"String\", \"value\": \"text\"}'- ),- })- .describe(- 'String value\nSerializes as: {\"type\": \"String\", \"value\": \"text\"}'- ),- zod- .object({- type: zod.enum(['Date']),- value: zod.iso- .datetime({})- .describe(- 'Date\/timestamp value\nSerializes as: {\"type\": \"Date\", \"value\": \"2025-01-01T00:00:00Z\"}'- ),- })- .describe(- 'Date\/timestamp value\nSerializes as: {\"type\": \"Date\", \"value\": \"2025-01-01T00:00:00Z\"}'- ),- zod- .object({- type: zod.enum(['SelectOption']),- value: zod- .array(zod.uuid())- .describe(- 'Select option(s) - always an array (check is_multi_select to determine if single or multi)\nSingle-select: {\"type\": \"SelectOption\", \"value\": [\"uuid\"]} (length 0 or 1)\nMulti-select: {\"type\": \"SelectOption\", \"value\": [\"uuid1\", \"uuid2\", ...]} (length 0+)'- ),- })- .describe(- 'Select option(s) - always an array (check is_multi_select to determine if single or multi)\nSingle-select: {\"type\": \"SelectOption\", \"value\": [\"uuid\"]} (length 0 or 1)\nMulti-select: {\"type\": \"SelectOption\", \"value\": [\"uuid1\", \"uuid2\", ...]} (length 0+)'- ),- zod- .object({- type: zod.enum(['EntityReference']),- value: zod- .array(- zod- .object({- entity_id: zod.string(),- entity_type: zod- .enum([- 'CHANNEL',- 'CHAT',- 'COMPANY',- 'DOCUMENT',- 'PROJECT',- 'TASK',- 'THREAD',- 'USER',- ])- .describe(- 'Type of entity that can be referenced by entity properties.'- ),- specific_message_id: zod- .uuid()- .nullish()- .describe(- 'For CHANNEL, CHAT, THREAD entity types - optional specific message ID.\nThis allows referencing a specific message within a thread\/channel\/chat.'- ),- })- .describe(- 'Entity reference for entity-type property values.'- )- )- .describe(- 'Entity reference(s) - always an array (check is_multi_select to determine if single or multi)\nSingle-select: {\"type\": \"EntityReference\", \"value\": [{...}]} (length 0 or 1)\nMulti-select: {\"type\": \"EntityReference\", \"value\": [{...}, {...}, ...]} (length 0+)'- ),- })- .describe(- 'Entity reference(s) - always an array (check is_multi_select to determine if single or multi)\nSingle-select: {\"type\": \"EntityReference\", \"value\": [{...}]} (length 0 or 1)\nMulti-select: {\"type\": \"EntityReference\", \"value\": [{...}, {...}, ...]} (length 0+)'- ),- zod- .object({- type: zod.enum(['Link']),- value: zod- .array(zod.string())- .describe(- 'Link value(s) - always an array (check is_multi_select to determine if single or multi)\nSingle-select: {\"type\": \"Link\", \"value\": [\"https:\/\/example.com\"]} (length 0 or 1)\nMulti-select: {\"type\": \"Link\", \"value\": [\"https:\/\/example.com\", \"https:\/\/other.com\"]} (length 0+)'- ),- })+ .object({+ content: zod+ .string()+ .describe('Message content.'),+ created_at: zod.iso+ .datetime({})+ .describe('Creation timestamp.'),+ deleted_at: zod.iso+ .datetime({})+ .nullish()+ .describe('Deletion timestamp.'),+ mentions: zod+ .array(zod.string()).describe(- 'Link value(s) - always an array (check is_multi_select to determine if single or multi)\nSingle-select: {\"type\": \"Link\", \"value\": [\"https:\/\/example.com\"]} (length 0 or 1)\nMulti-select: {\"type\": \"Link\", \"value\": [\"https:\/\/example.com\", \"https:\/\/other.com\"]} (length 0+)'+ 'Message mentions formatted as `{ENTITY_TYPE}:{ENTITY_ID}`.'),- ])+ message_id: zod.uuid().describe('Message id.'),+ sender_id: zod.string().describe('Sender id.'),+ thread_id: zod+ .uuid()+ .nullish()+ .describe('Thread parent id.'),+ updated_at: zod.iso+ .datetime({})+ .describe('Update timestamp.'),+ }).describe(- 'Property value (service representation).\n\nRepresents the actual value stored for an entity property.\nThis is serialized to\/from JSONB in the database.'+ 'Lightweight channel message for soup payloads.'),]).optional(),})- .describe(- 'A property attached to a Soup item.\n\nThis is a simplified representation that includes only the definition and value,\nomitting the entity property assignment metadata and options.'- )- ),- })- ),- tag: zod.enum(['emailThread']),- }),- zod.object({- data: zod- .object({- channel: zod- .object({- channel_type: zod- .enum(['public', 'private', 'direct_message', 'team'])- .describe('Type of channel.'),- created_at: zod.iso- .datetime({})- .describe('Creation timestamp.'),- id: zod.uuid().describe('Channel id.'),- name: zod- .string()- .nullish()- .describe('Channel display name.'),- org_id: zod- .number()- .min(postItemsSoupAstResponseItemsItemDataChannelOrgIdMin)- .nullish()- .describe('Organization id.'),- owner_id: zod.string().describe('Channel owner.'),- team_id: zod.uuid().nullish().describe('Team id.'),- updated_at: zod.iso- .datetime({})- .describe('Update timestamp.'),- })- .describe('Channel metadata in soup payloads.'),- participants: zod.array(- zod.object({- channel_id: zod.uuid(),- joined_at: zod.iso.datetime({}),- left_at: zod.iso.datetime({}).nullish(),- role: zod- .enum(['owner', 'admin', 'member'])- .describe('The role a user has within a channel.'),- user_id: zod.string(),- })- ),+ .describe('Latest-message bundle for soup payloads.')+ )+ .and(+ zod.object({+ interacted_at: zod.iso+ .datetime({})+ .nullish()+ .describe(+ 'Timestamp when the requesting user last interacted with this channel.'+ ),+ viewed_at: zod.iso+ .datetime({})+ .nullish()+ .describe(+ 'Timestamp when the requesting user last viewed this channel.'+ ),+ })+ )+ .describe('A channel as displayed in Soup.'),+ tag: zod.enum(['channel']),})- .and(- zod+ .describe('Channel item.'),+ zod+ .object({+ data: zod.object({- latest_message: zod- .union([- zod.null(),+ channel_id: zod+ .uuid()+ .describe('Channel that owns the thread.'),+ messages: zod+ .array(zod.object({content: zod.string().describe('Message content.'),@@ -10864,246 +11744,256 @@ export const postItemsSoupAstResponse = zod.object({}).describe('Lightweight channel message for soup payloads.'+ )+ )+ .describe(+ 'Thread replies, using the same lightweight channel message shape.'+ ),+ root_message: zod+ .object({+ content: zod.string().describe('Message content.'),+ created_at: zod.iso+ .datetime({})+ .describe('Creation timestamp.'),+ deleted_at: zod.iso+ .datetime({})+ .nullish()+ .describe('Deletion timestamp.'),+ mentions: zod+ .array(zod.string())+ .describe(+ 'Message mentions formatted as `{ENTITY_TYPE}:{ENTITY_ID}`.'),- ])- .optional(),- latest_non_thread_message: zod- .union([- zod.null(),+ message_id: zod.uuid().describe('Message id.'),+ sender_id: zod.string().describe('Sender id.'),+ thread_id: zod+ .uuid()+ .nullish()+ .describe('Thread parent id.'),+ updated_at: zod.iso+ .datetime({})+ .describe('Update timestamp.'),+ })+ .describe('Lightweight channel message for soup payloads.'),+ })+ .describe(+ 'A top-level channel message thread for soup payloads.\n\nThis reuses the existing lightweight [`ChannelMessage`] shape used by\n[`SoupChannel`] latest-message data.'+ ),+ tag: zod.enum(['channelThread']),+ })+ .describe('Channel thread item.'),+ zod+ .object({+ data: zod+ .object({+ attended: zod+ .boolean()+ .describe(+ 'Whether the requesting user attended this call. Kept for compatibility\nand derived from `status == ATTENDED`.'+ ),+ callId: zod.uuid().describe('The call identifier.'),+ channelId: zod+ .uuid()+ .describe('The channel this call belongs to.'),+ channelName: zod+ .string()+ .nullish()+ .describe('Resolved display name for the channel.'),+ createdBy: zod+ .string()+ .describe('User who created the call.'),+ customName: zod+ .string()+ .nullish()+ .describe(+ 'User-supplied or AI-generated display name for the call.'+ ),+ durationMs: zod+ .number()+ .nullish()+ .describe(+ 'Call duration in milliseconds (None if still active).'+ ),+ endedAt: zod.iso+ .datetime({})+ .nullish()+ .describe('When the call ended (None if still active).'),+ isActive: zod+ .boolean()+ .describe('Whether the call is currently active.'),+ participants: zod+ .array(zod.object({- content: zod.string().describe('Message content.'),- created_at: zod.iso+ joinedAt: zod.iso.datetime({})- .describe('Creation timestamp.'),- deleted_at: zod.iso+ .describe('When the user joined the call.'),+ leftAt: zod.iso.datetime({}).nullish()- .describe('Deletion timestamp.'),- mentions: zod- .array(zod.string()).describe(- 'Message mentions formatted as `{ENTITY_TYPE}:{ENTITY_ID}`.'+ 'When the user left (None if still in an active call).'),- message_id: zod.uuid().describe('Message id.'),- sender_id: zod.string().describe('Sender id.'),- thread_id: zod- .uuid()- .nullish()- .describe('Thread parent id.'),- updated_at: zod.iso- .datetime({})- .describe('Update timestamp.'),+ userId: zod.string().describe('The user id.'),}).describe(- 'Lightweight channel message for soup payloads.'- ),- ])- .optional(),- })- .describe('Latest-message bundle for soup payloads.')- )- .and(- zod.object({- interacted_at: zod.iso.datetime({}).nullish(),- viewed_at: zod.iso.datetime({}).nullish(),- })- ),- tag: zod.enum(['channel']),- }),- zod.object({- data: zod- .object({- attended: zod- .boolean()- .describe(- 'Whether the requesting user attended this call. Kept for compatibility\nand derived from `status == ATTENDED`.'- ),- callId: zod.uuid().describe('The call identifier.'),- channelId: zod- .uuid()- .describe('The channel this call belongs to.'),- channelName: zod- .string()- .nullish()- .describe('Resolved display name for the channel.'),- createdBy: zod.string().describe('User who created the call.'),- customName: zod- .string()- .nullish()- .describe(- 'User-supplied or AI-generated display name for the call.'- ),- durationMs: zod- .number()- .nullish()- .describe(- 'Call duration in milliseconds (None if still active).'- ),- endedAt: zod.iso- .datetime({})- .nullish()- .describe('When the call ended (None if still active).'),- isActive: zod- .boolean()- .describe('Whether the call is currently active.'),- participants: zod- .array(- zod- .object({- joinedAt: zod.iso- .datetime({})- .describe('When the user joined the call.'),- leftAt: zod.iso- .datetime({})- .nullish()- .describe(- 'When the user left (None if still in an active call).'- ),- userId: zod.string().describe('The user id.'),- })- .describe(- 'A participant in a call record, as displayed in Soup.'+ 'A participant in a call record, as displayed in Soup.'+ ))- )- .describe('Participants in the call.'),- startedAt: zod.iso- .datetime({})- .describe('When the call started.'),- status: zod- .enum(['ATTENDED', 'MISSED', 'UNATTENDED'])- .describe(- 'Viewer-relative attendance status for a call record.\nSerializes as `ATTENDED`, `MISSED`, or `UNATTENDED`.'- ),- summary: zod- .string()- .nullish()+ .describe('Participants in the call.'),+ startedAt: zod.iso+ .datetime({})+ .describe('When the call started.'),+ status: zod+ .enum(['ATTENDED', 'MISSED', 'UNATTENDED'])+ .describe(+ 'Viewer-relative attendance status for a call record.\nSerializes as `ATTENDED`, `MISSED`, or `UNATTENDED`.'+ ),+ summary: zod+ .string()+ .nullish()+ .describe(+ 'AI-generated summary of the call. Only set on archived\n`call_records` once summarization has run; active calls always\nreturn `None`.'+ ),+ }).describe(- 'AI-generated summary of the call. Only set on archived\n`call_records` once summarization has run; active calls always\nreturn `None`.'+ 'A call record as displayed in Soup. Excludes room_name, egress_id,\nand transcript — fields that are irrelevant for the soup feed.'),+ tag: zod.enum(['call']),})- .describe(- 'A call record as displayed in Soup. Excludes room_name, egress_id,\nand transcript — fields that are irrelevant for the soup feed.'- ),- tag: zod.enum(['call']),- }),- zod.object({- data: zod+ .describe('Call record item.'),+ zod.object({- createdAt: zod.iso- .datetime({})- .describe('When the company was created.'),- description: zod- .string()- .nullish()- .describe(- "Display description from the primary domain's directory entry."- ),- domains: zod- .array(- zod- .object({- companyId: zod- .uuid()- .describe(- 'The id of the company the domain belongs to.'- ),- createdAt: zod.iso- .datetime({})- .describe('When the domain record was created.'),- domain: zod- .string()- .describe(- 'The domain (lowercased, e.g. \"acme.com\").'- ),- id: zod.uuid().describe('The id of the domain record.'),- })+ data: zod+ .object({+ createdAt: zod.iso+ .datetime({})+ .describe('When the company was created.'),+ description: zod+ .string()+ .nullish().describe(- "A CRM domain as displayed in Soup. Mirrors the crm crate's\n[`CrmDomain`] with a stable wire shape that the FE can rely on."+ "Display description from the primary domain's directory entry."+ ),+ domains: zod+ .array(+ zod+ .object({+ companyId: zod+ .uuid()+ .describe(+ 'The id of the company the domain belongs to.'+ ),+ createdAt: zod.iso+ .datetime({})+ .describe('When the domain record was created.'),+ domain: zod+ .string()+ .describe(+ 'The domain (lowercased, e.g. \"acme.com\").'+ ),+ id: zod+ .uuid()+ .describe('The id of the domain record.'),+ })+ .describe(+ "A CRM domain as displayed in Soup. Mirrors the crm crate's\n[`CrmDomain`] with a stable wire shape that the FE can rely on."+ ))- )- .describe(- 'Domains associated with this company, ordered by creation time\nascending (primary first).'- ),- emailSync: zod- .boolean()- .describe('Whether email sync is enabled for this company.'),- hidden: zod- .boolean()- .describe(- 'Whether the company is hidden from CRM listings. Soup filters\nthese out by default.'- ),- id: zod.uuid().describe('The id of the company.'),- name: zod- .string()- .nullish()- .describe(- "Display name from the primary domain's directory entry, or\n`None` when unresolved."- ),- teamId: zod- .uuid()- .describe('The id of the team that owns this company record.'),- updatedAt: zod.iso- .datetime({})- .describe('When the company was last updated.'),- viewedAt: zod.iso- .datetime({})- .nullish()+ .describe(+ 'Domains associated with this company, ordered by creation time\nascending (primary first).'+ ),+ emailSync: zod+ .boolean()+ .describe(+ 'Whether email sync is enabled for this company.'+ ),+ hidden: zod+ .boolean()+ .describe(+ 'Whether the company is hidden from CRM listings. Soup filters\nthese out by default.'+ ),+ id: zod.uuid().describe('The id of the company.'),+ name: zod+ .string()+ .nullish()+ .describe(+ "Display name from the primary domain's directory entry, or\n`None` when unresolved."+ ),+ teamId: zod+ .uuid()+ .describe(+ 'The id of the team that owns this company record.'+ ),+ updatedAt: zod.iso+ .datetime({})+ .describe('When the company was last updated.'),+ viewedAt: zod.iso+ .datetime({})+ .nullish()+ .describe(+ 'When the requesting user last viewed this company, or `None` if\nnever viewed. Mirrors the `viewed_at` other soup entities carry.'+ ),+ }).describe(- 'When the requesting user last viewed this company, or `None` if\nnever viewed. Mirrors the `viewed_at` other soup entities carry.'+ 'A CRM company as displayed in Soup. Carries the core company\nfields plus display metadata resolved from `crm_domain_directory`\nagainst the primary (earliest-created) domain.'),+ tag: zod.enum(['crmCompany']),})- .describe(- 'A CRM company as displayed in Soup. Carries the core company\nfields plus display metadata resolved from `crm_domain_directory`\nagainst the primary (earliest-created) domain.'- ),- tag: zod.enum(['crmCompany']),- }),- zod.object({- data: zod+ .describe('CRM company item.'),+ zod.object({- createdAt: zod.iso- .datetime({})- .describe('Timestamp when the record was created.'),- foreignEntityId: zod- .string()- .describe('Identifier assigned by the external system.'),- foreignEntitySource: zod- .string()- .describe('Source system that owns the external identifier.'),- id: zod- .uuid()- .describe(- 'Internal primary key for this foreign entity record.'- ),- metadata: zod- .object({})- .describe('Arbitrary metadata stored with the mapping.'),- storedForAuthEntity: zod- .string()- .describe(- 'Internal auth entity namespace this foreign entity is stored for.'- ),- storedForId: zod- .string()- .describe(- 'Internal entity identifier this foreign entity is stored for.'- ),- updatedAt: zod.iso- .datetime({})- .describe('Timestamp when the record was last updated.'),+ data: zod+ .object({+ createdAt: zod.iso+ .datetime({})+ .describe('Timestamp when the record was created.'),+ foreignEntityId: zod+ .string()+ .describe('Identifier assigned by the external system.'),+ foreignEntitySource: zod+ .string()+ .describe(+ 'Source system that owns the external identifier.'+ ),+ id: zod+ .uuid()+ .describe(+ 'Internal primary key for this foreign entity record.'+ ),+ metadata: zod+ .object({})+ .describe('Arbitrary metadata stored with the mapping.'),+ storedForAuthEntity: zod+ .string()+ .describe(+ 'Internal auth entity namespace this foreign entity is stored for.'+ ),+ storedForId: zod+ .string()+ .describe(+ 'Internal entity identifier this foreign entity is stored for.'+ ),+ updatedAt: zod.iso+ .datetime({})+ .describe('Timestamp when the record was last updated.'),+ })+ .describe('A foreign entity record as displayed in Soup.'),+ tag: zod.enum(['foreignEntity']),})- .describe('A foreign entity record as displayed in Soup.'),- tag: zod.enum(['foreignEntity']),- }),- ])- .and(- zod.object({- frecency_score: zod.number(),- })- )- ),- next_cursor: zod.string().nullish(),-});+ .describe('Foreign entity item.'),+ ])+ .describe('A single item in the Soup feed.')+ .and(+ zod.object({+ frecency_score: zod.number(),+ })+ )+ .describe('API representation of a soup item with its frecency score.')+ ),+ next_cursor: zod.string().nullish(),+ })+ .describe('Response page for non-grouped soup endpoints.');/*** @summary Gets the items grouped by the specified field using AST filters.@@ -11179,6 +12069,7 @@ export const postItemsSoupAstGroupedBody = zod'the filters that should be applied based on entity properties'),})+ .describe('Wire-format entity filter AST accepted by soup AST endpoints.').and(zod.object({@@ -11261,7 +12152,8 @@ export const postItemsSoupAstGroupedBody = zodzod.object({mode: zod.enum(['initial']),})- ),+ )+ .describe('Initial grouped soup request.'),zod.object({callf: zod@@ -11323,6 +12215,7 @@ export const postItemsSoupAstGroupedBody = zod'the filters that should be applied based on entity properties'),})+ .describe('Wire-format entity filter AST accepted by soup AST endpoints.').and(zod.object({@@ -11406,7 +12299,8 @@ export const postItemsSoupAstGroupedBody = zodzod.object({mode: zod.enum(['group_page']),})- ),+ )+ .describe('Request for a page within one group.'),]).describe('Request body for grouped soup queries with AST filters.');@@ -11464,2981 +12358,3564 @@ export const postItemsSoupAstGroupedResponse = zodzod.string(),zod.union([- zod.object({- data: zod.object({- branchedFromId: zod- .uuid()- .nullish()- .describe(- 'The id of the document this document branched from'- ),- branchedFromVersionId: zod- .number()- .nullish()- .describe(- 'The id of the version this document branched from\nThis could be either DocumentInstance or DocumentBom id depending on the file type'- ),- createdAt: zod.iso- .datetime({})- .describe('The time the document was created'),- deletedAt: zod.iso- .datetime({})- .nullish()- .describe('The time the document was deleted'),- documentFamilyId: zod- .number()- .nullish()- .describe(- 'The id of the document family this document belongs to'- ),- documentVersionId: zod- .number()- .describe(- 'The version of the document\nThis could be the document_instance_id or document_bom_id depending on the file type'- ),- fileType: zod- .string()- .nullish()- .describe(- 'The file type of the document (e.g. pdf, docx)'- ),- id: zod.uuid().describe('The document id'),- name: zod.string().describe('The name of the document'),- ownerId: zod.string().describe('The owner of the document'),- projectId: zod- .uuid()- .nullish()- .describe(- 'The id of the project that this document belongs to'- ),- properties: zod- .array(- zod- .object({- definition: zod+ zod+ .object({+ data: zod+ .object({+ branchedFromId: zod+ .uuid()+ .nullish()+ .describe(+ 'The id of the document this document branched from'+ ),+ branchedFromVersionId: zod+ .number()+ .nullish()+ .describe(+ 'The id of the version this document branched from\nThis could be either DocumentInstance or DocumentBom id depending on the file type'+ ),+ createdAt: zod.iso+ .datetime({})+ .describe('The time the document was created'),+ deletedAt: zod.iso+ .datetime({})+ .nullish()+ .describe('The time the document was deleted'),+ documentFamilyId: zod+ .number()+ .nullish()+ .describe(+ 'The id of the document family this document belongs to'+ ),+ documentVersionId: zod+ .number()+ .describe(+ 'The version of the document\nThis could be the document_instance_id or document_bom_id depending on the file type'+ ),+ fileType: zod+ .string()+ .nullish()+ .describe(+ 'The file type of the document (e.g. pdf, docx)'+ ),+ id: zod.uuid().describe('The document id'),+ name: zod.string().describe('The name of the document'),+ ownerId: zod+ .string()+ .describe('The owner of the document'),+ projectId: zod+ .uuid()+ .nullish()+ .describe(+ 'The id of the project that this document belongs to'+ ),+ properties: zod+ .array(+ zod.object({- created_at: zod.iso.datetime({}),- data_type: zod- .enum([- 'BOOLEAN',- 'DATE',- 'NUMBER',- 'STRING',- 'SELECT_NUMBER',- 'SELECT_STRING',- 'ENTITY',- 'LINK',- ])- .describe(- 'Data type for property values, determining storage and validation.'- ),- display_name: zod.string(),- id: zod.uuid(),- is_metadata: zod- .boolean()- .describe(- 'Flag to indicate if this is a system-generated metadata property.\nNot stored in database - computed at service layer.'- ),- is_multi_select: zod.boolean(),- is_system: zod- .boolean()- .describe(- 'Flag to indicate if this is a system property (stored in DB).'- ),- owner: zod- .union([- zod- .object({- scope: zod.enum(['user']),- user_id: zod.string(),- })- .describe('User-scoped property only'),- zod- .object({- organization_id: zod.number(),- scope: zod.enum(['organization']),- })+ definition: zod+ .object({+ created_at: zod.iso.datetime({}),+ data_type: zod+ .enum([+ 'BOOLEAN',+ 'DATE',+ 'NUMBER',+ 'STRING',+ 'SELECT_NUMBER',+ 'SELECT_STRING',+ 'ENTITY',+ 'LINK',+ ]).describe(- 'Organization-scoped property only'+ 'Data type for property values, determining storage and validation.'),- zod- .object({- organization_id: zod.number(),- scope: zod.enum([- 'user_and_organization',- ]),- user_id: zod.string(),- })+ display_name: zod.string(),+ id: zod.uuid(),+ is_metadata: zod+ .boolean().describe(- 'Both user and organization-scoped'+ 'Flag to indicate if this is a system-generated metadata property.\nNot stored in database - computed at service layer.'),- zod- .object({- scope: zod.enum(['system']),- })+ is_multi_select: zod.boolean(),+ is_system: zod+ .boolean()+ .describe(+ 'Flag to indicate if this is a system property (stored in DB).'+ ),+ owner: zod+ .union([+ zod+ .object({+ scope: zod.enum(['user']),+ user_id: zod.string(),+ })+ .describe(+ 'User-scoped property only'+ ),+ zod+ .object({+ organization_id: zod.number(),+ scope: zod.enum(['organization']),+ })+ .describe(+ 'Organization-scoped property only'+ ),+ zod+ .object({+ organization_id: zod.number(),+ scope: zod.enum([+ 'user_and_organization',+ ]),+ user_id: zod.string(),+ })+ .describe(+ 'Both user and organization-scoped'+ ),+ zod+ .object({+ scope: zod.enum(['system']),+ })+ .describe(+ 'System-owned property (no user or org owner)'+ ),+ ]).describe(- 'System-owned property (no user or org owner)'+ 'Defines who owns a property - user-scoped, org-scoped, system, or both user and org.'),- ])+ specific_entity_type: zod+ .union([+ zod.null(),+ zod+ .enum([+ 'CHANNEL',+ 'CHAT',+ 'COMPANY',+ 'DOCUMENT',+ 'PROJECT',+ 'TASK',+ 'THREAD',+ 'USER',+ ])+ .describe(+ 'Type of entity that can be referenced by entity properties.'+ ),+ ])+ .optional(),+ updated_at: zod.iso.datetime({}),+ }).describe(- 'Defines who owns a property - user-scoped, org-scoped, system, or both user and org.'+ 'Property definition model (service representation).'),- specific_entity_type: zod+ value: zod.union([zod.null(),zod- .enum([- 'CHANNEL',- 'CHAT',- 'COMPANY',- 'DOCUMENT',- 'PROJECT',- 'TASK',- 'THREAD',- 'USER',- ])- .describe(- 'Type of entity that can be referenced by entity properties.'- ),- ])- .optional(),- updated_at: zod.iso.datetime({}),- })- .describe(- 'Property definition model (service representation).'- ),- value: zod- .union([- zod.null(),- zod- .union([- zod- .object({- type: zod.enum(['Boolean']),- value: zod- .boolean()+ .union([+ zod+ .object({+ type: zod.enum(['Boolean']),+ value: zod+ .boolean()+ .describe(+ 'Boolean value\nSerializes as: {\"type\": \"Boolean\", \"value\": true}'+ ),+ }).describe('Boolean value\nSerializes as: {\"type\": \"Boolean\", \"value\": true}'),- })- .describe(- 'Boolean value\nSerializes as: {\"type\": \"Boolean\", \"value\": true}'- ),- zod- .object({- type: zod.enum(['Number']),- value: zod- .number()+ zod+ .object({+ type: zod.enum(['Number']),+ value: zod+ .number()+ .describe(+ 'Numeric value\nSerializes as: {\"type\": \"Number\", \"value\": 42.5}'+ ),+ }).describe('Numeric value\nSerializes as: {\"type\": \"Number\", \"value\": 42.5}'),- })- .describe(- 'Numeric value\nSerializes as: {\"type\": \"Number\", \"value\": 42.5}'- ),- zod- .object({- type: zod.enum(['String']),- value: zod- .string()+ zod+ .object({+ type: zod.enum(['String']),+ value: zod+ .string()+ .describe(+ 'String value\nSerializes as: {\"type\": \"String\", \"value\": \"text\"}'+ ),+ }).describe('String value\nSerializes as: {\"type\": \"String\", \"value\": \"text\"}'),- })- .describe(- 'String value\nSerializes as: {\"type\": \"String\", \"value\": \"text\"}'- ),- zod- .object({- type: zod.enum(['Date']),- value: zod.iso- .datetime({})+ zod+ .object({+ type: zod.enum(['Date']),+ value: zod.iso+ .datetime({})+ .describe(+ 'Date\/timestamp value\nSerializes as: {\"type\": \"Date\", \"value\": \"2025-01-01T00:00:00Z\"}'+ ),+ }).describe('Date\/timestamp value\nSerializes as: {\"type\": \"Date\", \"value\": \"2025-01-01T00:00:00Z\"}'),- })- .describe(- 'Date\/timestamp value\nSerializes as: {\"type\": \"Date\", \"value\": \"2025-01-01T00:00:00Z\"}'- ),- zod- .object({- type: zod.enum(['SelectOption']),- value: zod- .array(zod.uuid())+ zod+ .object({+ type: zod.enum(['SelectOption']),+ value: zod+ .array(zod.uuid())+ .describe(+ 'Select option(s) - always an array (check is_multi_select to determine if single or multi)\nSingle-select: {\"type\": \"SelectOption\", \"value\": [\"uuid\"]} (length 0 or 1)\nMulti-select: {\"type\": \"SelectOption\", \"value\": [\"uuid1\", \"uuid2\", ...]} (length 0+)'+ ),+ }).describe('Select option(s) - always an array (check is_multi_select to determine if single or multi)\nSingle-select: {\"type\": \"SelectOption\", \"value\": [\"uuid\"]} (length 0 or 1)\nMulti-select: {\"type\": \"SelectOption\", \"value\": [\"uuid1\", \"uuid2\", ...]} (length 0+)'),- })- .describe(- 'Select option(s) - always an array (check is_multi_select to determine if single or multi)\nSingle-select: {\"type\": \"SelectOption\", \"value\": [\"uuid\"]} (length 0 or 1)\nMulti-select: {\"type\": \"SelectOption\", \"value\": [\"uuid1\", \"uuid2\", ...]} (length 0+)'- ),- zod- .object({- type: zod.enum(['EntityReference']),- value: zod- .array(- zod- .object({- entity_id: zod.string(),- entity_type: zod- .enum([- 'CHANNEL',- 'CHAT',- 'COMPANY',- 'DOCUMENT',- 'PROJECT',- 'TASK',- 'THREAD',- 'USER',- ])- .describe(- 'Type of entity that can be referenced by entity properties.'- ),- specific_message_id: zod- .uuid()- .nullish()+ zod+ .object({+ type: zod.enum(['EntityReference']),+ value: zod+ .array(+ zod+ .object({+ entity_id: zod.string(),+ entity_type: zod+ .enum([+ 'CHANNEL',+ 'CHAT',+ 'COMPANY',+ 'DOCUMENT',+ 'PROJECT',+ 'TASK',+ 'THREAD',+ 'USER',+ ])+ .describe(+ 'Type of entity that can be referenced by entity properties.'+ ),+ specific_message_id: zod+ .uuid()+ .nullish()+ .describe(+ 'For CHANNEL, CHAT, THREAD entity types - optional specific message ID.\nThis allows referencing a specific message within a thread\/channel\/chat.'+ ),+ }).describe(- 'For CHANNEL, CHAT, THREAD entity types - optional specific message ID.\nThis allows referencing a specific message within a thread\/channel\/chat.'- ),- })- .describe(- 'Entity reference for entity-type property values.'+ 'Entity reference for entity-type property values.'+ ))- )+ .describe(+ 'Entity reference(s) - always an array (check is_multi_select to determine if single or multi)\nSingle-select: {\"type\": \"EntityReference\", \"value\": [{...}]} (length 0 or 1)\nMulti-select: {\"type\": \"EntityReference\", \"value\": [{...}, {...}, ...]} (length 0+)'+ ),+ }).describe('Entity reference(s) - always an array (check is_multi_select to determine if single or multi)\nSingle-select: {\"type\": \"EntityReference\", \"value\": [{...}]} (length 0 or 1)\nMulti-select: {\"type\": \"EntityReference\", \"value\": [{...}, {...}, ...]} (length 0+)'),- })- .describe(- 'Entity reference(s) - always an array (check is_multi_select to determine if single or multi)\nSingle-select: {\"type\": \"EntityReference\", \"value\": [{...}]} (length 0 or 1)\nMulti-select: {\"type\": \"EntityReference\", \"value\": [{...}, {...}, ...]} (length 0+)'- ),- zod- .object({- type: zod.enum(['Link']),- value: zod- .array(zod.string())+ zod+ .object({+ type: zod.enum(['Link']),+ value: zod+ .array(zod.string())+ .describe(+ 'Link value(s) - always an array (check is_multi_select to determine if single or multi)\nSingle-select: {\"type\": \"Link\", \"value\": [\"https:\/\/example.com\"]} (length 0 or 1)\nMulti-select: {\"type\": \"Link\", \"value\": [\"https:\/\/example.com\", \"https:\/\/other.com\"]} (length 0+)'+ ),+ }).describe('Link value(s) - always an array (check is_multi_select to determine if single or multi)\nSingle-select: {\"type\": \"Link\", \"value\": [\"https:\/\/example.com\"]} (length 0 or 1)\nMulti-select: {\"type\": \"Link\", \"value\": [\"https:\/\/example.com\", \"https:\/\/other.com\"]} (length 0+)'),- })+ ]).describe(- 'Link value(s) - always an array (check is_multi_select to determine if single or multi)\nSingle-select: {\"type\": \"Link\", \"value\": [\"https:\/\/example.com\"]} (length 0 or 1)\nMulti-select: {\"type\": \"Link\", \"value\": [\"https:\/\/example.com\", \"https:\/\/other.com\"]} (length 0+)'+ 'Property value (service representation).\n\nRepresents the actual value stored for an entity property.\nThis is serialized to\/from JSONB in the database.'),])- .describe(- 'Property value (service representation).\n\nRepresents the actual value stored for an entity property.\nThis is serialized to\/from JSONB in the database.'- ),- ])- .optional(),- })- .describe(- 'A property attached to a Soup item.\n\nThis is a simplified representation that includes only the definition and value,\nomitting the entity property assignment metadata and options.'+ .optional(),+ })+ .describe(+ 'A property attached to a Soup item.\n\nThis is a simplified representation that includes only the definition and value,\nomitting the entity property assignment metadata and options.'+ ))- )- .describe('Properties'),- sha: zod- .string()- .nullish()- .describe(- 'If the document is a PDF, this is the SHA of the pdf\nIf the document is a DOCX, this will not be present'- ),- subType: zod- .union([- zod.null(),- zod+ .describe('Properties'),+ sha: zod+ .string()+ .nullish()+ .describe(+ 'If the document is a PDF, this is the SHA of the pdf\nIf the document is a DOCX, this will not be present'+ ),+ subType: zod.union([+ zod.null(),zod- .object({- is_completed: zod- .boolean()+ .union([+ zod+ .object({+ is_completed: zod+ .boolean()+ .describe(+ 'Whether the task is completed.\nTrue if the Status property is set to \"Completed\".'+ ),+ type: zod.enum(['task']),+ }).describe(- 'Whether the task is completed.\nTrue if the Status property is set to \"Completed\".'+ 'A task document with its associated properties'),- type: zod.enum(['task']),- })- .describe(- 'A task document with its associated properties'- ),- zod- .object({- type: zod.enum(['snippet']),- })+ zod+ .object({+ type: zod.enum(['snippet']),+ })+ .describe(+ 'A snippet document — reusable markdown'+ ),+ ]).describe(- 'A snippet document — reusable markdown'+ 'Sub type of a document with associated properties encoded in each variant.\nThis ensures type-safety: task properties only exist when the document is a task.'),])+ .optional(),+ updatedAt: zod.iso+ .datetime({}).describe(- 'Sub type of a document with associated properties encoded in each variant.\nThis ensures type-safety: task properties only exist when the document is a task.'+ 'The time the document instance \/ document BOM was updated'),- ])- .optional(),- updatedAt: zod.iso- .datetime({})- .describe(- 'The time the document instance \/ document BOM was updated'- ),- viewedAt: zod.iso- .datetime({})- .nullish()- .describe('The time the document was last viewed'),- }),- tag: zod.enum(['document']),- }),- zod.object({- data: zod.object({- createdAt: zod.iso- .datetime({})- .describe('The time the chat was created'),- deletedAt: zod.iso- .datetime({})- .nullish()- .describe('The time the chat was deleted'),- id: zod.uuid().describe('The chat uuid'),- isPersistent: zod- .boolean()- .describe('Whether the chat is persistent or not'),- name: zod.string().describe('The name of the chat'),- ownerId: zod.string().describe('Who the chat belongs to'),- projectId: zod- .uuid()- .nullish()- .describe('The project id of the chat'),- properties: zod- .array(- zod- .object({- definition: zod- .object({- created_at: zod.iso.datetime({}),- data_type: zod- .enum([- 'BOOLEAN',- 'DATE',- 'NUMBER',- 'STRING',- 'SELECT_NUMBER',- 'SELECT_STRING',- 'ENTITY',- 'LINK',- ])- .describe(- 'Data type for property values, determining storage and validation.'- ),- display_name: zod.string(),- id: zod.uuid(),- is_metadata: zod- .boolean()- .describe(- 'Flag to indicate if this is a system-generated metadata property.\nNot stored in database - computed at service layer.'- ),- is_multi_select: zod.boolean(),- is_system: zod- .boolean()- .describe(- 'Flag to indicate if this is a system property (stored in DB).'- ),- owner: zod- .union([- zod- .object({- scope: zod.enum(['user']),- user_id: zod.string(),- })- .describe('User-scoped property only'),- zod- .object({- organization_id: zod.number(),- scope: zod.enum(['organization']),- })+ viewedAt: zod.iso+ .datetime({})+ .nullish()+ .describe('The time the document was last viewed'),+ })+ .describe('A document as displayed in Soup.'),+ tag: zod.enum(['document']),+ })+ .describe('Document item.'),+ zod+ .object({+ data: zod+ .object({+ createdAt: zod.iso+ .datetime({})+ .describe('The time the chat was created'),+ deletedAt: zod.iso+ .datetime({})+ .nullish()+ .describe('The time the chat was deleted'),+ id: zod.uuid().describe('The chat uuid'),+ isPersistent: zod+ .boolean()+ .describe('Whether the chat is persistent or not'),+ name: zod.string().describe('The name of the chat'),+ ownerId: zod+ .string()+ .describe('Who the chat belongs to'),+ projectId: zod+ .uuid()+ .nullish()+ .describe('The project id of the chat'),+ properties: zod+ .array(+ zod+ .object({+ definition: zod+ .object({+ created_at: zod.iso.datetime({}),+ data_type: zod+ .enum([+ 'BOOLEAN',+ 'DATE',+ 'NUMBER',+ 'STRING',+ 'SELECT_NUMBER',+ 'SELECT_STRING',+ 'ENTITY',+ 'LINK',+ ]).describe(- 'Organization-scoped property only'+ 'Data type for property values, determining storage and validation.'),- zod- .object({- organization_id: zod.number(),- scope: zod.enum([- 'user_and_organization',- ]),- user_id: zod.string(),- })+ display_name: zod.string(),+ id: zod.uuid(),+ is_metadata: zod+ .boolean().describe(- 'Both user and organization-scoped'+ 'Flag to indicate if this is a system-generated metadata property.\nNot stored in database - computed at service layer.'),- zod- .object({- scope: zod.enum(['system']),- })+ is_multi_select: zod.boolean(),+ is_system: zod+ .boolean().describe(- 'System-owned property (no user or org owner)'+ 'Flag to indicate if this is a system property (stored in DB).'),- ])- .describe(- 'Defines who owns a property - user-scoped, org-scoped, system, or both user and org.'- ),- specific_entity_type: zod- .union([- zod.null(),- zod- .enum([- 'CHANNEL',- 'CHAT',- 'COMPANY',- 'DOCUMENT',- 'PROJECT',- 'TASK',- 'THREAD',- 'USER',+ owner: zod+ .union([+ zod+ .object({+ scope: zod.enum(['user']),+ user_id: zod.string(),+ })+ .describe(+ 'User-scoped property only'+ ),+ zod+ .object({+ organization_id: zod.number(),+ scope: zod.enum(['organization']),+ })+ .describe(+ 'Organization-scoped property only'+ ),+ zod+ .object({+ organization_id: zod.number(),+ scope: zod.enum([+ 'user_and_organization',+ ]),+ user_id: zod.string(),+ })+ .describe(+ 'Both user and organization-scoped'+ ),+ zod+ .object({+ scope: zod.enum(['system']),+ })+ .describe(+ 'System-owned property (no user or org owner)'+ ),]).describe(- 'Type of entity that can be referenced by entity properties.'+ 'Defines who owns a property - user-scoped, org-scoped, system, or both user and org.'),- ])- .optional(),- updated_at: zod.iso.datetime({}),- })- .describe(- 'Property definition model (service representation).'- ),- value: zod- .union([- zod.null(),- zod+ specific_entity_type: zod+ .union([+ zod.null(),+ zod+ .enum([+ 'CHANNEL',+ 'CHAT',+ 'COMPANY',+ 'DOCUMENT',+ 'PROJECT',+ 'TASK',+ 'THREAD',+ 'USER',+ ])+ .describe(+ 'Type of entity that can be referenced by entity properties.'+ ),+ ])+ .optional(),+ updated_at: zod.iso.datetime({}),+ })+ .describe(+ 'Property definition model (service representation).'+ ),+ value: zod.union([+ zod.null(),zod- .object({- type: zod.enum(['Boolean']),- value: zod- .boolean()+ .union([+ zod+ .object({+ type: zod.enum(['Boolean']),+ value: zod+ .boolean()+ .describe(+ 'Boolean value\nSerializes as: {\"type\": \"Boolean\", \"value\": true}'+ ),+ }).describe('Boolean value\nSerializes as: {\"type\": \"Boolean\", \"value\": true}'),- })- .describe(- 'Boolean value\nSerializes as: {\"type\": \"Boolean\", \"value\": true}'- ),- zod- .object({- type: zod.enum(['Number']),- value: zod- .number()+ zod+ .object({+ type: zod.enum(['Number']),+ value: zod+ .number()+ .describe(+ 'Numeric value\nSerializes as: {\"type\": \"Number\", \"value\": 42.5}'+ ),+ }).describe('Numeric value\nSerializes as: {\"type\": \"Number\", \"value\": 42.5}'),- })- .describe(- 'Numeric value\nSerializes as: {\"type\": \"Number\", \"value\": 42.5}'- ),- zod- .object({- type: zod.enum(['String']),- value: zod- .string()+ zod+ .object({+ type: zod.enum(['String']),+ value: zod+ .string()+ .describe(+ 'String value\nSerializes as: {\"type\": \"String\", \"value\": \"text\"}'+ ),+ }).describe('String value\nSerializes as: {\"type\": \"String\", \"value\": \"text\"}'),- })- .describe(- 'String value\nSerializes as: {\"type\": \"String\", \"value\": \"text\"}'- ),- zod- .object({- type: zod.enum(['Date']),- value: zod.iso- .datetime({})+ zod+ .object({+ type: zod.enum(['Date']),+ value: zod.iso+ .datetime({})+ .describe(+ 'Date\/timestamp value\nSerializes as: {\"type\": \"Date\", \"value\": \"2025-01-01T00:00:00Z\"}'+ ),+ }).describe('Date\/timestamp value\nSerializes as: {\"type\": \"Date\", \"value\": \"2025-01-01T00:00:00Z\"}'),- })- .describe(- 'Date\/timestamp value\nSerializes as: {\"type\": \"Date\", \"value\": \"2025-01-01T00:00:00Z\"}'- ),- zod- .object({- type: zod.enum(['SelectOption']),- value: zod- .array(zod.uuid())+ zod+ .object({+ type: zod.enum(['SelectOption']),+ value: zod+ .array(zod.uuid())+ .describe(+ 'Select option(s) - always an array (check is_multi_select to determine if single or multi)\nSingle-select: {\"type\": \"SelectOption\", \"value\": [\"uuid\"]} (length 0 or 1)\nMulti-select: {\"type\": \"SelectOption\", \"value\": [\"uuid1\", \"uuid2\", ...]} (length 0+)'+ ),+ }).describe('Select option(s) - always an array (check is_multi_select to determine if single or multi)\nSingle-select: {\"type\": \"SelectOption\", \"value\": [\"uuid\"]} (length 0 or 1)\nMulti-select: {\"type\": \"SelectOption\", \"value\": [\"uuid1\", \"uuid2\", ...]} (length 0+)'),- })- .describe(- 'Select option(s) - always an array (check is_multi_select to determine if single or multi)\nSingle-select: {\"type\": \"SelectOption\", \"value\": [\"uuid\"]} (length 0 or 1)\nMulti-select: {\"type\": \"SelectOption\", \"value\": [\"uuid1\", \"uuid2\", ...]} (length 0+)'- ),- zod- .object({- type: zod.enum(['EntityReference']),- value: zod- .array(- zod- .object({- entity_id: zod.string(),- entity_type: zod- .enum([- 'CHANNEL',- 'CHAT',- 'COMPANY',- 'DOCUMENT',- 'PROJECT',- 'TASK',- 'THREAD',- 'USER',- ])- .describe(- 'Type of entity that can be referenced by entity properties.'- ),- specific_message_id: zod- .uuid()- .nullish()+ zod+ .object({+ type: zod.enum(['EntityReference']),+ value: zod+ .array(+ zod+ .object({+ entity_id: zod.string(),+ entity_type: zod+ .enum([+ 'CHANNEL',+ 'CHAT',+ 'COMPANY',+ 'DOCUMENT',+ 'PROJECT',+ 'TASK',+ 'THREAD',+ 'USER',+ ])+ .describe(+ 'Type of entity that can be referenced by entity properties.'+ ),+ specific_message_id: zod+ .uuid()+ .nullish()+ .describe(+ 'For CHANNEL, CHAT, THREAD entity types - optional specific message ID.\nThis allows referencing a specific message within a thread\/channel\/chat.'+ ),+ }).describe(- 'For CHANNEL, CHAT, THREAD entity types - optional specific message ID.\nThis allows referencing a specific message within a thread\/channel\/chat.'- ),- })- .describe(- 'Entity reference for entity-type property values.'+ 'Entity reference for entity-type property values.'+ ))- )+ .describe(+ 'Entity reference(s) - always an array (check is_multi_select to determine if single or multi)\nSingle-select: {\"type\": \"EntityReference\", \"value\": [{...}]} (length 0 or 1)\nMulti-select: {\"type\": \"EntityReference\", \"value\": [{...}, {...}, ...]} (length 0+)'+ ),+ }).describe('Entity reference(s) - always an array (check is_multi_select to determine if single or multi)\nSingle-select: {\"type\": \"EntityReference\", \"value\": [{...}]} (length 0 or 1)\nMulti-select: {\"type\": \"EntityReference\", \"value\": [{...}, {...}, ...]} (length 0+)'),- })- .describe(- 'Entity reference(s) - always an array (check is_multi_select to determine if single or multi)\nSingle-select: {\"type\": \"EntityReference\", \"value\": [{...}]} (length 0 or 1)\nMulti-select: {\"type\": \"EntityReference\", \"value\": [{...}, {...}, ...]} (length 0+)'- ),- zod- .object({- type: zod.enum(['Link']),- value: zod- .array(zod.string())+ zod+ .object({+ type: zod.enum(['Link']),+ value: zod+ .array(zod.string())+ .describe(+ 'Link value(s) - always an array (check is_multi_select to determine if single or multi)\nSingle-select: {\"type\": \"Link\", \"value\": [\"https:\/\/example.com\"]} (length 0 or 1)\nMulti-select: {\"type\": \"Link\", \"value\": [\"https:\/\/example.com\", \"https:\/\/other.com\"]} (length 0+)'+ ),+ }).describe('Link value(s) - always an array (check is_multi_select to determine if single or multi)\nSingle-select: {\"type\": \"Link\", \"value\": [\"https:\/\/example.com\"]} (length 0 or 1)\nMulti-select: {\"type\": \"Link\", \"value\": [\"https:\/\/example.com\", \"https:\/\/other.com\"]} (length 0+)'),- })+ ]).describe(- 'Link value(s) - always an array (check is_multi_select to determine if single or multi)\nSingle-select: {\"type\": \"Link\", \"value\": [\"https:\/\/example.com\"]} (length 0 or 1)\nMulti-select: {\"type\": \"Link\", \"value\": [\"https:\/\/example.com\", \"https:\/\/other.com\"]} (length 0+)'+ 'Property value (service representation).\n\nRepresents the actual value stored for an entity property.\nThis is serialized to\/from JSONB in the database.'),])- .describe(- 'Property value (service representation).\n\nRepresents the actual value stored for an entity property.\nThis is serialized to\/from JSONB in the database.'- ),- ])- .optional(),- })- .describe(- 'A property attached to a Soup item.\n\nThis is a simplified representation that includes only the definition and value,\nomitting the entity property assignment metadata and options.'+ .optional(),+ })+ .describe(+ 'A property attached to a Soup item.\n\nThis is a simplified representation that includes only the definition and value,\nomitting the entity property assignment metadata and options.'+ ))- )- .describe('Properties'),- updatedAt: zod.iso- .datetime({})- .describe('The time the chat was last updated'),- viewedAt: zod.iso- .datetime({})- .nullish()- .describe('The time the chat was last viewed'),- }),- tag: zod.enum(['chat']),- }),- zod.object({- data: zod.object({- createdAt: zod.iso- .datetime({})- .describe('The time the project was created'),- deletedAt: zod.iso- .datetime({})- .nullish()- .describe('The time the project was deleted'),- id: zod.uuid().describe('The id of the project'),- name: zod.string().describe('The name of the project'),- ownerId: zod- .string()- .describe('The user id of who created the project'),- parentId: zod- .uuid()- .nullish()- .describe('The parent project id'),- properties: zod- .array(- zod- .object({- definition: zod+ .describe('Properties'),+ updatedAt: zod.iso+ .datetime({})+ .describe('The time the chat was last updated'),+ viewedAt: zod.iso+ .datetime({})+ .nullish()+ .describe('The time the chat was last viewed'),+ })+ .describe('A chat as displayed in Soup.'),+ tag: zod.enum(['chat']),+ })+ .describe('Chat item.'),+ zod+ .object({+ data: zod+ .object({+ createdAt: zod.iso+ .datetime({})+ .describe('The time the project was created'),+ deletedAt: zod.iso+ .datetime({})+ .nullish()+ .describe('The time the project was deleted'),+ id: zod.uuid().describe('The id of the project'),+ name: zod.string().describe('The name of the project'),+ ownerId: zod+ .string()+ .describe('The user id of who created the project'),+ parentId: zod+ .uuid()+ .nullish()+ .describe('The parent project id'),+ properties: zod+ .array(+ zod.object({- created_at: zod.iso.datetime({}),- data_type: zod- .enum([- 'BOOLEAN',- 'DATE',- 'NUMBER',- 'STRING',- 'SELECT_NUMBER',- 'SELECT_STRING',- 'ENTITY',- 'LINK',- ])- .describe(- 'Data type for property values, determining storage and validation.'- ),- display_name: zod.string(),- id: zod.uuid(),- is_metadata: zod- .boolean()- .describe(- 'Flag to indicate if this is a system-generated metadata property.\nNot stored in database - computed at service layer.'- ),- is_multi_select: zod.boolean(),- is_system: zod- .boolean()- .describe(- 'Flag to indicate if this is a system property (stored in DB).'- ),- owner: zod- .union([- zod- .object({- scope: zod.enum(['user']),- user_id: zod.string(),- })- .describe('User-scoped property only'),- zod- .object({- organization_id: zod.number(),- scope: zod.enum(['organization']),- })+ definition: zod+ .object({+ created_at: zod.iso.datetime({}),+ data_type: zod+ .enum([+ 'BOOLEAN',+ 'DATE',+ 'NUMBER',+ 'STRING',+ 'SELECT_NUMBER',+ 'SELECT_STRING',+ 'ENTITY',+ 'LINK',+ ]).describe(- 'Organization-scoped property only'+ 'Data type for property values, determining storage and validation.'),- zod- .object({- organization_id: zod.number(),- scope: zod.enum([- 'user_and_organization',- ]),- user_id: zod.string(),- })+ display_name: zod.string(),+ id: zod.uuid(),+ is_metadata: zod+ .boolean().describe(- 'Both user and organization-scoped'+ 'Flag to indicate if this is a system-generated metadata property.\nNot stored in database - computed at service layer.'),- zod- .object({- scope: zod.enum(['system']),- })+ is_multi_select: zod.boolean(),+ is_system: zod+ .boolean().describe(- 'System-owned property (no user or org owner)'+ 'Flag to indicate if this is a system property (stored in DB).'),- ])- .describe(- 'Defines who owns a property - user-scoped, org-scoped, system, or both user and org.'- ),- specific_entity_type: zod- .union([- zod.null(),- zod- .enum([- 'CHANNEL',- 'CHAT',- 'COMPANY',- 'DOCUMENT',- 'PROJECT',- 'TASK',- 'THREAD',- 'USER',+ owner: zod+ .union([+ zod+ .object({+ scope: zod.enum(['user']),+ user_id: zod.string(),+ })+ .describe(+ 'User-scoped property only'+ ),+ zod+ .object({+ organization_id: zod.number(),+ scope: zod.enum(['organization']),+ })+ .describe(+ 'Organization-scoped property only'+ ),+ zod+ .object({+ organization_id: zod.number(),+ scope: zod.enum([+ 'user_and_organization',+ ]),+ user_id: zod.string(),+ })+ .describe(+ 'Both user and organization-scoped'+ ),+ zod+ .object({+ scope: zod.enum(['system']),+ })+ .describe(+ 'System-owned property (no user or org owner)'+ ),]).describe(- 'Type of entity that can be referenced by entity properties.'+ 'Defines who owns a property - user-scoped, org-scoped, system, or both user and org.'),- ])- .optional(),- updated_at: zod.iso.datetime({}),- })- .describe(- 'Property definition model (service representation).'- ),- value: zod- .union([- zod.null(),- zod+ specific_entity_type: zod+ .union([+ zod.null(),+ zod+ .enum([+ 'CHANNEL',+ 'CHAT',+ 'COMPANY',+ 'DOCUMENT',+ 'PROJECT',+ 'TASK',+ 'THREAD',+ 'USER',+ ])+ .describe(+ 'Type of entity that can be referenced by entity properties.'+ ),+ ])+ .optional(),+ updated_at: zod.iso.datetime({}),+ })+ .describe(+ 'Property definition model (service representation).'+ ),+ value: zod.union([+ zod.null(),zod- .object({- type: zod.enum(['Boolean']),- value: zod- .boolean()+ .union([+ zod+ .object({+ type: zod.enum(['Boolean']),+ value: zod+ .boolean()+ .describe(+ 'Boolean value\nSerializes as: {\"type\": \"Boolean\", \"value\": true}'+ ),+ }).describe('Boolean value\nSerializes as: {\"type\": \"Boolean\", \"value\": true}'),- })- .describe(- 'Boolean value\nSerializes as: {\"type\": \"Boolean\", \"value\": true}'- ),- zod- .object({- type: zod.enum(['Number']),- value: zod- .number()+ zod+ .object({+ type: zod.enum(['Number']),+ value: zod+ .number()+ .describe(+ 'Numeric value\nSerializes as: {\"type\": \"Number\", \"value\": 42.5}'+ ),+ }).describe('Numeric value\nSerializes as: {\"type\": \"Number\", \"value\": 42.5}'),- })- .describe(- 'Numeric value\nSerializes as: {\"type\": \"Number\", \"value\": 42.5}'- ),- zod- .object({- type: zod.enum(['String']),- value: zod- .string()+ zod+ .object({+ type: zod.enum(['String']),+ value: zod+ .string()+ .describe(+ 'String value\nSerializes as: {\"type\": \"String\", \"value\": \"text\"}'+ ),+ }).describe('String value\nSerializes as: {\"type\": \"String\", \"value\": \"text\"}'),- })- .describe(- 'String value\nSerializes as: {\"type\": \"String\", \"value\": \"text\"}'- ),- zod- .object({- type: zod.enum(['Date']),- value: zod.iso- .datetime({})+ zod+ .object({+ type: zod.enum(['Date']),+ value: zod.iso+ .datetime({})+ .describe(+ 'Date\/timestamp value\nSerializes as: {\"type\": \"Date\", \"value\": \"2025-01-01T00:00:00Z\"}'+ ),+ }).describe('Date\/timestamp value\nSerializes as: {\"type\": \"Date\", \"value\": \"2025-01-01T00:00:00Z\"}'),- })- .describe(- 'Date\/timestamp value\nSerializes as: {\"type\": \"Date\", \"value\": \"2025-01-01T00:00:00Z\"}'- ),- zod- .object({- type: zod.enum(['SelectOption']),- value: zod- .array(zod.uuid())+ zod+ .object({+ type: zod.enum(['SelectOption']),+ value: zod+ .array(zod.uuid())+ .describe(+ 'Select option(s) - always an array (check is_multi_select to determine if single or multi)\nSingle-select: {\"type\": \"SelectOption\", \"value\": [\"uuid\"]} (length 0 or 1)\nMulti-select: {\"type\": \"SelectOption\", \"value\": [\"uuid1\", \"uuid2\", ...]} (length 0+)'+ ),+ }).describe('Select option(s) - always an array (check is_multi_select to determine if single or multi)\nSingle-select: {\"type\": \"SelectOption\", \"value\": [\"uuid\"]} (length 0 or 1)\nMulti-select: {\"type\": \"SelectOption\", \"value\": [\"uuid1\", \"uuid2\", ...]} (length 0+)'),- })- .describe(- 'Select option(s) - always an array (check is_multi_select to determine if single or multi)\nSingle-select: {\"type\": \"SelectOption\", \"value\": [\"uuid\"]} (length 0 or 1)\nMulti-select: {\"type\": \"SelectOption\", \"value\": [\"uuid1\", \"uuid2\", ...]} (length 0+)'- ),- zod- .object({- type: zod.enum(['EntityReference']),- value: zod- .array(- zod- .object({- entity_id: zod.string(),- entity_type: zod- .enum([- 'CHANNEL',- 'CHAT',- 'COMPANY',- 'DOCUMENT',- 'PROJECT',- 'TASK',- 'THREAD',- 'USER',- ])- .describe(- 'Type of entity that can be referenced by entity properties.'- ),- specific_message_id: zod- .uuid()- .nullish()+ zod+ .object({+ type: zod.enum(['EntityReference']),+ value: zod+ .array(+ zod+ .object({+ entity_id: zod.string(),+ entity_type: zod+ .enum([+ 'CHANNEL',+ 'CHAT',+ 'COMPANY',+ 'DOCUMENT',+ 'PROJECT',+ 'TASK',+ 'THREAD',+ 'USER',+ ])+ .describe(+ 'Type of entity that can be referenced by entity properties.'+ ),+ specific_message_id: zod+ .uuid()+ .nullish()+ .describe(+ 'For CHANNEL, CHAT, THREAD entity types - optional specific message ID.\nThis allows referencing a specific message within a thread\/channel\/chat.'+ ),+ }).describe(- 'For CHANNEL, CHAT, THREAD entity types - optional specific message ID.\nThis allows referencing a specific message within a thread\/channel\/chat.'- ),- })- .describe(- 'Entity reference for entity-type property values.'+ 'Entity reference for entity-type property values.'+ ))- )+ .describe(+ 'Entity reference(s) - always an array (check is_multi_select to determine if single or multi)\nSingle-select: {\"type\": \"EntityReference\", \"value\": [{...}]} (length 0 or 1)\nMulti-select: {\"type\": \"EntityReference\", \"value\": [{...}, {...}, ...]} (length 0+)'+ ),+ }).describe('Entity reference(s) - always an array (check is_multi_select to determine if single or multi)\nSingle-select: {\"type\": \"EntityReference\", \"value\": [{...}]} (length 0 or 1)\nMulti-select: {\"type\": \"EntityReference\", \"value\": [{...}, {...}, ...]} (length 0+)'),- })- .describe(- 'Entity reference(s) - always an array (check is_multi_select to determine if single or multi)\nSingle-select: {\"type\": \"EntityReference\", \"value\": [{...}]} (length 0 or 1)\nMulti-select: {\"type\": \"EntityReference\", \"value\": [{...}, {...}, ...]} (length 0+)'- ),- zod- .object({- type: zod.enum(['Link']),- value: zod- .array(zod.string())+ zod+ .object({+ type: zod.enum(['Link']),+ value: zod+ .array(zod.string())+ .describe(+ 'Link value(s) - always an array (check is_multi_select to determine if single or multi)\nSingle-select: {\"type\": \"Link\", \"value\": [\"https:\/\/example.com\"]} (length 0 or 1)\nMulti-select: {\"type\": \"Link\", \"value\": [\"https:\/\/example.com\", \"https:\/\/other.com\"]} (length 0+)'+ ),+ }).describe('Link value(s) - always an array (check is_multi_select to determine if single or multi)\nSingle-select: {\"type\": \"Link\", \"value\": [\"https:\/\/example.com\"]} (length 0 or 1)\nMulti-select: {\"type\": \"Link\", \"value\": [\"https:\/\/example.com\", \"https:\/\/other.com\"]} (length 0+)'),- })+ ]).describe(- 'Link value(s) - always an array (check is_multi_select to determine if single or multi)\nSingle-select: {\"type\": \"Link\", \"value\": [\"https:\/\/example.com\"]} (length 0 or 1)\nMulti-select: {\"type\": \"Link\", \"value\": [\"https:\/\/example.com\", \"https:\/\/other.com\"]} (length 0+)'+ 'Property value (service representation).\n\nRepresents the actual value stored for an entity property.\nThis is serialized to\/from JSONB in the database.'),])- .describe(- 'Property value (service representation).\n\nRepresents the actual value stored for an entity property.\nThis is serialized to\/from JSONB in the database.'- ),- ])- .optional(),- })- .describe(- 'A property attached to a Soup item.\n\nThis is a simplified representation that includes only the definition and value,\nomitting the entity property assignment metadata and options.'+ .optional(),+ })+ .describe(+ 'A property attached to a Soup item.\n\nThis is a simplified representation that includes only the definition and value,\nomitting the entity property assignment metadata and options.'+ ))+ .describe('Properties'),+ updatedAt: zod.iso+ .datetime({})+ .describe('The time the project was updated'),+ viewedAt: zod.iso+ .datetime({})+ .nullish()+ .describe('The time the document was last viewed'),+ })+ .describe('A project as displayed in Soup.'),+ tag: zod.enum(['project']),+ })+ .describe('Project item.'),+ zod+ .object({+ data: zod+ .object({+ createdAt: zod.iso+ .datetime({})+ .describe('Timestamp when the thread was created.'),+ id: zod.uuid().describe('Thread id.'),+ inboxVisible: zod+ .boolean()+ .describe(+ 'Whether the thread should appear in the inbox.'+ ),+ isDraft: zod+ .boolean()+ .describe('Whether the thread contains a draft.'),+ isImportant: zod+ .boolean()+ .describe('Whether the thread is marked important.'),+ isRead: zod+ .boolean()+ .describe('Whether the thread has been read.'),+ name: zod+ .string()+ .nullish()+ .describe('Thread display name or subject.'),+ ownerId: zod.string().describe('Owner user id.'),+ projectId: zod+ .string()+ .nullish()+ .describe('Project id associated with the thread.'),+ providerId: zod+ .string()+ .nullish()+ .describe('Provider-specific thread id.'),+ senderEmail: zod+ .string()+ .nullish()+ .describe('Sender email address for the preview.'),+ senderName: zod+ .string()+ .nullish()+ .describe('Sender display name for the preview.'),+ senderPhotoUrl: zod+ .string()+ .nullish()+ .describe('Sender photo URL for the preview.'),+ snippet: zod+ .string()+ .nullish()+ .describe('Thread snippet.'),+ sortTs: zod.iso+ .datetime({})+ .describe('Timestamp used for email thread sorting.'),+ updatedAt: zod.iso+ .datetime({})+ .describe(+ 'Timestamp when the thread was last updated.'+ ),+ viewedAt: zod.iso+ .datetime({})+ .nullish()+ .describe(+ 'Timestamp when the requesting user last viewed the thread.'+ ),+ })+ .describe(+ 'Email thread preview data as displayed in Soup.')- .describe('Properties'),- updatedAt: zod.iso- .datetime({})- .describe('The time the project was updated'),- viewedAt: zod.iso- .datetime({})- .nullish()- .describe('The time the document was last viewed'),- }),- tag: zod.enum(['project']),- }),- zod.object({- data: zod- .object({- createdAt: zod.iso.datetime({}),- id: zod.uuid(),- inboxVisible: zod.boolean(),- isDraft: zod.boolean(),- isImportant: zod.boolean(),- isRead: zod.boolean(),- name: zod.string().nullish(),- ownerId: zod.string(),- projectId: zod.string().nullish(),- providerId: zod.string().nullish(),- senderEmail: zod.string().nullish(),- senderName: zod.string().nullish(),- senderPhotoUrl: zod.string().nullish(),- snippet: zod.string().nullish(),- sortTs: zod.iso.datetime({}),- updatedAt: zod.iso.datetime({}),- viewedAt: zod.iso.datetime({}).nullish(),- })- .and(- zod.object({- attachments: zod.array(- zod.object({- contentId: zod.string().nullish(),- createdAt: zod.iso.datetime({}),- filename: zod.string().nullish(),- id: zod.uuid(),- messageId: zod.uuid(),- mimeType: zod.string().nullish(),- providerAttachmentId: zod.string().nullish(),- sizeBytes: zod.number().nullish(),- })- ),- labels: zod.array(- zod.object({- createdAt: zod.iso.datetime({}),- id: zod.uuid(),- labelListVisibility: zod.enum([- 'labelShow',- 'labelShowIfUnread',- 'labelHide',- ]),- linkId: zod.uuid(),- messageListVisibility: zod.enum(['show', 'hide']),- name: zod.string(),- providerLabelId: zod.string(),- type: zod.enum(['system', 'user']),- })- ),- participants: zod.array(- zod.object({- emailAddress: zod.string().nullish(),- id: zod.uuid(),- linkId: zod.uuid(),- name: zod.string().nullish(),- sfsPhotoUrl: zod.string().nullish(),- })- ),- properties: zod.array(- zod- .object({- definition: zod+ .and(+ zod.object({+ attachments: zod+ .array(+ zod+ .object({+ contentId: zod+ .string()+ .nullish()+ .describe(+ 'Content id for inline attachments.'+ ),+ createdAt: zod.iso+ .datetime({})+ .describe(+ 'Timestamp when the attachment was created.'+ ),+ filename: zod+ .string()+ .nullish()+ .describe('Attachment filename.'),+ id: zod.uuid().describe('Attachment id.'),+ messageId: zod+ .uuid()+ .describe(+ 'Message id that owns this attachment.'+ ),+ mimeType: zod+ .string()+ .nullish()+ .describe('Attachment MIME type.'),+ providerAttachmentId: zod+ .string()+ .nullish()+ .describe(+ 'Provider-specific attachment id.'+ ),+ sizeBytes: zod+ .number()+ .nullish()+ .describe('Attachment size in bytes.'),+ })+ .describe(+ 'An email attachment as displayed in Soup.'+ )+ )+ .describe('Attachments on the thread.'),+ labels: zod+ .array(+ zod.object({- created_at: zod.iso.datetime({}),- data_type: zod+ createdAt: zod.iso+ .datetime({})+ .describe(+ 'Timestamp when the label was created.'+ ),+ id: zod.uuid().describe('Label id.'),+ labelListVisibility: zod.enum([- 'BOOLEAN',- 'DATE',- 'NUMBER',- 'STRING',- 'SELECT_NUMBER',- 'SELECT_STRING',- 'ENTITY',- 'LINK',+ 'labelShow',+ 'labelShowIfUnread',+ 'labelHide',]).describe(- 'Data type for property values, determining storage and validation.'+ 'Gmail-style label list visibility.'+ ),+ linkId: zod+ .uuid()+ .describe(+ 'Connected account link id for the label.'),- display_name: zod.string(),- id: zod.uuid(),- is_metadata: zod- .boolean()+ messageListVisibility: zod+ .enum(['show', 'hide']).describe(- 'Flag to indicate if this is a system-generated metadata property.\nNot stored in database - computed at service layer.'+ 'Gmail-style message list visibility for a label.'),- is_multi_select: zod.boolean(),- is_system: zod- .boolean()+ name: zod+ .string()+ .describe('Label display name.'),+ providerLabelId: zod+ .string()+ .describe('Provider-specific label id.'),+ type: zod+ .enum(['system', 'user']).describe(- 'Flag to indicate if this is a system property (stored in DB).'+ 'Whether an email label is provider-created or user-created.'),- owner: zod- .union([- zod- .object({- scope: zod.enum(['user']),- user_id: zod.string(),- })- .describe('User-scoped property only'),- zod- .object({- organization_id: zod.number(),- scope: zod.enum(['organization']),- })+ })+ .describe(+ 'An email label as displayed in Soup.'+ )+ )+ .describe('Labels attached to the thread.'),+ participants: zod+ .array(+ zod+ .object({+ emailAddress: zod+ .string()+ .nullish()+ .describe('Contact email address.'),+ id: zod.uuid().describe('Contact id.'),+ linkId: zod+ .uuid()+ .describe(+ 'Connected account link id for the contact.'+ ),+ name: zod+ .string()+ .nullish()+ .describe('Contact display name.'),+ sfsPhotoUrl: zod+ .string()+ .nullish()+ .describe(+ 'Contact photo URL from SFS, if available.'+ ),+ })+ .describe(+ 'A contact participating in an email thread as displayed in Soup.'+ )+ )+ .describe('Contacts participating in the thread.'),+ properties: zod+ .array(+ zod+ .object({+ definition: zod+ .object({+ created_at: zod.iso.datetime({}),+ data_type: zod+ .enum([+ 'BOOLEAN',+ 'DATE',+ 'NUMBER',+ 'STRING',+ 'SELECT_NUMBER',+ 'SELECT_STRING',+ 'ENTITY',+ 'LINK',+ ]).describe(- 'Organization-scoped property only'+ 'Data type for property values, determining storage and validation.'),- zod- .object({- organization_id: zod.number(),- scope: zod.enum([- 'user_and_organization',- ]),- user_id: zod.string(),- })+ display_name: zod.string(),+ id: zod.uuid(),+ is_metadata: zod+ .boolean().describe(- 'Both user and organization-scoped'+ 'Flag to indicate if this is a system-generated metadata property.\nNot stored in database - computed at service layer.'),- zod- .object({- scope: zod.enum(['system']),- })+ is_multi_select: zod.boolean(),+ is_system: zod+ .boolean().describe(- 'System-owned property (no user or org owner)'+ 'Flag to indicate if this is a system property (stored in DB).'),- ])- .describe(- 'Defines who owns a property - user-scoped, org-scoped, system, or both user and org.'- ),- specific_entity_type: zod- .union([- zod.null(),- zod- .enum([- 'CHANNEL',- 'CHAT',- 'COMPANY',- 'DOCUMENT',- 'PROJECT',- 'TASK',- 'THREAD',- 'USER',+ owner: zod+ .union([+ zod+ .object({+ scope: zod.enum(['user']),+ user_id: zod.string(),+ })+ .describe(+ 'User-scoped property only'+ ),+ zod+ .object({+ organization_id: zod.number(),+ scope: zod.enum(['organization']),+ })+ .describe(+ 'Organization-scoped property only'+ ),+ zod+ .object({+ organization_id: zod.number(),+ scope: zod.enum([+ 'user_and_organization',+ ]),+ user_id: zod.string(),+ })+ .describe(+ 'Both user and organization-scoped'+ ),+ zod+ .object({+ scope: zod.enum(['system']),+ })+ .describe(+ 'System-owned property (no user or org owner)'+ ),]).describe(- 'Type of entity that can be referenced by entity properties.'+ 'Defines who owns a property - user-scoped, org-scoped, system, or both user and org.'),- ])- .optional(),- updated_at: zod.iso.datetime({}),- })- .describe(- 'Property definition model (service representation).'- ),- value: zod- .union([- zod.null(),- zod+ specific_entity_type: zod+ .union([+ zod.null(),+ zod+ .enum([+ 'CHANNEL',+ 'CHAT',+ 'COMPANY',+ 'DOCUMENT',+ 'PROJECT',+ 'TASK',+ 'THREAD',+ 'USER',+ ])+ .describe(+ 'Type of entity that can be referenced by entity properties.'+ ),+ ])+ .optional(),+ updated_at: zod.iso.datetime({}),+ })+ .describe(+ 'Property definition model (service representation).'+ ),+ value: zod.union([+ zod.null(),zod- .object({- type: zod.enum(['Boolean']),- value: zod- .boolean()+ .union([+ zod+ .object({+ type: zod.enum(['Boolean']),+ value: zod+ .boolean()+ .describe(+ 'Boolean value\nSerializes as: {\"type\": \"Boolean\", \"value\": true}'+ ),+ }).describe('Boolean value\nSerializes as: {\"type\": \"Boolean\", \"value\": true}'),- })- .describe(- 'Boolean value\nSerializes as: {\"type\": \"Boolean\", \"value\": true}'- ),- zod- .object({- type: zod.enum(['Number']),- value: zod- .number()+ zod+ .object({+ type: zod.enum(['Number']),+ value: zod+ .number()+ .describe(+ 'Numeric value\nSerializes as: {\"type\": \"Number\", \"value\": 42.5}'+ ),+ }).describe('Numeric value\nSerializes as: {\"type\": \"Number\", \"value\": 42.5}'),- })- .describe(- 'Numeric value\nSerializes as: {\"type\": \"Number\", \"value\": 42.5}'- ),- zod- .object({- type: zod.enum(['String']),- value: zod- .string()+ zod+ .object({+ type: zod.enum(['String']),+ value: zod+ .string()+ .describe(+ 'String value\nSerializes as: {\"type\": \"String\", \"value\": \"text\"}'+ ),+ }).describe('String value\nSerializes as: {\"type\": \"String\", \"value\": \"text\"}'),- })- .describe(- 'String value\nSerializes as: {\"type\": \"String\", \"value\": \"text\"}'- ),- zod- .object({- type: zod.enum(['Date']),- value: zod.iso- .datetime({})+ zod+ .object({+ type: zod.enum(['Date']),+ value: zod.iso+ .datetime({})+ .describe(+ 'Date\/timestamp value\nSerializes as: {\"type\": \"Date\", \"value\": \"2025-01-01T00:00:00Z\"}'+ ),+ }).describe('Date\/timestamp value\nSerializes as: {\"type\": \"Date\", \"value\": \"2025-01-01T00:00:00Z\"}'),- })- .describe(- 'Date\/timestamp value\nSerializes as: {\"type\": \"Date\", \"value\": \"2025-01-01T00:00:00Z\"}'- ),- zod- .object({- type: zod.enum(['SelectOption']),- value: zod- .array(zod.uuid())- .describe(- 'Select option(s) - always an array (check is_multi_select to determine if single or multi)\nSingle-select: {\"type\": \"SelectOption\", \"value\": [\"uuid\"]} (length 0 or 1)\nMulti-select: {\"type\": \"SelectOption\", \"value\": [\"uuid1\", \"uuid2\", ...]} (length 0+)'- ),- })- .describe(- 'Select option(s) - always an array (check is_multi_select to determine if single or multi)\nSingle-select: {\"type\": \"SelectOption\", \"value\": [\"uuid\"]} (length 0 or 1)\nMulti-select: {\"type\": \"SelectOption\", \"value\": [\"uuid1\", \"uuid2\", ...]} (length 0+)'- ),- zod- .object({- type: zod.enum(['EntityReference']),- value: zod- .array(- zod- .object({- entity_id: zod.string(),- entity_type: zod- .enum([- 'CHANNEL',- 'CHAT',- 'COMPANY',- 'DOCUMENT',- 'PROJECT',- 'TASK',- 'THREAD',- 'USER',- ])- .describe(- 'Type of entity that can be referenced by entity properties.'- ),- specific_message_id: zod- .uuid()- .nullish()- .describe(- 'For CHANNEL, CHAT, THREAD entity types - optional specific message ID.\nThis allows referencing a specific message within a thread\/channel\/chat.'- ),- })+ zod+ .object({+ type: zod.enum(['SelectOption']),+ value: zod+ .array(zod.uuid()).describe(- 'Entity reference for entity-type property values.'- )- )- .describe(- 'Entity reference(s) - always an array (check is_multi_select to determine if single or multi)\nSingle-select: {\"type\": \"EntityReference\", \"value\": [{...}]} (length 0 or 1)\nMulti-select: {\"type\": \"EntityReference\", \"value\": [{...}, {...}, ...]} (length 0+)'- ),- })- .describe(- 'Entity reference(s) - always an array (check is_multi_select to determine if single or multi)\nSingle-select: {\"type\": \"EntityReference\", \"value\": [{...}]} (length 0 or 1)\nMulti-select: {\"type\": \"EntityReference\", \"value\": [{...}, {...}, ...]} (length 0+)'- ),- zod- .object({- type: zod.enum(['Link']),- value: zod- .array(zod.string())+ 'Select option(s) - always an array (check is_multi_select to determine if single or multi)\nSingle-select: {\"type\": \"SelectOption\", \"value\": [\"uuid\"]} (length 0 or 1)\nMulti-select: {\"type\": \"SelectOption\", \"value\": [\"uuid1\", \"uuid2\", ...]} (length 0+)'+ ),+ }).describe(- 'Link value(s) - always an array (check is_multi_select to determine if single or multi)\nSingle-select: {\"type\": \"Link\", \"value\": [\"https:\/\/example.com\"]} (length 0 or 1)\nMulti-select: {\"type\": \"Link\", \"value\": [\"https:\/\/example.com\", \"https:\/\/other.com\"]} (length 0+)'+ 'Select option(s) - always an array (check is_multi_select to determine if single or multi)\nSingle-select: {\"type\": \"SelectOption\", \"value\": [\"uuid\"]} (length 0 or 1)\nMulti-select: {\"type\": \"SelectOption\", \"value\": [\"uuid1\", \"uuid2\", ...]} (length 0+)'),- })- .describe(- 'Link value(s) - always an array (check is_multi_select to determine if single or multi)\nSingle-select: {\"type\": \"Link\", \"value\": [\"https:\/\/example.com\"]} (length 0 or 1)\nMulti-select: {\"type\": \"Link\", \"value\": [\"https:\/\/example.com\", \"https:\/\/other.com\"]} (length 0+)'- ),- ])- .describe(- 'Property value (service representation).\n\nRepresents the actual value stored for an entity property.\nThis is serialized to\/from JSONB in the database.'- ),- ])- .optional(),- })- .describe(- 'A property attached to a Soup item.\n\nThis is a simplified representation that includes only the definition and value,\nomitting the entity property assignment metadata and options.'- )- ),- })- ),- tag: zod.enum(['emailThread']),- }),- zod.object({- data: zod- .object({- channel: zod- .object({- channel_type: zod- .enum([- 'public',- 'private',- 'direct_message',- 'team',- ])- .describe('Type of channel.'),- created_at: zod.iso- .datetime({})- .describe('Creation timestamp.'),- id: zod.uuid().describe('Channel id.'),- name: zod- .string()- .nullish()- .describe('Channel display name.'),- org_id: zod- .number()- .min(- postItemsSoupAstGroupedResponseItemsDataChannelOrgIdMin- )- .nullish()- .describe('Organization id.'),- owner_id: zod.string().describe('Channel owner.'),- team_id: zod.uuid().nullish().describe('Team id.'),- updated_at: zod.iso- .datetime({})- .describe('Update timestamp.'),- })- .describe('Channel metadata in soup payloads.'),- participants: zod.array(- zod.object({- channel_id: zod.uuid(),- joined_at: zod.iso.datetime({}),- left_at: zod.iso.datetime({}).nullish(),- role: zod- .enum(['owner', 'admin', 'member'])- .describe('The role a user has within a channel.'),- user_id: zod.string(),- })- ),- })- .and(- zod- .object({- latest_message: zod- .union([- zod.null(),- zod- .object({- content: zod- .string()- .describe('Message content.'),- created_at: zod.iso- .datetime({})- .describe('Creation timestamp.'),- deleted_at: zod.iso- .datetime({})- .nullish()- .describe('Deletion timestamp.'),- mentions: zod- .array(zod.string())- .describe(- 'Message mentions formatted as `{ENTITY_TYPE}:{ENTITY_ID}`.'- ),- message_id: zod- .uuid()- .describe('Message id.'),- sender_id: zod- .string()- .describe('Sender id.'),- thread_id: zod- .uuid()- .nullish()- .describe('Thread parent id.'),- updated_at: zod.iso- .datetime({})- .describe('Update timestamp.'),- })- .describe(- 'Lightweight channel message for soup payloads.'- ),- ])- .optional(),- latest_non_thread_message: zod- .union([- zod.null(),- zod- .object({- content: zod- .string()- .describe('Message content.'),- created_at: zod.iso- .datetime({})- .describe('Creation timestamp.'),- deleted_at: zod.iso- .datetime({})- .nullish()- .describe('Deletion timestamp.'),- mentions: zod- .array(zod.string())- .describe(- 'Message mentions formatted as `{ENTITY_TYPE}:{ENTITY_ID}`.'- ),- message_id: zod- .uuid()- .describe('Message id.'),- sender_id: zod- .string()- .describe('Sender id.'),- thread_id: zod- .uuid()- .nullish()- .describe('Thread parent id.'),- updated_at: zod.iso- .datetime({})- .describe('Update timestamp.'),- })- .describe(- 'Lightweight channel message for soup payloads.'- ),- ])- .optional(),- })- .describe('Latest-message bundle for soup payloads.')- )- .and(- zod.object({- interacted_at: zod.iso.datetime({}).nullish(),- viewed_at: zod.iso.datetime({}).nullish(),- })- ),- tag: zod.enum(['channel']),- }),- zod.object({- data: zod- .object({- attended: zod- .boolean()- .describe(- 'Whether the requesting user attended this call. Kept for compatibility\nand derived from `status == ATTENDED`.'- ),- callId: zod.uuid().describe('The call identifier.'),- channelId: zod- .uuid()- .describe('The channel this call belongs to.'),- channelName: zod- .string()- .nullish()- .describe('Resolved display name for the channel.'),- createdBy: zod- .string()- .describe('User who created the call.'),- customName: zod- .string()- .nullish()- .describe(- 'User-supplied or AI-generated display name for the call.'- ),- durationMs: zod- .number()- .nullish()- .describe(- 'Call duration in milliseconds (None if still active).'- ),- endedAt: zod.iso- .datetime({})- .nullish()- .describe(- 'When the call ended (None if still active).'- ),- isActive: zod- .boolean()- .describe('Whether the call is currently active.'),- participants: zod- .array(- zod- .object({- joinedAt: zod.iso- .datetime({})- .describe('When the user joined the call.'),- leftAt: zod.iso- .datetime({})- .nullish()- .describe(- 'When the user left (None if still in an active call).'- ),- userId: zod.string().describe('The user id.'),- })- .describe(- 'A participant in a call record, as displayed in Soup.'- )- )- .describe('Participants in the call.'),- startedAt: zod.iso- .datetime({})- .describe('When the call started.'),- status: zod- .enum(['ATTENDED', 'MISSED', 'UNATTENDED'])- .describe(- 'Viewer-relative attendance status for a call record.\nSerializes as `ATTENDED`, `MISSED`, or `UNATTENDED`.'- ),- summary: zod- .string()- .nullish()- .describe(- 'AI-generated summary of the call. Only set on archived\n`call_records` once summarization has run; active calls always\nreturn `None`.'- ),- })- .describe(- 'A call record as displayed in Soup. Excludes room_name, egress_id,\nand transcript — fields that are irrelevant for the soup feed.'- ),- tag: zod.enum(['call']),- }),- zod.object({- data: zod- .object({- createdAt: zod.iso- .datetime({})- .describe('When the company was created.'),- description: zod- .string()- .nullish()- .describe(- "Display description from the primary domain's directory entry."- ),- domains: zod- .array(- zod- .object({- companyId: zod- .uuid()- .describe(- 'The id of the company the domain belongs to.'- ),- createdAt: zod.iso- .datetime({})- .describe(- 'When the domain record was created.'- ),- domain: zod- .string()+ zod+ .object({+ type: zod.enum([+ 'EntityReference',+ ]),+ value: zod+ .array(+ zod+ .object({+ entity_id: zod.string(),+ entity_type: zod+ .enum([+ 'CHANNEL',+ 'CHAT',+ 'COMPANY',+ 'DOCUMENT',+ 'PROJECT',+ 'TASK',+ 'THREAD',+ 'USER',+ ])+ .describe(+ 'Type of entity that can be referenced by entity properties.'+ ),+ specific_message_id: zod+ .uuid()+ .nullish()+ .describe(+ 'For CHANNEL, CHAT, THREAD entity types - optional specific message ID.\nThis allows referencing a specific message within a thread\/channel\/chat.'+ ),+ })+ .describe(+ 'Entity reference for entity-type property values.'+ )+ )+ .describe(+ 'Entity reference(s) - always an array (check is_multi_select to determine if single or multi)\nSingle-select: {\"type\": \"EntityReference\", \"value\": [{...}]} (length 0 or 1)\nMulti-select: {\"type\": \"EntityReference\", \"value\": [{...}, {...}, ...]} (length 0+)'+ ),+ })+ .describe(+ 'Entity reference(s) - always an array (check is_multi_select to determine if single or multi)\nSingle-select: {\"type\": \"EntityReference\", \"value\": [{...}]} (length 0 or 1)\nMulti-select: {\"type\": \"EntityReference\", \"value\": [{...}, {...}, ...]} (length 0+)'+ ),+ zod+ .object({+ type: zod.enum(['Link']),+ value: zod+ .array(zod.string())+ .describe(+ 'Link value(s) - always an array (check is_multi_select to determine if single or multi)\nSingle-select: {\"type\": \"Link\", \"value\": [\"https:\/\/example.com\"]} (length 0 or 1)\nMulti-select: {\"type\": \"Link\", \"value\": [\"https:\/\/example.com\", \"https:\/\/other.com\"]} (length 0+)'+ ),+ })+ .describe(+ 'Link value(s) - always an array (check is_multi_select to determine if single or multi)\nSingle-select: {\"type\": \"Link\", \"value\": [\"https:\/\/example.com\"]} (length 0 or 1)\nMulti-select: {\"type\": \"Link\", \"value\": [\"https:\/\/example.com\", \"https:\/\/other.com\"]} (length 0+)'+ ),+ ])+ .describe(+ 'Property value (service representation).\n\nRepresents the actual value stored for an entity property.\nThis is serialized to\/from JSONB in the database.'+ ),+ ])+ .optional(),+ }).describe(- 'The domain (lowercased, e.g. \"acme.com\").'- ),- id: zod- .uuid()- .describe('The id of the domain record.'),- })- .describe(- "A CRM domain as displayed in Soup. Mirrors the crm crate's\n[`CrmDomain`] with a stable wire shape that the FE can rely on."+ 'A property attached to a Soup item.\n\nThis is a simplified representation that includes only the definition and value,\nomitting the entity property assignment metadata and options.'+ ))- )- .describe(- 'Domains associated with this company, ordered by creation time\nascending (primary first).'- ),- emailSync: zod- .boolean()- .describe(- 'Whether email sync is enabled for this company.'- ),- hidden: zod- .boolean()- .describe(- 'Whether the company is hidden from CRM listings. Soup filters\nthese out by default.'- ),- id: zod.uuid().describe('The id of the company.'),- name: zod- .string()- .nullish()- .describe(- "Display name from the primary domain's directory entry, or\n`None` when unresolved."- ),- teamId: zod- .uuid()- .describe(- 'The id of the team that owns this company record.'- ),- updatedAt: zod.iso- .datetime({})- .describe('When the company was last updated.'),- viewedAt: zod.iso- .datetime({})- .nullish()- .describe(- 'When the requesting user last viewed this company, or `None` if\nnever viewed. Mirrors the `viewed_at` other soup entities carry.'- ),- })- .describe(- 'A CRM company as displayed in Soup. Carries the core company\nfields plus display metadata resolved from `crm_domain_directory`\nagainst the primary (earliest-created) domain.'- ),- tag: zod.enum(['crmCompany']),- }),- zod.object({- data: zod- .object({- createdAt: zod.iso- .datetime({})- .describe('Timestamp when the record was created.'),- foreignEntityId: zod- .string()- .describe(- 'Identifier assigned by the external system.'- ),- foreignEntitySource: zod- .string()- .describe(- 'Source system that owns the external identifier.'- ),- id: zod- .uuid()- .describe(- 'Internal primary key for this foreign entity record.'- ),- metadata: zod- .object({})- .describe(- 'Arbitrary metadata stored with the mapping.'- ),- storedForAuthEntity: zod- .string()- .describe(- 'Internal auth entity namespace this foreign entity is stored for.'- ),- storedForId: zod- .string()- .describe(- 'Internal entity identifier this foreign entity is stored for.'- ),- updatedAt: zod.iso- .datetime({})- .describe(- 'Timestamp when the record was last updated.'- ),- })- .describe('A foreign entity record as displayed in Soup.'),- tag: zod.enum(['foreignEntity']),- }),- ])- .and(- zod.object({- frecency_score: zod.number(),- })- )- )- .describe(- 'Items in this page, keyed by id. Ordering lives in `groups[].item_ids`.'- ),- })- .describe(- 'Response for the initial grouped soup query.\n\nItems are returned as a pool keyed by id; each `ApiGroupMeta.item_ids`\ndescribes the ordered membership of one group.'- )- .and(- zod.object({- mode: zod.enum(['initial']),- })- ),- zod- .object({- group: zod- .object({- display_order: zod- .number()- .nullish()- .describe('Display order for sorting groups (lower = first)'),- item_ids: zod- .array(zod.uuid())- .describe(- 'Ordered ids of items in this group for the current page.\nEach id keys into `GroupedSoupPage.items`.'- ),- key: zod- .string()- .describe('Group key - format depends on group_by field'),- label: zod.string().describe('Human-readable label for the group'),- next_cursor: zod- .string()- .nullish()- .describe(- 'Cursor to load more items specifically from this group'- ),- total_count: zod- .number()- .min(postItemsSoupAstGroupedResponseGroupTotalCountMin)- .describe('Total count of items in this group across all pages'),- })- .describe(- 'API representation of group metadata.\n\nItems belonging to this group are referenced by `item_ids`, each of which\nlooks up an entry in `GroupedSoupPage.items` (a normalized pool).'- ),- items: zod- .record(- zod.string(),- zod- .union([- zod.object({- data: zod.object({- branchedFromId: zod- .uuid()- .nullish()- .describe(- 'The id of the document this document branched from'- ),- branchedFromVersionId: zod- .number()- .nullish()- .describe(- 'The id of the version this document branched from\nThis could be either DocumentInstance or DocumentBom id depending on the file type'- ),- createdAt: zod.iso- .datetime({})- .describe('The time the document was created'),- deletedAt: zod.iso- .datetime({})- .nullish()- .describe('The time the document was deleted'),- documentFamilyId: zod- .number()- .nullish()- .describe(- 'The id of the document family this document belongs to'- ),- documentVersionId: zod- .number()- .describe(- 'The version of the document\nThis could be the document_instance_id or document_bom_id depending on the file type'- ),- fileType: zod- .string()- .nullish()- .describe(- 'The file type of the document (e.g. pdf, docx)'- ),- id: zod.uuid().describe('The document id'),- name: zod.string().describe('The name of the document'),- ownerId: zod.string().describe('The owner of the document'),- projectId: zod- .uuid()- .nullish()+ .describe('Properties attached to the thread.'),+ })+ ).describe(- 'The id of the project that this document belongs to'+ 'Email thread preview enriched with related metadata for Soup.'),- properties: zod- .array(- zod+ tag: zod.enum(['emailThread']),+ })+ .describe('Email thread item.'),+ zod+ .object({+ data: zod+ .object({+ channel: zod.object({- definition: zod+ channel_type: zod+ .enum([+ 'public',+ 'private',+ 'direct_message',+ 'team',+ ])+ .describe('Type of channel.'),+ created_at: zod.iso+ .datetime({})+ .describe('Creation timestamp.'),+ id: zod.uuid().describe('Channel id.'),+ name: zod+ .string()+ .nullish()+ .describe('Channel display name.'),+ org_id: zod+ .number()+ .min(+ postItemsSoupAstGroupedResponseItemsDataChannelOrgIdMin+ )+ .nullish()+ .describe('Organization id.'),+ owner_id: zod.string().describe('Channel owner.'),+ team_id: zod.uuid().nullish().describe('Team id.'),+ updated_at: zod.iso+ .datetime({})+ .describe('Update timestamp.'),+ })+ .describe('Channel metadata in soup payloads.'),+ participants: zod+ .array(+ zod.object({- created_at: zod.iso.datetime({}),- data_type: zod- .enum([- 'BOOLEAN',- 'DATE',- 'NUMBER',- 'STRING',- 'SELECT_NUMBER',- 'SELECT_STRING',- 'ENTITY',- 'LINK',- ])+ channel_id: zod+ .uuid().describe(- 'Data type for property values, determining storage and validation.'+ 'Channel id for the participant membership.'),- display_name: zod.string(),- id: zod.uuid(),- is_metadata: zod- .boolean()+ joined_at: zod.iso+ .datetime({}).describe(- 'Flag to indicate if this is a system-generated metadata property.\nNot stored in database - computed at service layer.'+ 'Timestamp when the participant joined the channel.'),- is_multi_select: zod.boolean(),- is_system: zod- .boolean()+ left_at: zod.iso+ .datetime({})+ .nullish().describe(- 'Flag to indicate if this is a system property (stored in DB).'+ 'Timestamp when the participant left the channel, if any.'),- owner: zod- .union([- zod- .object({- scope: zod.enum(['user']),- user_id: zod.string(),- })- .describe('User-scoped property only'),- zod- .object({- organization_id: zod.number(),- scope: zod.enum(['organization']),- })- .describe(- 'Organization-scoped property only'- ),- zod- .object({- organization_id: zod.number(),- scope: zod.enum([- 'user_and_organization',- ]),- user_id: zod.string(),- })- .describe(- 'Both user and organization-scoped'- ),- zod- .object({- scope: zod.enum(['system']),- })- .describe(- 'System-owned property (no user or org owner)'- ),- ])+ role: zod+ .enum(['owner', 'admin', 'member']).describe(- 'Defines who owns a property - user-scoped, org-scoped, system, or both user and org.'+ 'The role a user has within a channel.'),- specific_entity_type: zod- .union([- zod.null(),- zod- .enum([- 'CHANNEL',- 'CHAT',- 'COMPANY',- 'DOCUMENT',- 'PROJECT',- 'TASK',- 'THREAD',- 'USER',- ])- .describe(- 'Type of entity that can be referenced by entity properties.'- ),- ])- .optional(),- updated_at: zod.iso.datetime({}),- })- .describe(- 'Property definition model (service representation).'- ),- value: zod+ user_id: zod+ .string()+ .describe('Participant user id.'),+ })+ .describe("A user's membership in a channel.")+ )+ .describe('Participants in the channel.'),+ })+ .describe(+ 'Channel metadata together with its participants.'+ )+ .and(+ zod+ .object({+ latest_message: zod.union([zod.null(),zod- .union([- zod- .object({- type: zod.enum(['Boolean']),- value: zod- .boolean()- .describe(- 'Boolean value\nSerializes as: {\"type\": \"Boolean\", \"value\": true}'- ),- })- .describe(- 'Boolean value\nSerializes as: {\"type\": \"Boolean\", \"value\": true}'- ),- zod- .object({- type: zod.enum(['Number']),- value: zod- .number()- .describe(- 'Numeric value\nSerializes as: {\"type\": \"Number\", \"value\": 42.5}'- ),- })- .describe(- 'Numeric value\nSerializes as: {\"type\": \"Number\", \"value\": 42.5}'- ),- zod- .object({- type: zod.enum(['String']),- value: zod- .string()- .describe(- 'String value\nSerializes as: {\"type\": \"String\", \"value\": \"text\"}'- ),- })- .describe(- 'String value\nSerializes as: {\"type\": \"String\", \"value\": \"text\"}'- ),- zod- .object({- type: zod.enum(['Date']),- value: zod.iso- .datetime({})- .describe(- 'Date\/timestamp value\nSerializes as: {\"type\": \"Date\", \"value\": \"2025-01-01T00:00:00Z\"}'- ),- })- .describe(- 'Date\/timestamp value\nSerializes as: {\"type\": \"Date\", \"value\": \"2025-01-01T00:00:00Z\"}'- ),- zod- .object({- type: zod.enum(['SelectOption']),- value: zod- .array(zod.uuid())- .describe(- 'Select option(s) - always an array (check is_multi_select to determine if single or multi)\nSingle-select: {\"type\": \"SelectOption\", \"value\": [\"uuid\"]} (length 0 or 1)\nMulti-select: {\"type\": \"SelectOption\", \"value\": [\"uuid1\", \"uuid2\", ...]} (length 0+)'- ),- })- .describe(- 'Select option(s) - always an array (check is_multi_select to determine if single or multi)\nSingle-select: {\"type\": \"SelectOption\", \"value\": [\"uuid\"]} (length 0 or 1)\nMulti-select: {\"type\": \"SelectOption\", \"value\": [\"uuid1\", \"uuid2\", ...]} (length 0+)'- ),- zod- .object({- type: zod.enum(['EntityReference']),- value: zod- .array(- zod- .object({- entity_id: zod.string(),- entity_type: zod- .enum([- 'CHANNEL',- 'CHAT',- 'COMPANY',- 'DOCUMENT',- 'PROJECT',- 'TASK',- 'THREAD',- 'USER',- ])- .describe(- 'Type of entity that can be referenced by entity properties.'- ),- specific_message_id: zod- .uuid()- .nullish()- .describe(- 'For CHANNEL, CHAT, THREAD entity types - optional specific message ID.\nThis allows referencing a specific message within a thread\/channel\/chat.'- ),- })- .describe(- 'Entity reference for entity-type property values.'- )- )- .describe(- 'Entity reference(s) - always an array (check is_multi_select to determine if single or multi)\nSingle-select: {\"type\": \"EntityReference\", \"value\": [{...}]} (length 0 or 1)\nMulti-select: {\"type\": \"EntityReference\", \"value\": [{...}, {...}, ...]} (length 0+)'- ),- })+ .object({+ content: zod+ .string()+ .describe('Message content.'),+ created_at: zod.iso+ .datetime({})+ .describe('Creation timestamp.'),+ deleted_at: zod.iso+ .datetime({})+ .nullish()+ .describe('Deletion timestamp.'),+ mentions: zod+ .array(zod.string()).describe(- 'Entity reference(s) - always an array (check is_multi_select to determine if single or multi)\nSingle-select: {\"type\": \"EntityReference\", \"value\": [{...}]} (length 0 or 1)\nMulti-select: {\"type\": \"EntityReference\", \"value\": [{...}, {...}, ...]} (length 0+)'+ 'Message mentions formatted as `{ENTITY_TYPE}:{ENTITY_ID}`.'),- zod- .object({- type: zod.enum(['Link']),- value: zod- .array(zod.string())- .describe(- 'Link value(s) - always an array (check is_multi_select to determine if single or multi)\nSingle-select: {\"type\": \"Link\", \"value\": [\"https:\/\/example.com\"]} (length 0 or 1)\nMulti-select: {\"type\": \"Link\", \"value\": [\"https:\/\/example.com\", \"https:\/\/other.com\"]} (length 0+)'- ),- })+ message_id: zod+ .uuid()+ .describe('Message id.'),+ sender_id: zod+ .string()+ .describe('Sender id.'),+ thread_id: zod+ .uuid()+ .nullish()+ .describe('Thread parent id.'),+ updated_at: zod.iso+ .datetime({})+ .describe('Update timestamp.'),+ })+ .describe(+ 'Lightweight channel message for soup payloads.'+ ),+ ])+ .optional(),+ latest_non_thread_message: zod+ .union([+ zod.null(),+ zod+ .object({+ content: zod+ .string()+ .describe('Message content.'),+ created_at: zod.iso+ .datetime({})+ .describe('Creation timestamp.'),+ deleted_at: zod.iso+ .datetime({})+ .nullish()+ .describe('Deletion timestamp.'),+ mentions: zod+ .array(zod.string()).describe(- 'Link value(s) - always an array (check is_multi_select to determine if single or multi)\nSingle-select: {\"type\": \"Link\", \"value\": [\"https:\/\/example.com\"]} (length 0 or 1)\nMulti-select: {\"type\": \"Link\", \"value\": [\"https:\/\/example.com\", \"https:\/\/other.com\"]} (length 0+)'+ 'Message mentions formatted as `{ENTITY_TYPE}:{ENTITY_ID}`.'),- ])+ message_id: zod+ .uuid()+ .describe('Message id.'),+ sender_id: zod+ .string()+ .describe('Sender id.'),+ thread_id: zod+ .uuid()+ .nullish()+ .describe('Thread parent id.'),+ updated_at: zod.iso+ .datetime({})+ .describe('Update timestamp.'),+ }).describe(- 'Property value (service representation).\n\nRepresents the actual value stored for an entity property.\nThis is serialized to\/from JSONB in the database.'+ 'Lightweight channel message for soup payloads.'),]).optional(),})- .describe(- 'A property attached to a Soup item.\n\nThis is a simplified representation that includes only the definition and value,\nomitting the entity property assignment metadata and options.'- )+ .describe('Latest-message bundle for soup payloads.'))- .describe('Properties'),- sha: zod- .string()- .nullish()+ .and(+ zod.object({+ interacted_at: zod.iso+ .datetime({})+ .nullish()+ .describe(+ 'Timestamp when the requesting user last interacted with this channel.'+ ),+ viewed_at: zod.iso+ .datetime({})+ .nullish()+ .describe(+ 'Timestamp when the requesting user last viewed this channel.'+ ),+ })+ )+ .describe('A channel as displayed in Soup.'),+ tag: zod.enum(['channel']),+ })+ .describe('Channel item.'),+ zod+ .object({+ data: zod+ .object({+ channel_id: zod+ .uuid()+ .describe('Channel that owns the thread.'),+ messages: zod+ .array(+ zod+ .object({+ content: zod+ .string()+ .describe('Message content.'),+ created_at: zod.iso+ .datetime({})+ .describe('Creation timestamp.'),+ deleted_at: zod.iso+ .datetime({})+ .nullish()+ .describe('Deletion timestamp.'),+ mentions: zod+ .array(zod.string())+ .describe(+ 'Message mentions formatted as `{ENTITY_TYPE}:{ENTITY_ID}`.'+ ),+ message_id: zod.uuid().describe('Message id.'),+ sender_id: zod.string().describe('Sender id.'),+ thread_id: zod+ .uuid()+ .nullish()+ .describe('Thread parent id.'),+ updated_at: zod.iso+ .datetime({})+ .describe('Update timestamp.'),+ })+ .describe(+ 'Lightweight channel message for soup payloads.'+ )+ )+ .describe(+ 'Thread replies, using the same lightweight channel message shape.'+ ),+ root_message: zod+ .object({+ content: zod.string().describe('Message content.'),+ created_at: zod.iso+ .datetime({})+ .describe('Creation timestamp.'),+ deleted_at: zod.iso+ .datetime({})+ .nullish()+ .describe('Deletion timestamp.'),+ mentions: zod+ .array(zod.string())+ .describe(+ 'Message mentions formatted as `{ENTITY_TYPE}:{ENTITY_ID}`.'+ ),+ message_id: zod.uuid().describe('Message id.'),+ sender_id: zod.string().describe('Sender id.'),+ thread_id: zod+ .uuid()+ .nullish()+ .describe('Thread parent id.'),+ updated_at: zod.iso+ .datetime({})+ .describe('Update timestamp.'),+ })+ .describe(+ 'Lightweight channel message for soup payloads.'+ ),+ }).describe(- 'If the document is a PDF, this is the SHA of the pdf\nIf the document is a DOCX, this will not be present'+ 'A top-level channel message thread for soup payloads.\n\nThis reuses the existing lightweight [`ChannelMessage`] shape used by\n[`SoupChannel`] latest-message data.'),- subType: zod- .union([- zod.null(),- zod- .union([+ tag: zod.enum(['channelThread']),+ })+ .describe('Channel thread item.'),+ zod+ .object({+ data: zod+ .object({+ attended: zod+ .boolean()+ .describe(+ 'Whether the requesting user attended this call. Kept for compatibility\nand derived from `status == ATTENDED`.'+ ),+ callId: zod.uuid().describe('The call identifier.'),+ channelId: zod+ .uuid()+ .describe('The channel this call belongs to.'),+ channelName: zod+ .string()+ .nullish()+ .describe('Resolved display name for the channel.'),+ createdBy: zod+ .string()+ .describe('User who created the call.'),+ customName: zod+ .string()+ .nullish()+ .describe(+ 'User-supplied or AI-generated display name for the call.'+ ),+ durationMs: zod+ .number()+ .nullish()+ .describe(+ 'Call duration in milliseconds (None if still active).'+ ),+ endedAt: zod.iso+ .datetime({})+ .nullish()+ .describe(+ 'When the call ended (None if still active).'+ ),+ isActive: zod+ .boolean()+ .describe('Whether the call is currently active.'),+ participants: zod+ .array(zod.object({- is_completed: zod- .boolean()+ joinedAt: zod.iso+ .datetime({})+ .describe('When the user joined the call.'),+ leftAt: zod.iso+ .datetime({})+ .nullish().describe(- 'Whether the task is completed.\nTrue if the Status property is set to \"Completed\".'+ 'When the user left (None if still in an active call).'),- type: zod.enum(['task']),+ userId: zod.string().describe('The user id.'),}).describe(- 'A task document with its associated properties'- ),+ 'A participant in a call record, as displayed in Soup.'+ )+ )+ .describe('Participants in the call.'),+ startedAt: zod.iso+ .datetime({})+ .describe('When the call started.'),+ status: zod+ .enum(['ATTENDED', 'MISSED', 'UNATTENDED'])+ .describe(+ 'Viewer-relative attendance status for a call record.\nSerializes as `ATTENDED`, `MISSED`, or `UNATTENDED`.'+ ),+ summary: zod+ .string()+ .nullish()+ .describe(+ 'AI-generated summary of the call. Only set on archived\n`call_records` once summarization has run; active calls always\nreturn `None`.'+ ),+ })+ .describe(+ 'A call record as displayed in Soup. Excludes room_name, egress_id,\nand transcript — fields that are irrelevant for the soup feed.'+ ),+ tag: zod.enum(['call']),+ })+ .describe('Call record item.'),+ zod+ .object({+ data: zod+ .object({+ createdAt: zod.iso+ .datetime({})+ .describe('When the company was created.'),+ description: zod+ .string()+ .nullish()+ .describe(+ "Display description from the primary domain's directory entry."+ ),+ domains: zod+ .array(zod.object({- type: zod.enum(['snippet']),+ companyId: zod+ .uuid()+ .describe(+ 'The id of the company the domain belongs to.'+ ),+ createdAt: zod.iso+ .datetime({})+ .describe(+ 'When the domain record was created.'+ ),+ domain: zod+ .string()+ .describe(+ 'The domain (lowercased, e.g. \"acme.com\").'+ ),+ id: zod+ .uuid()+ .describe('The id of the domain record.'),}).describe(- 'A snippet document — reusable markdown'- ),- ])+ "A CRM domain as displayed in Soup. Mirrors the crm crate's\n[`CrmDomain`] with a stable wire shape that the FE can rely on."+ )+ )+ .describe(+ 'Domains associated with this company, ordered by creation time\nascending (primary first).'+ ),+ emailSync: zod+ .boolean()+ .describe(+ 'Whether email sync is enabled for this company.'+ ),+ hidden: zod+ .boolean()+ .describe(+ 'Whether the company is hidden from CRM listings. Soup filters\nthese out by default.'+ ),+ id: zod.uuid().describe('The id of the company.'),+ name: zod+ .string()+ .nullish()+ .describe(+ "Display name from the primary domain's directory entry, or\n`None` when unresolved."+ ),+ teamId: zod+ .uuid()+ .describe(+ 'The id of the team that owns this company record.'+ ),+ updatedAt: zod.iso+ .datetime({})+ .describe('When the company was last updated.'),+ viewedAt: zod.iso+ .datetime({})+ .nullish()+ .describe(+ 'When the requesting user last viewed this company, or `None` if\nnever viewed. Mirrors the `viewed_at` other soup entities carry.'+ ),+ })+ .describe(+ 'A CRM company as displayed in Soup. Carries the core company\nfields plus display metadata resolved from `crm_domain_directory`\nagainst the primary (earliest-created) domain.'+ ),+ tag: zod.enum(['crmCompany']),+ })+ .describe('CRM company item.'),+ zod+ .object({+ data: zod+ .object({+ createdAt: zod.iso+ .datetime({})+ .describe('Timestamp when the record was created.'),+ foreignEntityId: zod+ .string().describe(- 'Sub type of a document with associated properties encoded in each variant.\nThis ensures type-safety: task properties only exist when the document is a task.'+ 'Identifier assigned by the external system.'),- ])- .optional(),- updatedAt: zod.iso- .datetime({})+ foreignEntitySource: zod+ .string()+ .describe(+ 'Source system that owns the external identifier.'+ ),+ id: zod+ .uuid()+ .describe(+ 'Internal primary key for this foreign entity record.'+ ),+ metadata: zod+ .object({})+ .describe(+ 'Arbitrary metadata stored with the mapping.'+ ),+ storedForAuthEntity: zod+ .string()+ .describe(+ 'Internal auth entity namespace this foreign entity is stored for.'+ ),+ storedForId: zod+ .string()+ .describe(+ 'Internal entity identifier this foreign entity is stored for.'+ ),+ updatedAt: zod.iso+ .datetime({})+ .describe(+ 'Timestamp when the record was last updated.'+ ),+ }).describe(- 'The time the document instance \/ document BOM was updated'+ 'A foreign entity record as displayed in Soup.'),- viewedAt: zod.iso- .datetime({})- .nullish()- .describe('The time the document was last viewed'),- }),- tag: zod.enum(['document']),- }),+ tag: zod.enum(['foreignEntity']),+ })+ .describe('Foreign entity item.'),+ ])+ .describe('A single item in the Soup feed.')+ .and(zod.object({- data: zod.object({- createdAt: zod.iso- .datetime({})- .describe('The time the chat was created'),- deletedAt: zod.iso- .datetime({})- .nullish()- .describe('The time the chat was deleted'),- id: zod.uuid().describe('The chat uuid'),- isPersistent: zod- .boolean()- .describe('Whether the chat is persistent or not'),- name: zod.string().describe('The name of the chat'),- ownerId: zod.string().describe('Who the chat belongs to'),- projectId: zod- .uuid()- .nullish()- .describe('The project id of the chat'),- properties: zod- .array(- zod- .object({- definition: zod+ frecency_score: zod.number(),+ })+ )+ .describe(+ 'API representation of a soup item with its frecency score.'+ )+ )+ .describe(+ 'Items in this page, keyed by id. Ordering lives in `groups[].item_ids`.'+ ),+ })+ .describe(+ 'Response for the initial grouped soup query.\n\nItems are returned as a pool keyed by id; each `ApiGroupMeta.item_ids`\ndescribes the ordered membership of one group.'+ )+ .and(+ zod.object({+ mode: zod.enum(['initial']),+ })+ )+ .describe('Initial grouped response containing multiple groups.'),+ zod+ .object({+ group: zod+ .object({+ display_order: zod+ .number()+ .nullish()+ .describe('Display order for sorting groups (lower = first)'),+ item_ids: zod+ .array(zod.uuid())+ .describe(+ 'Ordered ids of items in this group for the current page.\nEach id keys into `GroupedSoupPage.items`.'+ ),+ key: zod+ .string()+ .describe('Group key - format depends on group_by field'),+ label: zod.string().describe('Human-readable label for the group'),+ next_cursor: zod+ .string()+ .nullish()+ .describe(+ 'Cursor to load more items specifically from this group'+ ),+ total_count: zod+ .number()+ .min(postItemsSoupAstGroupedResponseGroupTotalCountMin)+ .describe('Total count of items in this group across all pages'),+ })+ .describe(+ 'API representation of group metadata.\n\nItems belonging to this group are referenced by `item_ids`, each of which\nlooks up an entry in `GroupedSoupPage.items` (a normalized pool).'+ ),+ items: zod+ .record(+ zod.string(),+ zod+ .union([+ zod+ .object({+ data: zod+ .object({+ branchedFromId: zod+ .uuid()+ .nullish()+ .describe(+ 'The id of the document this document branched from'+ ),+ branchedFromVersionId: zod+ .number()+ .nullish()+ .describe(+ 'The id of the version this document branched from\nThis could be either DocumentInstance or DocumentBom id depending on the file type'+ ),+ createdAt: zod.iso+ .datetime({})+ .describe('The time the document was created'),+ deletedAt: zod.iso+ .datetime({})+ .nullish()+ .describe('The time the document was deleted'),+ documentFamilyId: zod+ .number()+ .nullish()+ .describe(+ 'The id of the document family this document belongs to'+ ),+ documentVersionId: zod+ .number()+ .describe(+ 'The version of the document\nThis could be the document_instance_id or document_bom_id depending on the file type'+ ),+ fileType: zod+ .string()+ .nullish()+ .describe(+ 'The file type of the document (e.g. pdf, docx)'+ ),+ id: zod.uuid().describe('The document id'),+ name: zod.string().describe('The name of the document'),+ ownerId: zod+ .string()+ .describe('The owner of the document'),+ projectId: zod+ .uuid()+ .nullish()+ .describe(+ 'The id of the project that this document belongs to'+ ),+ properties: zod+ .array(+ zod.object({- created_at: zod.iso.datetime({}),- data_type: zod- .enum([- 'BOOLEAN',- 'DATE',- 'NUMBER',- 'STRING',- 'SELECT_NUMBER',- 'SELECT_STRING',- 'ENTITY',- 'LINK',- ])- .describe(- 'Data type for property values, determining storage and validation.'- ),- display_name: zod.string(),- id: zod.uuid(),- is_metadata: zod- .boolean()- .describe(- 'Flag to indicate if this is a system-generated metadata property.\nNot stored in database - computed at service layer.'- ),- is_multi_select: zod.boolean(),- is_system: zod- .boolean()- .describe(- 'Flag to indicate if this is a system property (stored in DB).'- ),- owner: zod- .union([- zod- .object({- scope: zod.enum(['user']),- user_id: zod.string(),- })- .describe('User-scoped property only'),- zod- .object({- organization_id: zod.number(),- scope: zod.enum(['organization']),- })+ definition: zod+ .object({+ created_at: zod.iso.datetime({}),+ data_type: zod+ .enum([+ 'BOOLEAN',+ 'DATE',+ 'NUMBER',+ 'STRING',+ 'SELECT_NUMBER',+ 'SELECT_STRING',+ 'ENTITY',+ 'LINK',+ ]).describe(- 'Organization-scoped property only'+ 'Data type for property values, determining storage and validation.'),- zod- .object({- organization_id: zod.number(),- scope: zod.enum([- 'user_and_organization',- ]),- user_id: zod.string(),- })+ display_name: zod.string(),+ id: zod.uuid(),+ is_metadata: zod+ .boolean().describe(- 'Both user and organization-scoped'+ 'Flag to indicate if this is a system-generated metadata property.\nNot stored in database - computed at service layer.'),- zod- .object({- scope: zod.enum(['system']),- })+ is_multi_select: zod.boolean(),+ is_system: zod+ .boolean().describe(- 'System-owned property (no user or org owner)'+ 'Flag to indicate if this is a system property (stored in DB).'),- ])- .describe(- 'Defines who owns a property - user-scoped, org-scoped, system, or both user and org.'- ),- specific_entity_type: zod- .union([- zod.null(),- zod- .enum([- 'CHANNEL',- 'CHAT',- 'COMPANY',- 'DOCUMENT',- 'PROJECT',- 'TASK',- 'THREAD',- 'USER',+ owner: zod+ .union([+ zod+ .object({+ scope: zod.enum(['user']),+ user_id: zod.string(),+ })+ .describe(+ 'User-scoped property only'+ ),+ zod+ .object({+ organization_id: zod.number(),+ scope: zod.enum(['organization']),+ })+ .describe(+ 'Organization-scoped property only'+ ),+ zod+ .object({+ organization_id: zod.number(),+ scope: zod.enum([+ 'user_and_organization',+ ]),+ user_id: zod.string(),+ })+ .describe(+ 'Both user and organization-scoped'+ ),+ zod+ .object({+ scope: zod.enum(['system']),+ })+ .describe(+ 'System-owned property (no user or org owner)'+ ),]).describe(- 'Type of entity that can be referenced by entity properties.'+ 'Defines who owns a property - user-scoped, org-scoped, system, or both user and org.'),- ])- .optional(),- updated_at: zod.iso.datetime({}),- })- .describe(- 'Property definition model (service representation).'- ),- value: zod- .union([- zod.null(),- zod+ specific_entity_type: zod+ .union([+ zod.null(),+ zod+ .enum([+ 'CHANNEL',+ 'CHAT',+ 'COMPANY',+ 'DOCUMENT',+ 'PROJECT',+ 'TASK',+ 'THREAD',+ 'USER',+ ])+ .describe(+ 'Type of entity that can be referenced by entity properties.'+ ),+ ])+ .optional(),+ updated_at: zod.iso.datetime({}),+ })+ .describe(+ 'Property definition model (service representation).'+ ),+ value: zod.union([+ zod.null(),zod- .object({- type: zod.enum(['Boolean']),- value: zod- .boolean()+ .union([+ zod+ .object({+ type: zod.enum(['Boolean']),+ value: zod+ .boolean()+ .describe(+ 'Boolean value\nSerializes as: {\"type\": \"Boolean\", \"value\": true}'+ ),+ }).describe('Boolean value\nSerializes as: {\"type\": \"Boolean\", \"value\": true}'),- })- .describe(- 'Boolean value\nSerializes as: {\"type\": \"Boolean\", \"value\": true}'- ),- zod- .object({- type: zod.enum(['Number']),- value: zod- .number()+ zod+ .object({+ type: zod.enum(['Number']),+ value: zod+ .number()+ .describe(+ 'Numeric value\nSerializes as: {\"type\": \"Number\", \"value\": 42.5}'+ ),+ }).describe(- 'Numeric value\nSerializes as: {\"type\": \"Number\", \"value\": 42.5}'- ),- })- .describe(- 'Numeric value\nSerializes as: {\"type\": \"Number\", \"value\": 42.5}'- ),- zod- .object({- type: zod.enum(['String']),- value: zod- .string()+ 'Numeric value\nSerializes as: {\"type\": \"Number\", \"value\": 42.5}'+ ),+ zod+ .object({+ type: zod.enum(['String']),+ value: zod+ .string()+ .describe(+ 'String value\nSerializes as: {\"type\": \"String\", \"value\": \"text\"}'+ ),+ }).describe('String value\nSerializes as: {\"type\": \"String\", \"value\": \"text\"}'),- })- .describe(- 'String value\nSerializes as: {\"type\": \"String\", \"value\": \"text\"}'- ),- zod- .object({- type: zod.enum(['Date']),- value: zod.iso- .datetime({})+ zod+ .object({+ type: zod.enum(['Date']),+ value: zod.iso+ .datetime({})+ .describe(+ 'Date\/timestamp value\nSerializes as: {\"type\": \"Date\", \"value\": \"2025-01-01T00:00:00Z\"}'+ ),+ }).describe('Date\/timestamp value\nSerializes as: {\"type\": \"Date\", \"value\": \"2025-01-01T00:00:00Z\"}'),- })- .describe(- 'Date\/timestamp value\nSerializes as: {\"type\": \"Date\", \"value\": \"2025-01-01T00:00:00Z\"}'- ),- zod- .object({- type: zod.enum(['SelectOption']),- value: zod- .array(zod.uuid())+ zod+ .object({+ type: zod.enum(['SelectOption']),+ value: zod+ .array(zod.uuid())+ .describe(+ 'Select option(s) - always an array (check is_multi_select to determine if single or multi)\nSingle-select: {\"type\": \"SelectOption\", \"value\": [\"uuid\"]} (length 0 or 1)\nMulti-select: {\"type\": \"SelectOption\", \"value\": [\"uuid1\", \"uuid2\", ...]} (length 0+)'+ ),+ }).describe('Select option(s) - always an array (check is_multi_select to determine if single or multi)\nSingle-select: {\"type\": \"SelectOption\", \"value\": [\"uuid\"]} (length 0 or 1)\nMulti-select: {\"type\": \"SelectOption\", \"value\": [\"uuid1\", \"uuid2\", ...]} (length 0+)'),- })- .describe(- 'Select option(s) - always an array (check is_multi_select to determine if single or multi)\nSingle-select: {\"type\": \"SelectOption\", \"value\": [\"uuid\"]} (length 0 or 1)\nMulti-select: {\"type\": \"SelectOption\", \"value\": [\"uuid1\", \"uuid2\", ...]} (length 0+)'- ),- zod- .object({- type: zod.enum(['EntityReference']),- value: zod- .array(- zod- .object({- entity_id: zod.string(),- entity_type: zod- .enum([- 'CHANNEL',- 'CHAT',- 'COMPANY',- 'DOCUMENT',- 'PROJECT',- 'TASK',- 'THREAD',- 'USER',- ])- .describe(- 'Type of entity that can be referenced by entity properties.'- ),- specific_message_id: zod- .uuid()- .nullish()+ zod+ .object({+ type: zod.enum(['EntityReference']),+ value: zod+ .array(+ zod+ .object({+ entity_id: zod.string(),+ entity_type: zod+ .enum([+ 'CHANNEL',+ 'CHAT',+ 'COMPANY',+ 'DOCUMENT',+ 'PROJECT',+ 'TASK',+ 'THREAD',+ 'USER',+ ])+ .describe(+ 'Type of entity that can be referenced by entity properties.'+ ),+ specific_message_id: zod+ .uuid()+ .nullish()+ .describe(+ 'For CHANNEL, CHAT, THREAD entity types - optional specific message ID.\nThis allows referencing a specific message within a thread\/channel\/chat.'+ ),+ }).describe(- 'For CHANNEL, CHAT, THREAD entity types - optional specific message ID.\nThis allows referencing a specific message within a thread\/channel\/chat.'- ),- })- .describe(- 'Entity reference for entity-type property values.'+ 'Entity reference for entity-type property values.'+ ))- )+ .describe(+ 'Entity reference(s) - always an array (check is_multi_select to determine if single or multi)\nSingle-select: {\"type\": \"EntityReference\", \"value\": [{...}]} (length 0 or 1)\nMulti-select: {\"type\": \"EntityReference\", \"value\": [{...}, {...}, ...]} (length 0+)'+ ),+ }).describe('Entity reference(s) - always an array (check is_multi_select to determine if single or multi)\nSingle-select: {\"type\": \"EntityReference\", \"value\": [{...}]} (length 0 or 1)\nMulti-select: {\"type\": \"EntityReference\", \"value\": [{...}, {...}, ...]} (length 0+)'),- })- .describe(- 'Entity reference(s) - always an array (check is_multi_select to determine if single or multi)\nSingle-select: {\"type\": \"EntityReference\", \"value\": [{...}]} (length 0 or 1)\nMulti-select: {\"type\": \"EntityReference\", \"value\": [{...}, {...}, ...]} (length 0+)'- ),- zod- .object({- type: zod.enum(['Link']),- value: zod- .array(zod.string())+ zod+ .object({+ type: zod.enum(['Link']),+ value: zod+ .array(zod.string())+ .describe(+ 'Link value(s) - always an array (check is_multi_select to determine if single or multi)\nSingle-select: {\"type\": \"Link\", \"value\": [\"https:\/\/example.com\"]} (length 0 or 1)\nMulti-select: {\"type\": \"Link\", \"value\": [\"https:\/\/example.com\", \"https:\/\/other.com\"]} (length 0+)'+ ),+ }).describe('Link value(s) - always an array (check is_multi_select to determine if single or multi)\nSingle-select: {\"type\": \"Link\", \"value\": [\"https:\/\/example.com\"]} (length 0 or 1)\nMulti-select: {\"type\": \"Link\", \"value\": [\"https:\/\/example.com\", \"https:\/\/other.com\"]} (length 0+)'),- })+ ]).describe(- 'Link value(s) - always an array (check is_multi_select to determine if single or multi)\nSingle-select: {\"type\": \"Link\", \"value\": [\"https:\/\/example.com\"]} (length 0 or 1)\nMulti-select: {\"type\": \"Link\", \"value\": [\"https:\/\/example.com\", \"https:\/\/other.com\"]} (length 0+)'+ 'Property value (service representation).\n\nRepresents the actual value stored for an entity property.\nThis is serialized to\/from JSONB in the database.'),])- .describe(- 'Property value (service representation).\n\nRepresents the actual value stored for an entity property.\nThis is serialized to\/from JSONB in the database.'- ),- ])- .optional(),- })- .describe(- 'A property attached to a Soup item.\n\nThis is a simplified representation that includes only the definition and value,\nomitting the entity property assignment metadata and options.'+ .optional(),+ })+ .describe(+ 'A property attached to a Soup item.\n\nThis is a simplified representation that includes only the definition and value,\nomitting the entity property assignment metadata and options.'+ ))- )- .describe('Properties'),- updatedAt: zod.iso- .datetime({})- .describe('The time the chat was last updated'),- viewedAt: zod.iso- .datetime({})- .nullish()- .describe('The time the chat was last viewed'),- }),- tag: zod.enum(['chat']),- }),- zod.object({- data: zod.object({- createdAt: zod.iso- .datetime({})- .describe('The time the project was created'),- deletedAt: zod.iso- .datetime({})- .nullish()- .describe('The time the project was deleted'),- id: zod.uuid().describe('The id of the project'),- name: zod.string().describe('The name of the project'),- ownerId: zod- .string()- .describe('The user id of who created the project'),- parentId: zod- .uuid()- .nullish()- .describe('The parent project id'),- properties: zod- .array(- zod- .object({- definition: zod- .object({- created_at: zod.iso.datetime({}),- data_type: zod- .enum([- 'BOOLEAN',- 'DATE',- 'NUMBER',- 'STRING',- 'SELECT_NUMBER',- 'SELECT_STRING',- 'ENTITY',- 'LINK',- ])- .describe(- 'Data type for property values, determining storage and validation.'- ),- display_name: zod.string(),- id: zod.uuid(),- is_metadata: zod- .boolean()+ .describe('Properties'),+ sha: zod+ .string()+ .nullish()+ .describe(+ 'If the document is a PDF, this is the SHA of the pdf\nIf the document is a DOCX, this will not be present'+ ),+ subType: zod+ .union([+ zod.null(),+ zod+ .union([+ zod+ .object({+ is_completed: zod+ .boolean()+ .describe(+ 'Whether the task is completed.\nTrue if the Status property is set to \"Completed\".'+ ),+ type: zod.enum(['task']),+ }).describe(- 'Flag to indicate if this is a system-generated metadata property.\nNot stored in database - computed at service layer.'+ 'A task document with its associated properties'),- is_multi_select: zod.boolean(),- is_system: zod- .boolean()+ zod+ .object({+ type: zod.enum(['snippet']),+ }).describe(- 'Flag to indicate if this is a system property (stored in DB).'+ 'A snippet document — reusable markdown'),- owner: zod- .union([- zod- .object({- scope: zod.enum(['user']),- user_id: zod.string(),- })- .describe('User-scoped property only'),- zod- .object({- organization_id: zod.number(),- scope: zod.enum(['organization']),- })+ ])+ .describe(+ 'Sub type of a document with associated properties encoded in each variant.\nThis ensures type-safety: task properties only exist when the document is a task.'+ ),+ ])+ .optional(),+ updatedAt: zod.iso+ .datetime({})+ .describe(+ 'The time the document instance \/ document BOM was updated'+ ),+ viewedAt: zod.iso+ .datetime({})+ .nullish()+ .describe('The time the document was last viewed'),+ })+ .describe('A document as displayed in Soup.'),+ tag: zod.enum(['document']),+ })+ .describe('Document item.'),+ zod+ .object({+ data: zod+ .object({+ createdAt: zod.iso+ .datetime({})+ .describe('The time the chat was created'),+ deletedAt: zod.iso+ .datetime({})+ .nullish()+ .describe('The time the chat was deleted'),+ id: zod.uuid().describe('The chat uuid'),+ isPersistent: zod+ .boolean()+ .describe('Whether the chat is persistent or not'),+ name: zod.string().describe('The name of the chat'),+ ownerId: zod+ .string()+ .describe('Who the chat belongs to'),+ projectId: zod+ .uuid()+ .nullish()+ .describe('The project id of the chat'),+ properties: zod+ .array(+ zod+ .object({+ definition: zod+ .object({+ created_at: zod.iso.datetime({}),+ data_type: zod+ .enum([+ 'BOOLEAN',+ 'DATE',+ 'NUMBER',+ 'STRING',+ 'SELECT_NUMBER',+ 'SELECT_STRING',+ 'ENTITY',+ 'LINK',+ ]).describe(- 'Organization-scoped property only'+ 'Data type for property values, determining storage and validation.'),- zod- .object({- organization_id: zod.number(),- scope: zod.enum([- 'user_and_organization',- ]),- user_id: zod.string(),- })+ display_name: zod.string(),+ id: zod.uuid(),+ is_metadata: zod+ .boolean().describe(- 'Both user and organization-scoped'+ 'Flag to indicate if this is a system-generated metadata property.\nNot stored in database - computed at service layer.'),- zod- .object({- scope: zod.enum(['system']),- })+ is_multi_select: zod.boolean(),+ is_system: zod+ .boolean().describe(- 'System-owned property (no user or org owner)'+ 'Flag to indicate if this is a system property (stored in DB).'),- ])+ owner: zod+ .union([+ zod+ .object({+ scope: zod.enum(['user']),+ user_id: zod.string(),+ })+ .describe(+ 'User-scoped property only'+ ),+ zod+ .object({+ organization_id: zod.number(),+ scope: zod.enum(['organization']),+ })+ .describe(+ 'Organization-scoped property only'+ ),+ zod+ .object({+ organization_id: zod.number(),+ scope: zod.enum([+ 'user_and_organization',+ ]),+ user_id: zod.string(),+ })+ .describe(+ 'Both user and organization-scoped'+ ),+ zod+ .object({+ scope: zod.enum(['system']),+ })+ .describe(+ 'System-owned property (no user or org owner)'+ ),+ ])+ .describe(+ 'Defines who owns a property - user-scoped, org-scoped, system, or both user and org.'+ ),+ specific_entity_type: zod+ .union([+ zod.null(),+ zod+ .enum([+ 'CHANNEL',+ 'CHAT',+ 'COMPANY',+ 'DOCUMENT',+ 'PROJECT',+ 'TASK',+ 'THREAD',+ 'USER',+ ])+ .describe(+ 'Type of entity that can be referenced by entity properties.'+ ),+ ])+ .optional(),+ updated_at: zod.iso.datetime({}),+ }).describe(- 'Defines who owns a property - user-scoped, org-scoped, system, or both user and org.'+ 'Property definition model (service representation).'),- specific_entity_type: zod+ value: zod.union([zod.null(),zod- .enum([- 'CHANNEL',- 'CHAT',- 'COMPANY',- 'DOCUMENT',- 'PROJECT',- 'TASK',- 'THREAD',- 'USER',+ .union([+ zod+ .object({+ type: zod.enum(['Boolean']),+ value: zod+ .boolean()+ .describe(+ 'Boolean value\nSerializes as: {\"type\": \"Boolean\", \"value\": true}'+ ),+ })+ .describe(+ 'Boolean value\nSerializes as: {\"type\": \"Boolean\", \"value\": true}'+ ),+ zod+ .object({+ type: zod.enum(['Number']),+ value: zod+ .number()+ .describe(+ 'Numeric value\nSerializes as: {\"type\": \"Number\", \"value\": 42.5}'+ ),+ })+ .describe(+ 'Numeric value\nSerializes as: {\"type\": \"Number\", \"value\": 42.5}'+ ),+ zod+ .object({+ type: zod.enum(['String']),+ value: zod+ .string()+ .describe(+ 'String value\nSerializes as: {\"type\": \"String\", \"value\": \"text\"}'+ ),+ })+ .describe(+ 'String value\nSerializes as: {\"type\": \"String\", \"value\": \"text\"}'+ ),+ zod+ .object({+ type: zod.enum(['Date']),+ value: zod.iso+ .datetime({})+ .describe(+ 'Date\/timestamp value\nSerializes as: {\"type\": \"Date\", \"value\": \"2025-01-01T00:00:00Z\"}'+ ),+ })+ .describe(+ 'Date\/timestamp value\nSerializes as: {\"type\": \"Date\", \"value\": \"2025-01-01T00:00:00Z\"}'+ ),+ zod+ .object({+ type: zod.enum(['SelectOption']),+ value: zod+ .array(zod.uuid())+ .describe(+ 'Select option(s) - always an array (check is_multi_select to determine if single or multi)\nSingle-select: {\"type\": \"SelectOption\", \"value\": [\"uuid\"]} (length 0 or 1)\nMulti-select: {\"type\": \"SelectOption\", \"value\": [\"uuid1\", \"uuid2\", ...]} (length 0+)'+ ),+ })+ .describe(+ 'Select option(s) - always an array (check is_multi_select to determine if single or multi)\nSingle-select: {\"type\": \"SelectOption\", \"value\": [\"uuid\"]} (length 0 or 1)\nMulti-select: {\"type\": \"SelectOption\", \"value\": [\"uuid1\", \"uuid2\", ...]} (length 0+)'+ ),+ zod+ .object({+ type: zod.enum(['EntityReference']),+ value: zod+ .array(+ zod+ .object({+ entity_id: zod.string(),+ entity_type: zod+ .enum([+ 'CHANNEL',+ 'CHAT',+ 'COMPANY',+ 'DOCUMENT',+ 'PROJECT',+ 'TASK',+ 'THREAD',+ 'USER',+ ])+ .describe(+ 'Type of entity that can be referenced by entity properties.'+ ),+ specific_message_id: zod+ .uuid()+ .nullish()+ .describe(+ 'For CHANNEL, CHAT, THREAD entity types - optional specific message ID.\nThis allows referencing a specific message within a thread\/channel\/chat.'+ ),+ })+ .describe(+ 'Entity reference for entity-type property values.'+ )+ )+ .describe(+ 'Entity reference(s) - always an array (check is_multi_select to determine if single or multi)\nSingle-select: {\"type\": \"EntityReference\", \"value\": [{...}]} (length 0 or 1)\nMulti-select: {\"type\": \"EntityReference\", \"value\": [{...}, {...}, ...]} (length 0+)'+ ),+ })+ .describe(+ 'Entity reference(s) - always an array (check is_multi_select to determine if single or multi)\nSingle-select: {\"type\": \"EntityReference\", \"value\": [{...}]} (length 0 or 1)\nMulti-select: {\"type\": \"EntityReference\", \"value\": [{...}, {...}, ...]} (length 0+)'+ ),+ zod+ .object({+ type: zod.enum(['Link']),+ value: zod+ .array(zod.string())+ .describe(+ 'Link value(s) - always an array (check is_multi_select to determine if single or multi)\nSingle-select: {\"type\": \"Link\", \"value\": [\"https:\/\/example.com\"]} (length 0 or 1)\nMulti-select: {\"type\": \"Link\", \"value\": [\"https:\/\/example.com\", \"https:\/\/other.com\"]} (length 0+)'+ ),+ })+ .describe(+ 'Link value(s) - always an array (check is_multi_select to determine if single or multi)\nSingle-select: {\"type\": \"Link\", \"value\": [\"https:\/\/example.com\"]} (length 0 or 1)\nMulti-select: {\"type\": \"Link\", \"value\": [\"https:\/\/example.com\", \"https:\/\/other.com\"]} (length 0+)'+ ),]).describe(- 'Type of entity that can be referenced by entity properties.'+ 'Property value (service representation).\n\nRepresents the actual value stored for an entity property.\nThis is serialized to\/from JSONB in the database.'),]).optional(),- updated_at: zod.iso.datetime({}),}).describe(- 'Property definition model (service representation).'- ),- value: zod- .union([- zod.null(),- zod- .union([- zod- .object({- type: zod.enum(['Boolean']),- value: zod- .boolean()+ 'A property attached to a Soup item.\n\nThis is a simplified representation that includes only the definition and value,\nomitting the entity property assignment metadata and options.'+ )+ )+ .describe('Properties'),+ updatedAt: zod.iso+ .datetime({})+ .describe('The time the chat was last updated'),+ viewedAt: zod.iso+ .datetime({})+ .nullish()+ .describe('The time the chat was last viewed'),+ })+ .describe('A chat as displayed in Soup.'),+ tag: zod.enum(['chat']),+ })+ .describe('Chat item.'),+ zod+ .object({+ data: zod+ .object({+ createdAt: zod.iso+ .datetime({})+ .describe('The time the project was created'),+ deletedAt: zod.iso+ .datetime({})+ .nullish()+ .describe('The time the project was deleted'),+ id: zod.uuid().describe('The id of the project'),+ name: zod.string().describe('The name of the project'),+ ownerId: zod+ .string()+ .describe('The user id of who created the project'),+ parentId: zod+ .uuid()+ .nullish()+ .describe('The parent project id'),+ properties: zod+ .array(+ zod+ .object({+ definition: zod+ .object({+ created_at: zod.iso.datetime({}),+ data_type: zod+ .enum([+ 'BOOLEAN',+ 'DATE',+ 'NUMBER',+ 'STRING',+ 'SELECT_NUMBER',+ 'SELECT_STRING',+ 'ENTITY',+ 'LINK',+ ])+ .describe(+ 'Data type for property values, determining storage and validation.'+ ),+ display_name: zod.string(),+ id: zod.uuid(),+ is_metadata: zod+ .boolean()+ .describe(+ 'Flag to indicate if this is a system-generated metadata property.\nNot stored in database - computed at service layer.'+ ),+ is_multi_select: zod.boolean(),+ is_system: zod+ .boolean()+ .describe(+ 'Flag to indicate if this is a system property (stored in DB).'+ ),+ owner: zod+ .union([+ zod+ .object({+ scope: zod.enum(['user']),+ user_id: zod.string(),+ }).describe(- 'Boolean value\nSerializes as: {\"type\": \"Boolean\", \"value\": true}'+ 'User-scoped property only'),- })+ zod+ .object({+ organization_id: zod.number(),+ scope: zod.enum(['organization']),+ })+ .describe(+ 'Organization-scoped property only'+ ),+ zod+ .object({+ organization_id: zod.number(),+ scope: zod.enum([+ 'user_and_organization',+ ]),+ user_id: zod.string(),+ })+ .describe(+ 'Both user and organization-scoped'+ ),+ zod+ .object({+ scope: zod.enum(['system']),+ })+ .describe(+ 'System-owned property (no user or org owner)'+ ),+ ]).describe(- 'Boolean value\nSerializes as: {\"type\": \"Boolean\", \"value\": true}'+ 'Defines who owns a property - user-scoped, org-scoped, system, or both user and org.'),+ specific_entity_type: zod+ .union([+ zod.null(),+ zod+ .enum([+ 'CHANNEL',+ 'CHAT',+ 'COMPANY',+ 'DOCUMENT',+ 'PROJECT',+ 'TASK',+ 'THREAD',+ 'USER',+ ])+ .describe(+ 'Type of entity that can be referenced by entity properties.'+ ),+ ])+ .optional(),+ updated_at: zod.iso.datetime({}),+ })+ .describe(+ 'Property definition model (service representation).'+ ),+ value: zod+ .union([+ zod.null(),zod- .object({- type: zod.enum(['Number']),- value: zod- .number()+ .union([+ zod+ .object({+ type: zod.enum(['Boolean']),+ value: zod+ .boolean()+ .describe(+ 'Boolean value\nSerializes as: {\"type\": \"Boolean\", \"value\": true}'+ ),+ })+ .describe(+ 'Boolean value\nSerializes as: {\"type\": \"Boolean\", \"value\": true}'+ ),+ zod+ .object({+ type: zod.enum(['Number']),+ value: zod+ .number()+ .describe(+ 'Numeric value\nSerializes as: {\"type\": \"Number\", \"value\": 42.5}'+ ),+ }).describe('Numeric value\nSerializes as: {\"type\": \"Number\", \"value\": 42.5}'),- })- .describe(- 'Numeric value\nSerializes as: {\"type\": \"Number\", \"value\": 42.5}'- ),- zod- .object({- type: zod.enum(['String']),- value: zod- .string()+ zod+ .object({+ type: zod.enum(['String']),+ value: zod+ .string()+ .describe(+ 'String value\nSerializes as: {\"type\": \"String\", \"value\": \"text\"}'+ ),+ }).describe('String value\nSerializes as: {\"type\": \"String\", \"value\": \"text\"}'),- })- .describe(- 'String value\nSerializes as: {\"type\": \"String\", \"value\": \"text\"}'- ),- zod- .object({- type: zod.enum(['Date']),- value: zod.iso- .datetime({})+ zod+ .object({+ type: zod.enum(['Date']),+ value: zod.iso+ .datetime({})+ .describe(+ 'Date\/timestamp value\nSerializes as: {\"type\": \"Date\", \"value\": \"2025-01-01T00:00:00Z\"}'+ ),+ }).describe('Date\/timestamp value\nSerializes as: {\"type\": \"Date\", \"value\": \"2025-01-01T00:00:00Z\"}'),- })- .describe(- 'Date\/timestamp value\nSerializes as: {\"type\": \"Date\", \"value\": \"2025-01-01T00:00:00Z\"}'- ),- zod- .object({- type: zod.enum(['SelectOption']),- value: zod- .array(zod.uuid())+ zod+ .object({+ type: zod.enum(['SelectOption']),+ value: zod+ .array(zod.uuid())+ .describe(+ 'Select option(s) - always an array (check is_multi_select to determine if single or multi)\nSingle-select: {\"type\": \"SelectOption\", \"value\": [\"uuid\"]} (length 0 or 1)\nMulti-select: {\"type\": \"SelectOption\", \"value\": [\"uuid1\", \"uuid2\", ...]} (length 0+)'+ ),+ }).describe('Select option(s) - always an array (check is_multi_select to determine if single or multi)\nSingle-select: {\"type\": \"SelectOption\", \"value\": [\"uuid\"]} (length 0 or 1)\nMulti-select: {\"type\": \"SelectOption\", \"value\": [\"uuid1\", \"uuid2\", ...]} (length 0+)'),- })- .describe(- 'Select option(s) - always an array (check is_multi_select to determine if single or multi)\nSingle-select: {\"type\": \"SelectOption\", \"value\": [\"uuid\"]} (length 0 or 1)\nMulti-select: {\"type\": \"SelectOption\", \"value\": [\"uuid1\", \"uuid2\", ...]} (length 0+)'- ),- zod- .object({- type: zod.enum(['EntityReference']),- value: zod- .array(- zod- .object({- entity_id: zod.string(),- entity_type: zod- .enum([- 'CHANNEL',- 'CHAT',- 'COMPANY',- 'DOCUMENT',- 'PROJECT',- 'TASK',- 'THREAD',- 'USER',- ])- .describe(- 'Type of entity that can be referenced by entity properties.'- ),- specific_message_id: zod- .uuid()- .nullish()+ zod+ .object({+ type: zod.enum(['EntityReference']),+ value: zod+ .array(+ zod+ .object({+ entity_id: zod.string(),+ entity_type: zod+ .enum([+ 'CHANNEL',+ 'CHAT',+ 'COMPANY',+ 'DOCUMENT',+ 'PROJECT',+ 'TASK',+ 'THREAD',+ 'USER',+ ])+ .describe(+ 'Type of entity that can be referenced by entity properties.'+ ),+ specific_message_id: zod+ .uuid()+ .nullish()+ .describe(+ 'For CHANNEL, CHAT, THREAD entity types - optional specific message ID.\nThis allows referencing a specific message within a thread\/channel\/chat.'+ ),+ }).describe(- 'For CHANNEL, CHAT, THREAD entity types - optional specific message ID.\nThis allows referencing a specific message within a thread\/channel\/chat.'- ),- })- .describe(- 'Entity reference for entity-type property values.'+ 'Entity reference for entity-type property values.'+ ))- )+ .describe(+ 'Entity reference(s) - always an array (check is_multi_select to determine if single or multi)\nSingle-select: {\"type\": \"EntityReference\", \"value\": [{...}]} (length 0 or 1)\nMulti-select: {\"type\": \"EntityReference\", \"value\": [{...}, {...}, ...]} (length 0+)'+ ),+ }).describe('Entity reference(s) - always an array (check is_multi_select to determine if single or multi)\nSingle-select: {\"type\": \"EntityReference\", \"value\": [{...}]} (length 0 or 1)\nMulti-select: {\"type\": \"EntityReference\", \"value\": [{...}, {...}, ...]} (length 0+)'),- })- .describe(- 'Entity reference(s) - always an array (check is_multi_select to determine if single or multi)\nSingle-select: {\"type\": \"EntityReference\", \"value\": [{...}]} (length 0 or 1)\nMulti-select: {\"type\": \"EntityReference\", \"value\": [{...}, {...}, ...]} (length 0+)'- ),- zod- .object({- type: zod.enum(['Link']),- value: zod- .array(zod.string())+ zod+ .object({+ type: zod.enum(['Link']),+ value: zod+ .array(zod.string())+ .describe(+ 'Link value(s) - always an array (check is_multi_select to determine if single or multi)\nSingle-select: {\"type\": \"Link\", \"value\": [\"https:\/\/example.com\"]} (length 0 or 1)\nMulti-select: {\"type\": \"Link\", \"value\": [\"https:\/\/example.com\", \"https:\/\/other.com\"]} (length 0+)'+ ),+ }).describe('Link value(s) - always an array (check is_multi_select to determine if single or multi)\nSingle-select: {\"type\": \"Link\", \"value\": [\"https:\/\/example.com\"]} (length 0 or 1)\nMulti-select: {\"type\": \"Link\", \"value\": [\"https:\/\/example.com\", \"https:\/\/other.com\"]} (length 0+)'),- })+ ]).describe(- 'Link value(s) - always an array (check is_multi_select to determine if single or multi)\nSingle-select: {\"type\": \"Link\", \"value\": [\"https:\/\/example.com\"]} (length 0 or 1)\nMulti-select: {\"type\": \"Link\", \"value\": [\"https:\/\/example.com\", \"https:\/\/other.com\"]} (length 0+)'+ 'Property value (service representation).\n\nRepresents the actual value stored for an entity property.\nThis is serialized to\/from JSONB in the database.'),])- .describe(- 'Property value (service representation).\n\nRepresents the actual value stored for an entity property.\nThis is serialized to\/from JSONB in the database.'- ),- ])- .optional(),- })- .describe(- 'A property attached to a Soup item.\n\nThis is a simplified representation that includes only the definition and value,\nomitting the entity property assignment metadata and options.'+ .optional(),+ })+ .describe(+ 'A property attached to a Soup item.\n\nThis is a simplified representation that includes only the definition and value,\nomitting the entity property assignment metadata and options.'+ ))+ .describe('Properties'),+ updatedAt: zod.iso+ .datetime({})+ .describe('The time the project was updated'),+ viewedAt: zod.iso+ .datetime({})+ .nullish()+ .describe('The time the document was last viewed'),+ })+ .describe('A project as displayed in Soup.'),+ tag: zod.enum(['project']),+ })+ .describe('Project item.'),+ zod+ .object({+ data: zod+ .object({+ createdAt: zod.iso+ .datetime({})+ .describe('Timestamp when the thread was created.'),+ id: zod.uuid().describe('Thread id.'),+ inboxVisible: zod+ .boolean()+ .describe(+ 'Whether the thread should appear in the inbox.'+ ),+ isDraft: zod+ .boolean()+ .describe('Whether the thread contains a draft.'),+ isImportant: zod+ .boolean()+ .describe('Whether the thread is marked important.'),+ isRead: zod+ .boolean()+ .describe('Whether the thread has been read.'),+ name: zod+ .string()+ .nullish()+ .describe('Thread display name or subject.'),+ ownerId: zod.string().describe('Owner user id.'),+ projectId: zod+ .string()+ .nullish()+ .describe('Project id associated with the thread.'),+ providerId: zod+ .string()+ .nullish()+ .describe('Provider-specific thread id.'),+ senderEmail: zod+ .string()+ .nullish()+ .describe('Sender email address for the preview.'),+ senderName: zod+ .string()+ .nullish()+ .describe('Sender display name for the preview.'),+ senderPhotoUrl: zod+ .string()+ .nullish()+ .describe('Sender photo URL for the preview.'),+ snippet: zod+ .string()+ .nullish()+ .describe('Thread snippet.'),+ sortTs: zod.iso+ .datetime({})+ .describe('Timestamp used for email thread sorting.'),+ updatedAt: zod.iso+ .datetime({})+ .describe(+ 'Timestamp when the thread was last updated.'+ ),+ viewedAt: zod.iso+ .datetime({})+ .nullish()+ .describe(+ 'Timestamp when the requesting user last viewed the thread.'+ ),+ })+ .describe(+ 'Email thread preview data as displayed in Soup.')- .describe('Properties'),- updatedAt: zod.iso- .datetime({})- .describe('The time the project was updated'),- viewedAt: zod.iso- .datetime({})- .nullish()- .describe('The time the document was last viewed'),- }),- tag: zod.enum(['project']),- }),- zod.object({- data: zod- .object({- createdAt: zod.iso.datetime({}),- id: zod.uuid(),- inboxVisible: zod.boolean(),- isDraft: zod.boolean(),- isImportant: zod.boolean(),- isRead: zod.boolean(),- name: zod.string().nullish(),- ownerId: zod.string(),- projectId: zod.string().nullish(),- providerId: zod.string().nullish(),- senderEmail: zod.string().nullish(),- senderName: zod.string().nullish(),- senderPhotoUrl: zod.string().nullish(),- snippet: zod.string().nullish(),- sortTs: zod.iso.datetime({}),- updatedAt: zod.iso.datetime({}),- viewedAt: zod.iso.datetime({}).nullish(),- })- .and(- zod.object({- attachments: zod.array(- zod.object({- contentId: zod.string().nullish(),- createdAt: zod.iso.datetime({}),- filename: zod.string().nullish(),- id: zod.uuid(),- messageId: zod.uuid(),- mimeType: zod.string().nullish(),- providerAttachmentId: zod.string().nullish(),- sizeBytes: zod.number().nullish(),- })- ),- labels: zod.array(- zod.object({- createdAt: zod.iso.datetime({}),- id: zod.uuid(),- labelListVisibility: zod.enum([- 'labelShow',- 'labelShowIfUnread',- 'labelHide',- ]),- linkId: zod.uuid(),- messageListVisibility: zod.enum(['show', 'hide']),- name: zod.string(),- providerLabelId: zod.string(),- type: zod.enum(['system', 'user']),- })- ),- participants: zod.array(- zod.object({- emailAddress: zod.string().nullish(),- id: zod.uuid(),- linkId: zod.uuid(),- name: zod.string().nullish(),- sfsPhotoUrl: zod.string().nullish(),- })- ),- properties: zod.array(- zod- .object({- definition: zod+ .and(+ zod.object({+ attachments: zod+ .array(+ zod+ .object({+ contentId: zod+ .string()+ .nullish()+ .describe(+ 'Content id for inline attachments.'+ ),+ createdAt: zod.iso+ .datetime({})+ .describe(+ 'Timestamp when the attachment was created.'+ ),+ filename: zod+ .string()+ .nullish()+ .describe('Attachment filename.'),+ id: zod.uuid().describe('Attachment id.'),+ messageId: zod+ .uuid()+ .describe(+ 'Message id that owns this attachment.'+ ),+ mimeType: zod+ .string()+ .nullish()+ .describe('Attachment MIME type.'),+ providerAttachmentId: zod+ .string()+ .nullish()+ .describe(+ 'Provider-specific attachment id.'+ ),+ sizeBytes: zod+ .number()+ .nullish()+ .describe('Attachment size in bytes.'),+ })+ .describe(+ 'An email attachment as displayed in Soup.'+ )+ )+ .describe('Attachments on the thread.'),+ labels: zod+ .array(+ zod.object({- created_at: zod.iso.datetime({}),- data_type: zod+ createdAt: zod.iso+ .datetime({})+ .describe(+ 'Timestamp when the label was created.'+ ),+ id: zod.uuid().describe('Label id.'),+ labelListVisibility: zod.enum([- 'BOOLEAN',- 'DATE',- 'NUMBER',- 'STRING',- 'SELECT_NUMBER',- 'SELECT_STRING',- 'ENTITY',- 'LINK',+ 'labelShow',+ 'labelShowIfUnread',+ 'labelHide',]).describe(- 'Data type for property values, determining storage and validation.'+ 'Gmail-style label list visibility.'+ ),+ linkId: zod+ .uuid()+ .describe(+ 'Connected account link id for the label.'+ ),+ messageListVisibility: zod+ .enum(['show', 'hide'])+ .describe(+ 'Gmail-style message list visibility for a label.'+ ),+ name: zod+ .string()+ .describe('Label display name.'),+ providerLabelId: zod+ .string()+ .describe('Provider-specific label id.'),+ type: zod+ .enum(['system', 'user'])+ .describe(+ 'Whether an email label is provider-created or user-created.'),- display_name: zod.string(),- id: zod.uuid(),- is_metadata: zod- .boolean()+ })+ .describe(+ 'An email label as displayed in Soup.'+ )+ )+ .describe('Labels attached to the thread.'),+ participants: zod+ .array(+ zod+ .object({+ emailAddress: zod+ .string()+ .nullish()+ .describe('Contact email address.'),+ id: zod.uuid().describe('Contact id.'),+ linkId: zod+ .uuid().describe(- 'Flag to indicate if this is a system-generated metadata property.\nNot stored in database - computed at service layer.'+ 'Connected account link id for the contact.'),- is_multi_select: zod.boolean(),- is_system: zod- .boolean()+ name: zod+ .string()+ .nullish()+ .describe('Contact display name.'),+ sfsPhotoUrl: zod+ .string()+ .nullish().describe(- 'Flag to indicate if this is a system property (stored in DB).'+ 'Contact photo URL from SFS, if available.'),- owner: zod- .union([- zod- .object({- scope: zod.enum(['user']),- user_id: zod.string(),- })- .describe('User-scoped property only'),- zod- .object({- organization_id: zod.number(),- scope: zod.enum(['organization']),- })+ })+ .describe(+ 'A contact participating in an email thread as displayed in Soup.'+ )+ )+ .describe('Contacts participating in the thread.'),+ properties: zod+ .array(+ zod+ .object({+ definition: zod+ .object({+ created_at: zod.iso.datetime({}),+ data_type: zod+ .enum([+ 'BOOLEAN',+ 'DATE',+ 'NUMBER',+ 'STRING',+ 'SELECT_NUMBER',+ 'SELECT_STRING',+ 'ENTITY',+ 'LINK',+ ]).describe(- 'Organization-scoped property only'+ 'Data type for property values, determining storage and validation.'),- zod- .object({- organization_id: zod.number(),- scope: zod.enum([- 'user_and_organization',- ]),- user_id: zod.string(),- })+ display_name: zod.string(),+ id: zod.uuid(),+ is_metadata: zod+ .boolean().describe(- 'Both user and organization-scoped'+ 'Flag to indicate if this is a system-generated metadata property.\nNot stored in database - computed at service layer.'),- zod- .object({- scope: zod.enum(['system']),- })+ is_multi_select: zod.boolean(),+ is_system: zod+ .boolean().describe(- 'System-owned property (no user or org owner)'+ 'Flag to indicate if this is a system property (stored in DB).'),- ])- .describe(- 'Defines who owns a property - user-scoped, org-scoped, system, or both user and org.'- ),- specific_entity_type: zod- .union([- zod.null(),- zod- .enum([- 'CHANNEL',- 'CHAT',- 'COMPANY',- 'DOCUMENT',- 'PROJECT',- 'TASK',- 'THREAD',- 'USER',+ owner: zod+ .union([+ zod+ .object({+ scope: zod.enum(['user']),+ user_id: zod.string(),+ })+ .describe(+ 'User-scoped property only'+ ),+ zod+ .object({+ organization_id: zod.number(),+ scope: zod.enum(['organization']),+ })+ .describe(+ 'Organization-scoped property only'+ ),+ zod+ .object({+ organization_id: zod.number(),+ scope: zod.enum([+ 'user_and_organization',+ ]),+ user_id: zod.string(),+ })+ .describe(+ 'Both user and organization-scoped'+ ),+ zod+ .object({+ scope: zod.enum(['system']),+ })+ .describe(+ 'System-owned property (no user or org owner)'+ ),]).describe(- 'Type of entity that can be referenced by entity properties.'+ 'Defines who owns a property - user-scoped, org-scoped, system, or both user and org.'),- ])- .optional(),- updated_at: zod.iso.datetime({}),- })- .describe(- 'Property definition model (service representation).'- ),- value: zod- .union([- zod.null(),- zod+ specific_entity_type: zod+ .union([+ zod.null(),+ zod+ .enum([+ 'CHANNEL',+ 'CHAT',+ 'COMPANY',+ 'DOCUMENT',+ 'PROJECT',+ 'TASK',+ 'THREAD',+ 'USER',+ ])+ .describe(+ 'Type of entity that can be referenced by entity properties.'+ ),+ ])+ .optional(),+ updated_at: zod.iso.datetime({}),+ })+ .describe(+ 'Property definition model (service representation).'+ ),+ value: zod.union([+ zod.null(),zod- .object({- type: zod.enum(['Boolean']),- value: zod- .boolean()+ .union([+ zod+ .object({+ type: zod.enum(['Boolean']),+ value: zod+ .boolean()+ .describe(+ 'Boolean value\nSerializes as: {\"type\": \"Boolean\", \"value\": true}'+ ),+ }).describe('Boolean value\nSerializes as: {\"type\": \"Boolean\", \"value\": true}'),- })- .describe(- 'Boolean value\nSerializes as: {\"type\": \"Boolean\", \"value\": true}'- ),- zod- .object({- type: zod.enum(['Number']),- value: zod- .number()+ zod+ .object({+ type: zod.enum(['Number']),+ value: zod+ .number()+ .describe(+ 'Numeric value\nSerializes as: {\"type\": \"Number\", \"value\": 42.5}'+ ),+ }).describe('Numeric value\nSerializes as: {\"type\": \"Number\", \"value\": 42.5}'),- })- .describe(- 'Numeric value\nSerializes as: {\"type\": \"Number\", \"value\": 42.5}'- ),- zod- .object({- type: zod.enum(['String']),- value: zod- .string()+ zod+ .object({+ type: zod.enum(['String']),+ value: zod+ .string()+ .describe(+ 'String value\nSerializes as: {\"type\": \"String\", \"value\": \"text\"}'+ ),+ }).describe('String value\nSerializes as: {\"type\": \"String\", \"value\": \"text\"}'),- })- .describe(- 'String value\nSerializes as: {\"type\": \"String\", \"value\": \"text\"}'- ),- zod- .object({- type: zod.enum(['Date']),- value: zod.iso- .datetime({})+ zod+ .object({+ type: zod.enum(['Date']),+ value: zod.iso+ .datetime({})+ .describe(+ 'Date\/timestamp value\nSerializes as: {\"type\": \"Date\", \"value\": \"2025-01-01T00:00:00Z\"}'+ ),+ }).describe('Date\/timestamp value\nSerializes as: {\"type\": \"Date\", \"value\": \"2025-01-01T00:00:00Z\"}'),- })- .describe(- 'Date\/timestamp value\nSerializes as: {\"type\": \"Date\", \"value\": \"2025-01-01T00:00:00Z\"}'- ),- zod- .object({- type: zod.enum(['SelectOption']),- value: zod- .array(zod.uuid())+ zod+ .object({+ type: zod.enum(['SelectOption']),+ value: zod+ .array(zod.uuid())+ .describe(+ 'Select option(s) - always an array (check is_multi_select to determine if single or multi)\nSingle-select: {\"type\": \"SelectOption\", \"value\": [\"uuid\"]} (length 0 or 1)\nMulti-select: {\"type\": \"SelectOption\", \"value\": [\"uuid1\", \"uuid2\", ...]} (length 0+)'+ ),+ }).describe('Select option(s) - always an array (check is_multi_select to determine if single or multi)\nSingle-select: {\"type\": \"SelectOption\", \"value\": [\"uuid\"]} (length 0 or 1)\nMulti-select: {\"type\": \"SelectOption\", \"value\": [\"uuid1\", \"uuid2\", ...]} (length 0+)'),- })- .describe(- 'Select option(s) - always an array (check is_multi_select to determine if single or multi)\nSingle-select: {\"type\": \"SelectOption\", \"value\": [\"uuid\"]} (length 0 or 1)\nMulti-select: {\"type\": \"SelectOption\", \"value\": [\"uuid1\", \"uuid2\", ...]} (length 0+)'- ),- zod- .object({- type: zod.enum(['EntityReference']),- value: zod- .array(- zod- .object({- entity_id: zod.string(),- entity_type: zod- .enum([- 'CHANNEL',- 'CHAT',- 'COMPANY',- 'DOCUMENT',- 'PROJECT',- 'TASK',- 'THREAD',- 'USER',- ])- .describe(- 'Type of entity that can be referenced by entity properties.'- ),- specific_message_id: zod- .uuid()- .nullish()+ zod+ .object({+ type: zod.enum([+ 'EntityReference',+ ]),+ value: zod+ .array(+ zod+ .object({+ entity_id: zod.string(),+ entity_type: zod+ .enum([+ 'CHANNEL',+ 'CHAT',+ 'COMPANY',+ 'DOCUMENT',+ 'PROJECT',+ 'TASK',+ 'THREAD',+ 'USER',+ ])+ .describe(+ 'Type of entity that can be referenced by entity properties.'+ ),+ specific_message_id: zod+ .uuid()+ .nullish()+ .describe(+ 'For CHANNEL, CHAT, THREAD entity types - optional specific message ID.\nThis allows referencing a specific message within a thread\/channel\/chat.'+ ),+ }).describe(- 'For CHANNEL, CHAT, THREAD entity types - optional specific message ID.\nThis allows referencing a specific message within a thread\/channel\/chat.'- ),- })- .describe(- 'Entity reference for entity-type property values.'+ 'Entity reference for entity-type property values.'+ ))- )+ .describe(+ 'Entity reference(s) - always an array (check is_multi_select to determine if single or multi)\nSingle-select: {\"type\": \"EntityReference\", \"value\": [{...}]} (length 0 or 1)\nMulti-select: {\"type\": \"EntityReference\", \"value\": [{...}, {...}, ...]} (length 0+)'+ ),+ }).describe('Entity reference(s) - always an array (check is_multi_select to determine if single or multi)\nSingle-select: {\"type\": \"EntityReference\", \"value\": [{...}]} (length 0 or 1)\nMulti-select: {\"type\": \"EntityReference\", \"value\": [{...}, {...}, ...]} (length 0+)'),- })- .describe(- 'Entity reference(s) - always an array (check is_multi_select to determine if single or multi)\nSingle-select: {\"type\": \"EntityReference\", \"value\": [{...}]} (length 0 or 1)\nMulti-select: {\"type\": \"EntityReference\", \"value\": [{...}, {...}, ...]} (length 0+)'- ),- zod- .object({- type: zod.enum(['Link']),- value: zod- .array(zod.string())+ zod+ .object({+ type: zod.enum(['Link']),+ value: zod+ .array(zod.string())+ .describe(+ 'Link value(s) - always an array (check is_multi_select to determine if single or multi)\nSingle-select: {\"type\": \"Link\", \"value\": [\"https:\/\/example.com\"]} (length 0 or 1)\nMulti-select: {\"type\": \"Link\", \"value\": [\"https:\/\/example.com\", \"https:\/\/other.com\"]} (length 0+)'+ ),+ }).describe('Link value(s) - always an array (check is_multi_select to determine if single or multi)\nSingle-select: {\"type\": \"Link\", \"value\": [\"https:\/\/example.com\"]} (length 0 or 1)\nMulti-select: {\"type\": \"Link\", \"value\": [\"https:\/\/example.com\", \"https:\/\/other.com\"]} (length 0+)'),- })+ ]).describe(- 'Link value(s) - always an array (check is_multi_select to determine if single or multi)\nSingle-select: {\"type\": \"Link\", \"value\": [\"https:\/\/example.com\"]} (length 0 or 1)\nMulti-select: {\"type\": \"Link\", \"value\": [\"https:\/\/example.com\", \"https:\/\/other.com\"]} (length 0+)'+ 'Property value (service representation).\n\nRepresents the actual value stored for an entity property.\nThis is serialized to\/from JSONB in the database.'),])- .describe(- 'Property value (service representation).\n\nRepresents the actual value stored for an entity property.\nThis is serialized to\/from JSONB in the database.'- ),- ])- .optional(),- })- .describe(- 'A property attached to a Soup item.\n\nThis is a simplified representation that includes only the definition and value,\nomitting the entity property assignment metadata and options.'+ .optional(),+ })+ .describe(+ 'A property attached to a Soup item.\n\nThis is a simplified representation that includes only the definition and value,\nomitting the entity property assignment metadata and options.'+ ))- ),+ .describe('Properties attached to the thread.'),+ })+ )+ .describe(+ 'Email thread preview enriched with related metadata for Soup.'+ ),+ tag: zod.enum(['emailThread']),+ })+ .describe('Email thread item.'),+ zod+ .object({+ data: zod+ .object({+ channel: zod+ .object({+ channel_type: zod+ .enum([+ 'public',+ 'private',+ 'direct_message',+ 'team',+ ])+ .describe('Type of channel.'),+ created_at: zod.iso+ .datetime({})+ .describe('Creation timestamp.'),+ id: zod.uuid().describe('Channel id.'),+ name: zod+ .string()+ .nullish()+ .describe('Channel display name.'),+ org_id: zod+ .number()+ .min(+ postItemsSoupAstGroupedResponseItemsDataChannelOrgIdMinOne+ )+ .nullish()+ .describe('Organization id.'),+ owner_id: zod.string().describe('Channel owner.'),+ team_id: zod.uuid().nullish().describe('Team id.'),+ updated_at: zod.iso+ .datetime({})+ .describe('Update timestamp.'),+ })+ .describe('Channel metadata in soup payloads.'),+ participants: zod+ .array(+ zod+ .object({+ channel_id: zod+ .uuid()+ .describe(+ 'Channel id for the participant membership.'+ ),+ joined_at: zod.iso+ .datetime({})+ .describe(+ 'Timestamp when the participant joined the channel.'+ ),+ left_at: zod.iso+ .datetime({})+ .nullish()+ .describe(+ 'Timestamp when the participant left the channel, if any.'+ ),+ role: zod+ .enum(['owner', 'admin', 'member'])+ .describe(+ 'The role a user has within a channel.'+ ),+ user_id: zod+ .string()+ .describe('Participant user id.'),+ })+ .describe("A user's membership in a channel.")+ )+ .describe('Participants in the channel.'),+ })+ .describe(+ 'Channel metadata together with its participants.'+ )+ .and(+ zod+ .object({+ latest_message: zod+ .union([+ zod.null(),+ zod+ .object({+ content: zod+ .string()+ .describe('Message content.'),+ created_at: zod.iso+ .datetime({})+ .describe('Creation timestamp.'),+ deleted_at: zod.iso+ .datetime({})+ .nullish()+ .describe('Deletion timestamp.'),+ mentions: zod+ .array(zod.string())+ .describe(+ 'Message mentions formatted as `{ENTITY_TYPE}:{ENTITY_ID}`.'+ ),+ message_id: zod+ .uuid()+ .describe('Message id.'),+ sender_id: zod+ .string()+ .describe('Sender id.'),+ thread_id: zod+ .uuid()+ .nullish()+ .describe('Thread parent id.'),+ updated_at: zod.iso+ .datetime({})+ .describe('Update timestamp.'),+ })+ .describe(+ 'Lightweight channel message for soup payloads.'+ ),+ ])+ .optional(),+ latest_non_thread_message: zod+ .union([+ zod.null(),+ zod+ .object({+ content: zod+ .string()+ .describe('Message content.'),+ created_at: zod.iso+ .datetime({})+ .describe('Creation timestamp.'),+ deleted_at: zod.iso+ .datetime({})+ .nullish()+ .describe('Deletion timestamp.'),+ mentions: zod+ .array(zod.string())+ .describe(+ 'Message mentions formatted as `{ENTITY_TYPE}:{ENTITY_ID}`.'+ ),+ message_id: zod+ .uuid()+ .describe('Message id.'),+ sender_id: zod+ .string()+ .describe('Sender id.'),+ thread_id: zod+ .uuid()+ .nullish()+ .describe('Thread parent id.'),+ updated_at: zod.iso+ .datetime({})+ .describe('Update timestamp.'),+ })+ .describe(+ 'Lightweight channel message for soup payloads.'+ ),+ ])+ .optional(),+ })+ .describe('Latest-message bundle for soup payloads.')+ )+ .and(+ zod.object({+ interacted_at: zod.iso+ .datetime({})+ .nullish()+ .describe(+ 'Timestamp when the requesting user last interacted with this channel.'+ ),+ viewed_at: zod.iso+ .datetime({})+ .nullish()+ .describe(+ 'Timestamp when the requesting user last viewed this channel.'+ ),+ })+ )+ .describe('A channel as displayed in Soup.'),+ tag: zod.enum(['channel']),+ })+ .describe('Channel item.'),+ zod+ .object({+ data: zod+ .object({+ channel_id: zod+ .uuid()+ .describe('Channel that owns the thread.'),+ messages: zod+ .array(+ zod+ .object({+ content: zod+ .string()+ .describe('Message content.'),+ created_at: zod.iso+ .datetime({})+ .describe('Creation timestamp.'),+ deleted_at: zod.iso+ .datetime({})+ .nullish()+ .describe('Deletion timestamp.'),+ mentions: zod+ .array(zod.string())+ .describe(+ 'Message mentions formatted as `{ENTITY_TYPE}:{ENTITY_ID}`.'+ ),+ message_id: zod.uuid().describe('Message id.'),+ sender_id: zod.string().describe('Sender id.'),+ thread_id: zod+ .uuid()+ .nullish()+ .describe('Thread parent id.'),+ updated_at: zod.iso+ .datetime({})+ .describe('Update timestamp.'),+ })+ .describe(+ 'Lightweight channel message for soup payloads.'+ )+ )+ .describe(+ 'Thread replies, using the same lightweight channel message shape.'+ ),+ root_message: zod+ .object({+ content: zod.string().describe('Message content.'),+ created_at: zod.iso+ .datetime({})+ .describe('Creation timestamp.'),+ deleted_at: zod.iso+ .datetime({})+ .nullish()+ .describe('Deletion timestamp.'),+ mentions: zod+ .array(zod.string())+ .describe(+ 'Message mentions formatted as `{ENTITY_TYPE}:{ENTITY_ID}`.'+ ),+ message_id: zod.uuid().describe('Message id.'),+ sender_id: zod.string().describe('Sender id.'),+ thread_id: zod+ .uuid()+ .nullish()+ .describe('Thread parent id.'),+ updated_at: zod.iso+ .datetime({})+ .describe('Update timestamp.'),+ })+ .describe(+ 'Lightweight channel message for soup payloads.'+ ),+ })+ .describe(+ 'A top-level channel message thread for soup payloads.\n\nThis reuses the existing lightweight [`ChannelMessage`] shape used by\n[`SoupChannel`] latest-message data.'+ ),+ tag: zod.enum(['channelThread']),+ })+ .describe('Channel thread item.'),+ zod+ .object({+ data: zod+ .object({+ attended: zod+ .boolean()+ .describe(+ 'Whether the requesting user attended this call. Kept for compatibility\nand derived from `status == ATTENDED`.'+ ),+ callId: zod.uuid().describe('The call identifier.'),+ channelId: zod+ .uuid()+ .describe('The channel this call belongs to.'),+ channelName: zod+ .string()+ .nullish()+ .describe('Resolved display name for the channel.'),+ createdBy: zod+ .string()+ .describe('User who created the call.'),+ customName: zod+ .string()+ .nullish()+ .describe(+ 'User-supplied or AI-generated display name for the call.'+ ),+ durationMs: zod+ .number()+ .nullish()+ .describe(+ 'Call duration in milliseconds (None if still active).'+ ),+ endedAt: zod.iso+ .datetime({})+ .nullish()+ .describe(+ 'When the call ended (None if still active).'+ ),+ isActive: zod+ .boolean()+ .describe('Whether the call is currently active.'),+ participants: zod+ .array(+ zod+ .object({+ joinedAt: zod.iso+ .datetime({})+ .describe('When the user joined the call.'),+ leftAt: zod.iso+ .datetime({})+ .nullish()+ .describe(+ 'When the user left (None if still in an active call).'+ ),+ userId: zod.string().describe('The user id.'),+ })+ .describe(+ 'A participant in a call record, as displayed in Soup.'+ )+ )+ .describe('Participants in the call.'),+ startedAt: zod.iso+ .datetime({})+ .describe('When the call started.'),+ status: zod+ .enum(['ATTENDED', 'MISSED', 'UNATTENDED'])+ .describe(+ 'Viewer-relative attendance status for a call record.\nSerializes as `ATTENDED`, `MISSED`, or `UNATTENDED`.'+ ),+ summary: zod+ .string()+ .nullish()+ .describe(+ 'AI-generated summary of the call. Only set on archived\n`call_records` once summarization has run; active calls always\nreturn `None`.'+ ),+ })+ .describe(+ 'A call record as displayed in Soup. Excludes room_name, egress_id,\nand transcript — fields that are irrelevant for the soup feed.'+ ),+ tag: zod.enum(['call']),+ })+ .describe('Call record item.'),+ zod+ .object({+ data: zod+ .object({+ createdAt: zod.iso+ .datetime({})+ .describe('When the company was created.'),+ description: zod+ .string()+ .nullish()+ .describe(+ "Display description from the primary domain's directory entry."+ ),+ domains: zod+ .array(+ zod+ .object({+ companyId: zod+ .uuid()+ .describe(+ 'The id of the company the domain belongs to.'+ ),+ createdAt: zod.iso+ .datetime({})+ .describe(+ 'When the domain record was created.'+ ),+ domain: zod+ .string()+ .describe(+ 'The domain (lowercased, e.g. \"acme.com\").'+ ),+ id: zod+ .uuid()+ .describe('The id of the domain record.'),+ })+ .describe(+ "A CRM domain as displayed in Soup. Mirrors the crm crate's\n[`CrmDomain`] with a stable wire shape that the FE can rely on."+ )+ )+ .describe(+ 'Domains associated with this company, ordered by creation time\nascending (primary first).'+ ),+ emailSync: zod+ .boolean()+ .describe(+ 'Whether email sync is enabled for this company.'+ ),+ hidden: zod+ .boolean()+ .describe(+ 'Whether the company is hidden from CRM listings. Soup filters\nthese out by default.'+ ),+ id: zod.uuid().describe('The id of the company.'),+ name: zod+ .string()+ .nullish()+ .describe(+ "Display name from the primary domain's directory entry, or\n`None` when unresolved."+ ),+ teamId: zod+ .uuid()+ .describe(+ 'The id of the team that owns this company record.'+ ),+ updatedAt: zod.iso+ .datetime({})+ .describe('When the company was last updated.'),+ viewedAt: zod.iso+ .datetime({})+ .nullish()+ .describe(+ 'When the requesting user last viewed this company, or `None` if\nnever viewed. Mirrors the `viewed_at` other soup entities carry.'+ ),})- ),- tag: zod.enum(['emailThread']),- }),- zod.object({- data: zod- .object({- channel: zod- .object({- channel_type: zod- .enum([- 'public',- 'private',- 'direct_message',- 'team',- ])- .describe('Type of channel.'),- created_at: zod.iso- .datetime({})- .describe('Creation timestamp.'),- id: zod.uuid().describe('Channel id.'),- name: zod- .string()- .nullish()- .describe('Channel display name.'),- org_id: zod- .number()- .min(- postItemsSoupAstGroupedResponseItemsDataChannelOrgIdMinOne- )- .nullish()- .describe('Organization id.'),- owner_id: zod.string().describe('Channel owner.'),- team_id: zod.uuid().nullish().describe('Team id.'),- updated_at: zod.iso- .datetime({})- .describe('Update timestamp.'),- })- .describe('Channel metadata in soup payloads.'),- participants: zod.array(- zod.object({- channel_id: zod.uuid(),- joined_at: zod.iso.datetime({}),- left_at: zod.iso.datetime({}).nullish(),- role: zod- .enum(['owner', 'admin', 'member'])- .describe('The role a user has within a channel.'),- user_id: zod.string(),- })+ .describe(+ 'A CRM company as displayed in Soup. Carries the core company\nfields plus display metadata resolved from `crm_domain_directory`\nagainst the primary (earliest-created) domain.'),- })- .and(- zod- .object({- latest_message: zod- .union([- zod.null(),- zod- .object({- content: zod- .string()- .describe('Message content.'),- created_at: zod.iso- .datetime({})- .describe('Creation timestamp.'),- deleted_at: zod.iso- .datetime({})- .nullish()- .describe('Deletion timestamp.'),- mentions: zod- .array(zod.string())- .describe(- 'Message mentions formatted as `{ENTITY_TYPE}:{ENTITY_ID}`.'- ),- message_id: zod- .uuid()- .describe('Message id.'),- sender_id: zod- .string()- .describe('Sender id.'),- thread_id: zod- .uuid()- .nullish()- .describe('Thread parent id.'),- updated_at: zod.iso- .datetime({})- .describe('Update timestamp.'),- })- .describe(- 'Lightweight channel message for soup payloads.'- ),- ])- .optional(),- latest_non_thread_message: zod- .union([- zod.null(),- zod- .object({- content: zod- .string()- .describe('Message content.'),- created_at: zod.iso- .datetime({})- .describe('Creation timestamp.'),- deleted_at: zod.iso- .datetime({})- .nullish()- .describe('Deletion timestamp.'),- mentions: zod- .array(zod.string())- .describe(- 'Message mentions formatted as `{ENTITY_TYPE}:{ENTITY_ID}`.'- ),- message_id: zod- .uuid()- .describe('Message id.'),- sender_id: zod- .string()- .describe('Sender id.'),- thread_id: zod- .uuid()- .nullish()- .describe('Thread parent id.'),- updated_at: zod.iso- .datetime({})- .describe('Update timestamp.'),- })- .describe(- 'Lightweight channel message for soup payloads.'- ),- ])- .optional(),- })- .describe('Latest-message bundle for soup payloads.')- )- .and(- zod.object({- interacted_at: zod.iso.datetime({}).nullish(),- viewed_at: zod.iso.datetime({}).nullish(),+ tag: zod.enum(['crmCompany']),+ })+ .describe('CRM company item.'),+ zod+ .object({+ data: zod+ .object({+ createdAt: zod.iso+ .datetime({})+ .describe('Timestamp when the record was created.'),+ foreignEntityId: zod+ .string()+ .describe(+ 'Identifier assigned by the external system.'+ ),+ foreignEntitySource: zod+ .string()+ .describe(+ 'Source system that owns the external identifier.'+ ),+ id: zod+ .uuid()+ .describe(+ 'Internal primary key for this foreign entity record.'+ ),+ metadata: zod+ .object({})+ .describe(+ 'Arbitrary metadata stored with the mapping.'+ ),+ storedForAuthEntity: zod+ .string()+ .describe(+ 'Internal auth entity namespace this foreign entity is stored for.'+ ),+ storedForId: zod+ .string()+ .describe(+ 'Internal entity identifier this foreign entity is stored for.'+ ),+ updatedAt: zod.iso+ .datetime({})+ .describe(+ 'Timestamp when the record was last updated.'+ ),})- ),- tag: zod.enum(['channel']),- }),- zod.object({- data: zod- .object({- attended: zod- .boolean()- .describe(- 'Whether the requesting user attended this call. Kept for compatibility\nand derived from `status == ATTENDED`.'- ),- callId: zod.uuid().describe('The call identifier.'),- channelId: zod- .uuid()- .describe('The channel this call belongs to.'),- channelName: zod- .string()- .nullish()- .describe('Resolved display name for the channel.'),- createdBy: zod- .string()- .describe('User who created the call.'),- customName: zod- .string()- .nullish()- .describe(- 'User-supplied or AI-generated display name for the call.'- ),- durationMs: zod- .number()- .nullish()- .describe(- 'Call duration in milliseconds (None if still active).'- ),- endedAt: zod.iso- .datetime({})- .nullish()- .describe(- 'When the call ended (None if still active).'- ),- isActive: zod- .boolean()- .describe('Whether the call is currently active.'),- participants: zod- .array(- zod- .object({- joinedAt: zod.iso- .datetime({})- .describe('When the user joined the call.'),- leftAt: zod.iso- .datetime({})- .nullish()- .describe(- 'When the user left (None if still in an active call).'- ),- userId: zod.string().describe('The user id.'),- })- .describe(- 'A participant in a call record, as displayed in Soup.'- )- )- .describe('Participants in the call.'),- startedAt: zod.iso- .datetime({})- .describe('When the call started.'),- status: zod- .enum(['ATTENDED', 'MISSED', 'UNATTENDED'])- .describe(- 'Viewer-relative attendance status for a call record.\nSerializes as `ATTENDED`, `MISSED`, or `UNATTENDED`.'- ),- summary: zod- .string()- .nullish()- .describe(- 'AI-generated summary of the call. Only set on archived\n`call_records` once summarization has run; active calls always\nreturn `None`.'- ),- })- .describe(- 'A call record as displayed in Soup. Excludes room_name, egress_id,\nand transcript — fields that are irrelevant for the soup feed.'- ),- tag: zod.enum(['call']),- }),- zod.object({- data: zod- .object({- createdAt: zod.iso- .datetime({})- .describe('When the company was created.'),- description: zod- .string()- .nullish()- .describe(- "Display description from the primary domain's directory entry."- ),- domains: zod- .array(- zod- .object({- companyId: zod- .uuid()- .describe(- 'The id of the company the domain belongs to.'- ),- createdAt: zod.iso- .datetime({})- .describe(- 'When the domain record was created.'- ),- domain: zod- .string()- .describe(- 'The domain (lowercased, e.g. \"acme.com\").'- ),- id: zod- .uuid()- .describe('The id of the domain record.'),- })- .describe(- "A CRM domain as displayed in Soup. Mirrors the crm crate's\n[`CrmDomain`] with a stable wire shape that the FE can rely on."- )- )- .describe(- 'Domains associated with this company, ordered by creation time\nascending (primary first).'- ),- emailSync: zod- .boolean()- .describe(- 'Whether email sync is enabled for this company.'- ),- hidden: zod- .boolean()- .describe(- 'Whether the company is hidden from CRM listings. Soup filters\nthese out by default.'- ),- id: zod.uuid().describe('The id of the company.'),- name: zod- .string()- .nullish()- .describe(- "Display name from the primary domain's directory entry, or\n`None` when unresolved."- ),- teamId: zod- .uuid()- .describe(- 'The id of the team that owns this company record.'- ),- updatedAt: zod.iso- .datetime({})- .describe('When the company was last updated.'),- viewedAt: zod.iso- .datetime({})- .nullish()- .describe(- 'When the requesting user last viewed this company, or `None` if\nnever viewed. Mirrors the `viewed_at` other soup entities carry.'- ),- })- .describe(- 'A CRM company as displayed in Soup. Carries the core company\nfields plus display metadata resolved from `crm_domain_directory`\nagainst the primary (earliest-created) domain.'- ),- tag: zod.enum(['crmCompany']),- }),- zod.object({- data: zod- .object({- createdAt: zod.iso- .datetime({})- .describe('Timestamp when the record was created.'),- foreignEntityId: zod- .string()- .describe(- 'Identifier assigned by the external system.'- ),- foreignEntitySource: zod- .string()- .describe(- 'Source system that owns the external identifier.'- ),- id: zod- .uuid()- .describe(- 'Internal primary key for this foreign entity record.'- ),- metadata: zod- .object({})- .describe(- 'Arbitrary metadata stored with the mapping.'- ),- storedForAuthEntity: zod- .string()- .describe(- 'Internal auth entity namespace this foreign entity is stored for.'- ),- storedForId: zod- .string()- .describe(- 'Internal entity identifier this foreign entity is stored for.'- ),- updatedAt: zod.iso- .datetime({})- .describe(- 'Timestamp when the record was last updated.'- ),- })- .describe('A foreign entity record as displayed in Soup.'),- tag: zod.enum(['foreignEntity']),- }),+ .describe(+ 'A foreign entity record as displayed in Soup.'+ ),+ tag: zod.enum(['foreignEntity']),+ })+ .describe('Foreign entity item.'),])+ .describe('A single item in the Soup feed.').and(zod.object({frecency_score: zod.number(),}))+ .describe(+ 'API representation of a soup item with its frecency score.'+ )).describe('Items in this page, keyed by id. Ordering lives in `group.item_ids`.'@@ -14449,7 +15926,8 @@ export const postItemsSoupAstGroupedResponse = zodzod.object({mode: zod.enum(['group_page']),})- ),+ )+ .describe('Follow-up response for one specific group.'),]).describe('Response for grouped soup queries.');diff --git a/js/app/packages/service-clients/service-storage/openapi.json b/js/app/packages/service-clients/service-storage/openapi.jsonindex fc12b392e6..ad2c5d8c73 100644--- a/js/app/packages/service-clients/service-storage/openapi.json+++ b/js/app/packages/service-clients/service-storage/openapi.json@@ -9746,6 +9746,7 @@},"ApiEntityFilterAst": {"type": "object",+ "description": "Wire-format entity filter AST accepted by soup AST endpoints.","properties": {"callf": {"description": "the filters that should be applied to the call entity"@@ -10995,25 +10996,31 @@},"ChannelParticipant": {"type": "object",+ "description": "A user's membership in a channel.","required": ["channel_id", "user_id", "role", "joined_at"],"properties": {"channel_id": {"type": "string",- "format": "uuid"+ "format": "uuid",+ "description": "Channel id for the participant membership."},"joined_at": {"type": "string",- "format": "date-time"+ "format": "date-time",+ "description": "Timestamp when the participant joined the channel."},"left_at": {"type": ["string", "null"],- "format": "date-time"+ "format": "date-time",+ "description": "Timestamp when the participant left the channel, if any."},"role": {- "$ref": "#/components/schemas/ParticipantRole"+ "$ref": "#/components/schemas/ParticipantRole",+ "description": "Participant role in the channel."},"user_id": {- "type": "string"+ "type": "string",+ "description": "Participant user id."}}},@@ -11142,16 +11149,19 @@},"ChannelWithParticipants": {"type": "object",+ "description": "Channel metadata together with its participants.","required": ["channel", "participants"],"properties": {"channel": {- "$ref": "#/components/schemas/Channel"+ "$ref": "#/components/schemas/Channel",+ "description": "Channel metadata."},"participants": {"type": "array","items": {"$ref": "#/components/schemas/ChannelParticipant"- }+ },+ "description": "Participants in the channel."}}},@@ -15075,7 +15085,8 @@{"allOf": [{- "$ref": "#/components/schemas/GroupedSoupInitialPage"+ "$ref": "#/components/schemas/GroupedSoupInitialPage",+ "description": "Initial grouped response containing multiple groups."},{"type": "object",@@ -15087,12 +15098,14 @@}}}- ]+ ],+ "description": "Initial grouped response containing multiple groups."},{"allOf": [{- "$ref": "#/components/schemas/GroupedSoupGroupPage"+ "$ref": "#/components/schemas/GroupedSoupGroupPage",+ "description": "Follow-up response for one specific group."},{"type": "object",@@ -15104,7 +15117,8 @@}}}- ]+ ],+ "description": "Follow-up response for one specific group."}],"description": "Response for grouped soup queries."@@ -15392,6 +15406,7 @@},"Params": {"type": "object",+ "description": "Query parameters shared by soup endpoints.","properties": {"expand": {"type": ["boolean", "null"],@@ -16047,7 +16062,8 @@{"allOf": [{- "$ref": "#/components/schemas/PostGroupedSoupAstInitialRequest"+ "$ref": "#/components/schemas/PostGroupedSoupAstInitialRequest",+ "description": "Initial grouped soup request."},{"type": "object",@@ -16059,12 +16075,14 @@}}}- ]+ ],+ "description": "Initial grouped soup request."},{"allOf": [{- "$ref": "#/components/schemas/PostGroupedSoupAstGroupPageRequest"+ "$ref": "#/components/schemas/PostGroupedSoupAstGroupPageRequest",+ "description": "Request for a page within one group."},{"type": "object",@@ -16076,7 +16094,8 @@}}}- ]+ ],+ "description": "Request for a page within one group."}],"description": "Request body for grouped soup queries with AST filters."@@ -16170,7 +16189,8 @@}}}- ]+ ],+ "description": "Request body for the AST soup endpoint."},"PostSoupRequest": {"allOf": [@@ -16189,7 +16209,8 @@}}}- ]+ ],+ "description": "Request body for the typed soup endpoint."},"PostTypingRequest": {"type": "object",@@ -17163,10 +17184,12 @@}}}- ]+ ],+ "description": "API representation of a soup item with its frecency score."},"SoupApiSort": {"type": "string",+ "description": "Sort options accepted by non-grouped soup API endpoints.","enum": ["viewed_at","created_at",@@ -17177,35 +17200,44 @@},"SoupAttachment": {"type": "object",+ "description": "An email attachment as displayed in Soup.","required": ["id", "messageId", "createdAt"],"properties": {"contentId": {- "type": ["string", "null"]+ "type": ["string", "null"],+ "description": "Content id for inline attachments."},"createdAt": {"type": "string",- "format": "date-time"+ "format": "date-time",+ "description": "Timestamp when the attachment was created."},"filename": {- "type": ["string", "null"]+ "type": ["string", "null"],+ "description": "Attachment filename."},"id": {"type": "string",- "format": "uuid"+ "format": "uuid",+ "description": "Attachment id."},"messageId": {"type": "string",- "format": "uuid"+ "format": "uuid",+ "description": "Message id that owns this attachment."},"mimeType": {- "type": ["string", "null"]+ "type": ["string", "null"],+ "description": "Attachment MIME type."},"providerAttachmentId": {- "type": ["string", "null"]+ "type": ["string", "null"],+ "description": "Provider-specific attachment id."},"sizeBytes": {"type": ["integer", "null"],- "format": "int64"+ "format": "int64",+ "description": "Attachment size in bytes."}}},@@ -17309,28 +17341,57 @@"SoupChannel": {"allOf": [{- "$ref": "#/components/schemas/ChannelWithParticipants"+ "$ref": "#/components/schemas/ChannelWithParticipants",+ "description": "Channel metadata and participants."},{- "$ref": "#/components/schemas/LatestMessage"+ "$ref": "#/components/schemas/LatestMessage",+ "description": "Latest message metadata for the channel."},{"type": "object","properties": {"interacted_at": {"type": ["string", "null"],- "format": "date-time"+ "format": "date-time",+ "description": "Timestamp when the requesting user last interacted with this channel."},"viewed_at": {"type": ["string", "null"],- "format": "date-time"+ "format": "date-time",+ "description": "Timestamp when the requesting user last viewed this channel."}}}- ]+ ],+ "description": "A channel as displayed in Soup."+ },+ "SoupChannelThread": {+ "type": "object",+ "description": "A top-level channel message thread for soup payloads.\n\nThis reuses the existing lightweight [`ChannelMessage`] shape used by\n[`SoupChannel`] latest-message data.",+ "required": ["channel_id", "root_message", "messages"],+ "properties": {+ "channel_id": {+ "type": "string",+ "format": "uuid",+ "description": "Channel that owns the thread."+ },+ "messages": {+ "type": "array",+ "items": {+ "$ref": "#/components/schemas/ChannelMessage"+ },+ "description": "Thread replies, using the same lightweight channel message shape."+ },+ "root_message": {+ "$ref": "#/components/schemas/ChannelMessage",+ "description": "Top-level message that acts as the thread parent."+ }+ }},"SoupChat": {"type": "object",+ "description": "A chat as displayed in Soup.","required": ["id","name",@@ -17394,24 +17455,30 @@},"SoupContact": {"type": "object",+ "description": "A contact participating in an email thread as displayed in Soup.","required": ["id", "linkId"],"properties": {"emailAddress": {- "type": ["string", "null"]+ "type": ["string", "null"],+ "description": "Contact email address."},"id": {"type": "string",- "format": "uuid"+ "format": "uuid",+ "description": "Contact id."},"linkId": {"type": "string",- "format": "uuid"+ "format": "uuid",+ "description": "Connected account link id for the contact."},"name": {- "type": ["string", "null"]+ "type": ["string", "null"],+ "description": "Contact display name."},"sfsPhotoUrl": {- "type": ["string", "null"]+ "type": ["string", "null"],+ "description": "Contact photo URL from SFS, if available."}}},@@ -17506,6 +17573,7 @@},"SoupDocument": {"type": "object",+ "description": "A document as displayed in Soup.","required": ["id","documentVersionId",@@ -17635,6 +17703,7 @@},"SoupEmailThreadPreview": {"type": "object",+ "description": "Email thread preview data as displayed in Soup.","required": ["id","ownerId",@@ -17649,66 +17718,84 @@"properties": {"createdAt": {"type": "string",- "format": "date-time"+ "format": "date-time",+ "description": "Timestamp when the thread was created."},"id": {"type": "string",- "format": "uuid"+ "format": "uuid",+ "description": "Thread id."},"inboxVisible": {- "type": "boolean"+ "type": "boolean",+ "description": "Whether the thread should appear in the inbox."},"isDraft": {- "type": "boolean"+ "type": "boolean",+ "description": "Whether the thread contains a draft."},"isImportant": {- "type": "boolean"+ "type": "boolean",+ "description": "Whether the thread is marked important."},"isRead": {- "type": "boolean"+ "type": "boolean",+ "description": "Whether the thread has been read."},"name": {- "type": ["string", "null"]+ "type": ["string", "null"],+ "description": "Thread display name or subject."},"ownerId": {- "type": "string"+ "type": "string",+ "description": "Owner user id."},"projectId": {- "type": ["string", "null"]+ "type": ["string", "null"],+ "description": "Project id associated with the thread."},"providerId": {- "type": ["string", "null"]+ "type": ["string", "null"],+ "description": "Provider-specific thread id."},"senderEmail": {- "type": ["string", "null"]+ "type": ["string", "null"],+ "description": "Sender email address for the preview."},"senderName": {- "type": ["string", "null"]+ "type": ["string", "null"],+ "description": "Sender display name for the preview."},"senderPhotoUrl": {- "type": ["string", "null"]+ "type": ["string", "null"],+ "description": "Sender photo URL for the preview."},"snippet": {- "type": ["string", "null"]+ "type": ["string", "null"],+ "description": "Thread snippet."},"sortTs": {"type": "string",- "format": "date-time"+ "format": "date-time",+ "description": "Timestamp used for email thread sorting."},"updatedAt": {"type": "string",- "format": "date-time"+ "format": "date-time",+ "description": "Timestamp when the thread was last updated."},"viewedAt": {"type": ["string", "null"],- "format": "date-time"+ "format": "date-time",+ "description": "Timestamp when the requesting user last viewed the thread."}}},"SoupEnrichedEmailThreadPreview": {"allOf": [{- "$ref": "#/components/schemas/SoupEmailThreadPreview"+ "$ref": "#/components/schemas/SoupEmailThreadPreview",+ "description": "Base email thread preview."},{"type": "object",@@ -17718,29 +17805,34 @@"type": "array","items": {"$ref": "#/components/schemas/SoupAttachment"- }+ },+ "description": "Attachments on the thread."},"labels": {"type": "array","items": {"$ref": "#/components/schemas/SoupLabel"- }+ },+ "description": "Labels attached to the thread."},"participants": {"type": "array","items": {"$ref": "#/components/schemas/SoupContact"- }+ },+ "description": "Contacts participating in the thread."},"properties": {"type": "array","items": {"$ref": "#/components/schemas/SoupProperty"- }+ },+ "description": "Properties attached to the thread."}}}- ]+ ],+ "description": "Email thread preview enriched with related metadata for Soup."},"SoupForeignEntity": {"type": "object",@@ -17797,10 +17889,12 @@"oneOf": [{"type": "object",+ "description": "Document item.","required": ["data", "tag"],"properties": {"data": {- "$ref": "#/components/schemas/SoupDocument"+ "$ref": "#/components/schemas/SoupDocument",+ "description": "Document item."},"tag": {"type": "string",@@ -17810,10 +17904,12 @@},{"type": "object",+ "description": "Chat item.","required": ["data", "tag"],"properties": {"data": {- "$ref": "#/components/schemas/SoupChat"+ "$ref": "#/components/schemas/SoupChat",+ "description": "Chat item."},"tag": {"type": "string",@@ -17823,10 +17919,12 @@},{"type": "object",+ "description": "Project item.","required": ["data", "tag"],"properties": {"data": {- "$ref": "#/components/schemas/SoupProject"+ "$ref": "#/components/schemas/SoupProject",+ "description": "Project item."},"tag": {"type": "string",@@ -17836,10 +17934,12 @@},{"type": "object",+ "description": "Email thread item.","required": ["data", "tag"],"properties": {"data": {- "$ref": "#/components/schemas/SoupEnrichedEmailThreadPreview"+ "$ref": "#/components/schemas/SoupEnrichedEmailThreadPreview",+ "description": "Email thread item."},"tag": {"type": "string",@@ -17849,10 +17949,12 @@},{"type": "object",+ "description": "Channel item.","required": ["data", "tag"],"properties": {"data": {- "$ref": "#/components/schemas/SoupChannel"+ "$ref": "#/components/schemas/SoupChannel",+ "description": "Channel item."},"tag": {"type": "string",@@ -17862,10 +17964,27 @@},{"type": "object",+ "description": "Channel thread item.",+ "required": ["data", "tag"],+ "properties": {+ "data": {+ "$ref": "#/components/schemas/SoupChannelThread",+ "description": "Channel thread item."+ },+ "tag": {+ "type": "string",+ "enum": ["channelThread"]+ }+ }+ },+ {+ "type": "object",+ "description": "Call record item.","required": ["data", "tag"],"properties": {"data": {- "$ref": "#/components/schemas/SoupCallRecord"+ "$ref": "#/components/schemas/SoupCallRecord",+ "description": "Call record item."},"tag": {"type": "string",@@ -17875,10 +17994,12 @@},{"type": "object",+ "description": "CRM company item.","required": ["data", "tag"],"properties": {"data": {- "$ref": "#/components/schemas/SoupCrmCompany"+ "$ref": "#/components/schemas/SoupCrmCompany",+ "description": "CRM company item."},"tag": {"type": "string",@@ -17888,10 +18009,12 @@},{"type": "object",+ "description": "Foreign entity item.","required": ["data", "tag"],"properties": {"data": {- "$ref": "#/components/schemas/SoupForeignEntity"+ "$ref": "#/components/schemas/SoupForeignEntity",+ "description": "Foreign entity item."},"tag": {"type": "string",@@ -17899,10 +18022,12 @@}}}- ]+ ],+ "description": "A single item in the Soup feed."},"SoupLabel": {"type": "object",+ "description": "An email label as displayed in Soup.","required": ["id","linkId",@@ -17916,47 +18041,59 @@"properties": {"createdAt": {"type": "string",- "format": "date-time"+ "format": "date-time",+ "description": "Timestamp when the label was created."},"id": {"type": "string",- "format": "uuid"+ "format": "uuid",+ "description": "Label id."},"labelListVisibility": {- "$ref": "#/components/schemas/SoupLabelListVisibility"+ "$ref": "#/components/schemas/SoupLabelListVisibility",+ "description": "Label visibility in label lists."},"linkId": {"type": "string",- "format": "uuid"+ "format": "uuid",+ "description": "Connected account link id for the label."},"messageListVisibility": {- "$ref": "#/components/schemas/SoupMessageListVisibility"+ "$ref": "#/components/schemas/SoupMessageListVisibility",+ "description": "Label visibility in message lists."},"name": {- "type": "string"+ "type": "string",+ "description": "Label display name."},"providerLabelId": {- "type": "string"+ "type": "string",+ "description": "Provider-specific label id."},"type": {- "$ref": "#/components/schemas/SoupLabelType"+ "$ref": "#/components/schemas/SoupLabelType",+ "description": "Label type."}}},"SoupLabelListVisibility": {"type": "string",+ "description": "Gmail-style label list visibility.","enum": ["labelShow", "labelShowIfUnread", "labelHide"]},"SoupLabelType": {"type": "string",+ "description": "Whether an email label is provider-created or user-created.","enum": ["system", "user"]},"SoupMessageListVisibility": {"type": "string",+ "description": "Gmail-style message list visibility for a label.","enum": ["show", "hide"]},"SoupPage": {"type": "object",+ "description": "Response page for non-grouped soup endpoints.","required": ["items"],"properties": {"items": {@@ -17972,6 +18109,7 @@},"SoupProject": {"type": "object",+ "description": "A project as displayed in Soup.","required": ["id","name",diff --git a/js/app/tsconfig.json b/js/app/tsconfig.jsonindex d4d7af7cfc..d9430817f4 100644--- a/js/app/tsconfig.json+++ b/js/app/tsconfig.json@@ -54,6 +54,12 @@"composite": true,"incremental": true,"paths": {+ "loro-crdt": [+ "../node_modules/loro-crdt"+ ],+ "loro-crdt/*": [+ "../node_modules/loro-crdt/*"+ ],"@filesystem": ["./packages/filesystem/src"],diff --git a/rust/cloud-storage/entity_access/src/domain/service.rs b/rust/cloud-storage/entity_access/src/domain/service.rsindex 02e8cc4062..66381a7f7a 100644--- a/rust/cloud-storage/entity_access/src/domain/service.rs+++ b/rust/cloud-storage/entity_access/src/domain/service.rs@@ -191,8 +191,8 @@ where.map(|a| a.access_level)),// Static files are always viewable. This is wrong for ownersEntityType::StaticFile => Ok(Some(AccessLevel::View)),- // These entity types don't have access checks implemented yet.- EntityType::Team | EntityType::User => Ok(None),+ // These entity types either don't have access checks implemented yet, or they should not have access checks.+ EntityType::Team | EntityType::User | EntityType::ChannelMessage => Ok(None),}}diff --git a/rust/cloud-storage/entity_access_db_utils/src/lib.rs b/rust/cloud-storage/entity_access_db_utils/src/lib.rsindex fbaa62fd6a..c28d1a607c 100644--- a/rust/cloud-storage/entity_access_db_utils/src/lib.rs+++ b/rust/cloud-storage/entity_access_db_utils/src/lib.rs@@ -253,10 +253,15 @@ pub async fn update_entity_access_channel_share_permissions(EntityType::User| EntityType::Team| EntityType::Channel+ | EntityType::ChannelMessage| EntityType::StaticFile| EntityType::CrmCompany| EntityType::CrmContact- | EntityType::ForeignEntity => unreachable!(),+ | EntityType::ForeignEntity => {+ return Err(sqlx::Error::InvalidArgument(format!(+ "received unexpected entity type {entity_type:?}"+ )));+ }EntityType::Project => {// Get all items in projectlet project_items = get_nested_project_entities(transaction, entity_id).await?;@@ -312,10 +317,15 @@ pub async fn update_entity_access_channel_share_permissions(EntityType::User| EntityType::Team| EntityType::Channel+ | EntityType::ChannelMessage| EntityType::StaticFile| EntityType::CrmCompany| EntityType::CrmContact- | EntityType::ForeignEntity => unreachable!(),+ | EntityType::ForeignEntity => {+ return Err(sqlx::Error::InvalidArgument(format!(+ "Received invalid EntityType {entity_type:?}"+ )));+ }EntityType::Project => {// (a) Direct grant on the project itself (granted_from_project_id IS NULL)let mut qb: QueryBuilder<Postgres> = QueryBuilder::new(diff --git a/rust/cloud-storage/macro_db_client/src/item_access/delete.rs b/rust/cloud-storage/macro_db_client/src/item_access/delete.rsindex 307716debb..500fe10ca7 100644--- a/rust/cloud-storage/macro_db_client/src/item_access/delete.rs+++ b/rust/cloud-storage/macro_db_client/src/item_access/delete.rs@@ -36,6 +36,7 @@ pub async fn delete_user_entity_access_bulk(EntityType::User| EntityType::Team| EntityType::Channel+ | EntityType::ChannelMessage| EntityType::StaticFile| EntityType::CrmCompany| EntityType::CrmContactdiff --git a/rust/cloud-storage/model-entity/src/lib.rs b/rust/cloud-storage/model-entity/src/lib.rsindex f0469701e8..164bc8c1ec 100644--- a/rust/cloud-storage/model-entity/src/lib.rs+++ b/rust/cloud-storage/model-entity/src/lib.rs@@ -38,6 +38,8 @@ pub enum EntityType {Chat,/// The entity is a channel (slack-like) conversationChannel,+ /// The entity is a message in a channel+ ChannelMessage,/// The entity is a documentDocument,/// The entity is a collection of other entities@@ -65,7 +67,7 @@ impl EntityType {match self {EntityType::User => false,EntityType::Team => false,- EntityType::Channel => false,+ EntityType::Channel | EntityType::ChannelMessage => false,EntityType::Chat => true,EntityType::Document => true,EntityType::Project => true,diff --git a/rust/cloud-storage/models_soup/src/chat.rs b/rust/cloud-storage/models_soup/src/chat.rsindex 1c4838299a..cb3a9b828f 100644--- a/rust/cloud-storage/models_soup/src/chat.rs+++ b/rust/cloud-storage/models_soup/src/chat.rs@@ -5,6 +5,7 @@ use uuid::Uuid;use crate::SoupProperty;+/// A chat as displayed in Soup.#[derive(Serialize, Clone, Deserialize, Debug)]#[serde(rename_all = "camelCase")]#[cfg_attr(feature = "schema", derive(utoipa::ToSchema))]diff --git a/rust/cloud-storage/models_soup/src/comms.rs b/rust/cloud-storage/models_soup/src/comms.rsindex a046c7a966..fa6eb751ca 100644--- a/rust/cloud-storage/models_soup/src/comms.rs+++ b/rust/cloud-storage/models_soup/src/comms.rs@@ -101,135 +101,275 @@ pub struct LatestMessage {pub latest_non_thread_message: Option<ChannelMessage>,}+/// A channel as displayed in Soup.#[derive(Debug, Serialize, Deserialize)]#[cfg_attr(feature = "schema", derive(utoipa::ToSchema))]pub struct SoupChannel {+ /// Channel metadata and participants.#[serde(flatten)]pub channel: ChannelWithParticipants,+ /// Latest message metadata for the channel.#[serde(flatten)]pub latest_message: LatestMessage,+ /// Timestamp when the requesting user last viewed this channel.pub viewed_at: Option<chrono::DateTime<chrono::Utc>>,+ /// Timestamp when the requesting user last interacted with this channel.pub interacted_at: Option<chrono::DateTime<chrono::Utc>>,}+/// A top-level channel message thread for soup payloads.+///+/// This reuses the existing lightweight [`ChannelMessage`] shape used by+/// [`SoupChannel`] latest-message data.+#[derive(Debug, Serialize, Deserialize)]+#[cfg_attr(feature = "schema", derive(utoipa::ToSchema))]+pub struct SoupChannelThread {+ /// Channel that owns the thread.+ #[cfg_attr(feature = "schema", schema(value_type = Uuid))]+ pub channel_id: ChannelId,+ /// Top-level message that acts as the thread parent.+ pub root_message: ChannelMessage,+ /// Thread replies, using the same lightweight channel message shape.+ pub messages: Vec<ChannelMessage>,+}++impl SoupChannelThread {+ /// Latest update timestamp across the parent message and replies.+ pub fn updated_at(&self) -> chrono::DateTime<chrono::Utc> {+ self.messages+ .iter()+ .map(|message| message.updated_at)+ .max()+ .unwrap_or(self.root_message.updated_at)+ .max(self.root_message.updated_at)+ }+}++/// Channel metadata together with its participants.#[derive(Debug, Clone, Serialize, Deserialize)]#[cfg_attr(feature = "schema", derive(utoipa::ToSchema))]pub struct ChannelWithParticipants {+ /// Channel metadata.pub channel: Channel,+ /// Participants in the channel.pub participants: Vec<ChannelParticipant>,}+/// A user's membership in a channel.#[derive(Debug, Clone, Serialize, Deserialize)]#[cfg_attr(feature = "schema", derive(utoipa::ToSchema))]pub struct ChannelParticipant {+ /// Channel id for the participant membership.#[cfg_attr(feature = "schema", schema(value_type = Uuid))]pub channel_id: ChannelId,+ /// Participant user id.#[cfg_attr(feature = "schema", schema(value_type = String))]pub user_id: macro_user_id::user_id::MacroUserIdStr<'static>,+ /// Participant role in the channel.pub role: ParticipantRole,+ /// Timestamp when the participant joined the channel.pub joined_at: chrono::DateTime<chrono::Utc>,+ /// Timestamp when the participant left the channel, if any.pub left_at: Option<chrono::DateTime<chrono::Utc>>,}-fn channel_type_from_channels(channel_type: channels::domain::models::ChannelType) -> ChannelType {- match channel_type {- channels::domain::models::ChannelType::Public => ChannelType::Public,- channels::domain::models::ChannelType::Private => ChannelType::Private,- channels::domain::models::ChannelType::DirectMessage => ChannelType::DirectMessage,- channels::domain::models::ChannelType::Team => ChannelType::Team,+impl ChannelType {+ /// Converts a channels-domain channel type into the Soup channel type.+ pub fn new_from_channels(channel_type: channels::domain::models::ChannelType) -> Self {+ match channel_type {+ channels::domain::models::ChannelType::Public => Self::Public,+ channels::domain::models::ChannelType::Private => Self::Private,+ channels::domain::models::ChannelType::DirectMessage => Self::DirectMessage,+ channels::domain::models::ChannelType::Team => Self::Team,+ }}}-fn participant_role_from_channels(- role: channels::domain::models::ParticipantRole,-) -> ParticipantRole {- match role {- channels::domain::models::ParticipantRole::Owner => ParticipantRole::Owner,- channels::domain::models::ParticipantRole::Admin => ParticipantRole::Admin,- channels::domain::models::ParticipantRole::Member => ParticipantRole::Member,+impl ParticipantRole {+ /// Converts a channels-domain participant role into the Soup participant role.+ pub fn new_from_channels(role: channels::domain::models::ParticipantRole) -> Self {+ match role {+ channels::domain::models::ParticipantRole::Owner => Self::Owner,+ channels::domain::models::ParticipantRole::Admin => Self::Admin,+ channels::domain::models::ParticipantRole::Member => Self::Member,+ }}}-fn channel_message_from_channels(- message: channels::domain::models::RecentChannelMessage,-) -> ChannelMessage {- ChannelMessage {- message_id: message.message_id,- thread_id: message.thread_id,- sender_id: message.sender_id,- content: message.content,- created_at: message.created_at,- updated_at: message.updated_at,- deleted_at: message.deleted_at,- mentions: message.mentions,+impl Channel {+ /// Converts a channels-domain list item into Soup channel metadata.+ pub fn new_from_channels(channel: channels::domain::models::ChannelListItem) -> Self {+ Self {+ id: ChannelId(channel.id),+ name: channel.name,+ channel_type: ChannelType::new_from_channels(channel.channel_type),+ org_id: channel+ .org_id+ .and_then(|org_id| u32::try_from(org_id).ok())+ .map(OrganizationId),+ team_id: channel.team_id,+ created_at: channel.created_at,+ updated_at: channel.updated_at,+ owner_id: channel.owner_id,+ }}}-fn channel_from_channels(channel: channels::domain::models::ChannelListItem) -> Channel {- Channel {- id: ChannelId(channel.id),- name: channel.name,- channel_type: channel_type_from_channels(channel.channel_type),- org_id: channel- .org_id- .and_then(|org_id| u32::try_from(org_id).ok())- .map(OrganizationId),- team_id: channel.team_id,- created_at: channel.created_at,- updated_at: channel.updated_at,- owner_id: channel.owner_id,+impl ChannelMessage {+ /// Converts a channels-domain recent message into a Soup channel message.+ pub fn new_from_recent_channel_message(+ message: channels::domain::models::RecentChannelMessage,+ ) -> Self {+ Self {+ message_id: message.message_id,+ thread_id: message.thread_id,+ sender_id: message.sender_id,+ content: message.content,+ created_at: message.created_at,+ updated_at: message.updated_at,+ deleted_at: message.deleted_at,+ mentions: message.mentions,+ }+ }++ /// Converts a channels-domain channel message into a Soup channel message.+ pub fn new_from_channel_message(message: channels::domain::models::ChannelMessage) -> Self {+ Self {+ message_id: message.id,+ thread_id: None,+ sender_id: message.sender_id,+ content: message.content,+ created_at: message.created_at,+ updated_at: message.updated_at,+ deleted_at: message.deleted_at,+ mentions: Vec::new(),+ }}-}-fn latest_message_from_channels(- latest_message: channels::domain::models::LatestMessage,-) -> LatestMessage {- LatestMessage {- latest_message: latest_message- .latest_message- .map(channel_message_from_channels),- latest_non_thread_message: latest_message- .latest_non_thread_message- .map(channel_message_from_channels),+ /// Converts a channels-domain thread reply into a Soup channel message.+ pub fn new_from_thread_reply(+ parent_id: Uuid,+ reply: channels::domain::models::ThreadReply,+ ) -> Self {+ Self {+ message_id: reply.id,+ thread_id: Some(parent_id),+ sender_id: reply.sender_id,+ content: reply.content,+ created_at: reply.created_at,+ updated_at: reply.updated_at,+ deleted_at: None,+ mentions: Vec::new(),+ }}}-impl TryFrom<channels::domain::models::ChannelParticipant> for ChannelParticipant {- type Error = macro_user_id::error::ParseErr;+impl LatestMessage {+ /// Converts channels-domain latest message data into Soup latest message data.+ pub fn new_from_channels(latest_message: channels::domain::models::LatestMessage) -> Self {+ Self {+ latest_message: latest_message+ .latest_message+ .map(ChannelMessage::new_from_recent_channel_message),+ latest_non_thread_message: latest_message+ .latest_non_thread_message+ .map(ChannelMessage::new_from_recent_channel_message),+ }+ }+}- fn try_from(+impl ChannelParticipant {+ /// Converts a channels-domain participant into a Soup participant.+ pub fn try_new_from_channels(participant: channels::domain::models::ChannelParticipant,- ) -> Result<Self, Self::Error> {+ ) -> Result<Self, macro_user_id::error::ParseErr> {Ok(Self {channel_id: ChannelId(participant.channel_id),user_id: MacroUserIdStr::parse_from_str(&participant.user_id)?.into_owned(),- role: participant_role_from_channels(participant.role),+ role: ParticipantRole::new_from_channels(participant.role),joined_at: participant.joined_at,left_at: participant.left_at,})}}-impl From<channels::domain::models::ChannelWithParticipants> for ChannelWithParticipants {- fn from(channel: channels::domain::models::ChannelWithParticipants) -> Self {+impl ChannelWithParticipants {+ /// Converts channels-domain metadata and participants into the Soup shape.+ pub fn new_from_channels(channel: channels::domain::models::ChannelWithParticipants) -> Self {Self {- channel: channel_from_channels(channel.channel),+ channel: Channel::new_from_channels(channel.channel),participants: channel.participants.into_iter()- .filter_map(|participant| participant.try_into().ok())+ .filter_map(|participant| {+ ChannelParticipant::try_new_from_channels(participant).ok()+ }).collect(),}}}-impl From<channels::domain::models::ChannelWithLatest> for SoupChannel {- fn from(channel: channels::domain::models::ChannelWithLatest) -> Self {+impl SoupChannel {+ /// Converts channels-domain channel data with latest messages into Soup.+ pub fn new_from_channels(channel: channels::domain::models::ChannelWithLatest) -> Self {Self {- channel: channel.channel.into(),- latest_message: latest_message_from_channels(channel.latest_message),+ channel: ChannelWithParticipants::new_from_channels(channel.channel),+ latest_message: LatestMessage::new_from_channels(channel.latest_message),viewed_at: channel.viewed_at,interacted_at: channel.interacted_at,}}}++impl SoupChannelThread {+ /// Converts a channels-domain channel message with preview replies into a Soup thread.+ pub fn new_from_channel_message(message: channels::domain::models::ChannelMessage) -> Self {+ let channels::domain::models::ChannelMessage {+ id,+ channel_id,+ sender_id,+ content,+ created_at,+ updated_at,+ deleted_at,+ thread,+ ..+ } = message;+ let messages = thread+ .preview+ .into_iter()+ .map(|reply| ChannelMessage::new_from_thread_reply(id, reply))+ .collect();++ Self {+ channel_id: ChannelId(channel_id),+ root_message: ChannelMessage {+ message_id: id,+ thread_id: None,+ sender_id,+ content,+ created_at,+ updated_at,+ deleted_at,+ mentions: Vec::new(),+ },+ messages,+ }+ }++ /// Converts a channels-domain channel message and replies into a Soup thread.+ pub fn new_from_channel_message_and_replies(+ message: channels::domain::models::ChannelMessage,+ replies: Vec<channels::domain::models::ThreadReply>,+ ) -> Self {+ let parent_id = message.id;+ Self {+ channel_id: ChannelId(message.channel_id),+ root_message: ChannelMessage::new_from_channel_message(message),+ messages: replies+ .into_iter()+ .map(|reply| ChannelMessage::new_from_thread_reply(parent_id, reply))+ .collect(),+ }+ }+}diff --git a/rust/cloud-storage/models_soup/src/document.rs b/rust/cloud-storage/models_soup/src/document.rsindex e9824fa7e4..d6ac6a4b2a 100644--- a/rust/cloud-storage/models_soup/src/document.rs+++ b/rust/cloud-storage/models_soup/src/document.rs@@ -44,6 +44,7 @@ impl SoupDocumentSubType {}}+/// A document as displayed in Soup.#[derive(serde::Serialize, serde::Deserialize, Debug, Clone)]#[serde(rename_all = "camelCase")]#[cfg_attr(feature = "schema", derive(utoipa::ToSchema))]diff --git a/rust/cloud-storage/models_soup/src/email_thread.rs b/rust/cloud-storage/models_soup/src/email_thread.rsindex 914fe3cb91..eb2f4c9985 100644--- a/rust/cloud-storage/models_soup/src/email_thread.rs+++ b/rust/cloud-storage/models_soup/src/email_thread.rs@@ -6,116 +6,174 @@ use uuid::Uuid;use crate::SoupProperty;+/// A contact participating in an email thread as displayed in Soup.#[derive(Debug, Doppleganger, Serialize, Deserialize)]#[cfg_attr(feature = "schema", derive(utoipa::ToSchema))]#[cfg_attr(feature = "mock", derive(PartialEq, Eq))]#[dg(backward = email::domain::models::Contact)]#[serde(rename_all = "camelCase")]pub struct SoupContact {+ /// Contact id.pub id: Uuid,+ /// Connected account link id for the contact.pub link_id: Uuid,+ /// Contact display name.pub name: Option<String>,+ /// Contact email address.pub email_address: Option<String>,+ /// Contact photo URL from SFS, if available.pub sfs_photo_url: Option<String>,}+/// An email label as displayed in Soup.#[derive(Debug, Doppleganger, Serialize, Deserialize)]#[cfg_attr(feature = "schema", derive(utoipa::ToSchema))]#[cfg_attr(feature = "mock", derive(PartialEq, Eq))]#[dg(backward = email::domain::models::Label)]#[serde(rename_all = "camelCase")]pub struct SoupLabel {+ /// Label id.pub id: Uuid,+ /// Connected account link id for the label.pub link_id: Uuid,+ /// Provider-specific label id.pub provider_label_id: String,+ /// Label display name.pub name: String,+ /// Timestamp when the label was created.pub created_at: DateTime<Utc>,+ /// Label visibility in message lists.pub message_list_visibility: SoupMessageListVisibility,+ /// Label visibility in label lists.pub label_list_visibility: SoupLabelListVisibility,+ /// Label type.pub type_: SoupLabelType,}+/// Gmail-style message list visibility for a label.#[derive(Debug, Doppleganger, Serialize, Deserialize)]#[cfg_attr(feature = "schema", derive(utoipa::ToSchema))]#[cfg_attr(feature = "mock", derive(PartialEq, Eq))]#[dg(backward = email::domain::models::MessageListVisibility)]#[serde(rename_all = "camelCase")]pub enum SoupMessageListVisibility {+ /// Show the label in message lists.Show,+ /// Hide the label in message lists.Hide,}+/// Gmail-style label list visibility.#[derive(Debug, Doppleganger, Serialize, Deserialize)]#[cfg_attr(feature = "schema", derive(utoipa::ToSchema))]#[cfg_attr(feature = "mock", derive(PartialEq, Eq))]#[dg(backward = email::domain::models::LabelListVisibility)]#[serde(rename_all = "camelCase")]pub enum SoupLabelListVisibility {+ /// Always show the label in label lists.LabelShow,+ /// Show the label in label lists only when unread.LabelShowIfUnread,+ /// Hide the label in label lists.LabelHide,}+/// Whether an email label is provider-created or user-created.#[derive(Debug, Doppleganger, Serialize, Deserialize)]#[cfg_attr(feature = "schema", derive(utoipa::ToSchema))]#[cfg_attr(feature = "mock", derive(PartialEq, Eq))]#[dg(backward = email::domain::models::LabelType)]#[serde(rename_all = "camelCase")]pub enum SoupLabelType {+ /// System label created by the provider.System,+ /// User-created label.User,}+/// An email attachment as displayed in Soup.#[derive(Debug, Doppleganger, Serialize, Deserialize)]#[cfg_attr(feature = "schema", derive(utoipa::ToSchema))]#[cfg_attr(feature = "mock", derive(PartialEq, Eq))]#[dg(backward = email::domain::models::Attachment)]#[serde(rename_all = "camelCase")]pub struct SoupAttachment {+ /// Attachment id.pub id: Uuid,+ /// Message id that owns this attachment.pub message_id: Uuid,+ /// Provider-specific attachment id.pub provider_attachment_id: Option<String>,+ /// Attachment filename.pub filename: Option<String>,+ /// Attachment MIME type.pub mime_type: Option<String>,+ /// Attachment size in bytes.pub size_bytes: Option<i64>,+ /// Content id for inline attachments.pub content_id: Option<String>,+ /// Timestamp when the attachment was created.pub created_at: DateTime<Utc>,}+/// Email thread preview data as displayed in Soup.#[derive(Debug, Doppleganger, Serialize, Deserialize)]#[cfg_attr(feature = "schema", derive(utoipa::ToSchema))]#[cfg_attr(feature = "mock", derive(PartialEq, Eq))]#[dg(backward = email::domain::models::EmailThreadPreview)]#[serde(rename_all = "camelCase")]pub struct SoupEmailThreadPreview {+ /// Thread id.pub id: Uuid,+ /// Provider-specific thread id.pub provider_id: Option<String>,+ /// Owner user id.#[cfg_attr(feature = "schema", schema(value_type = String))]pub owner_id: MacroUserIdStr<'static>,+ /// Whether the thread should appear in the inbox.pub inbox_visible: bool,+ /// Whether the thread has been read.pub is_read: bool,+ /// Whether the thread contains a draft.pub is_draft: bool,+ /// Whether the thread is marked important.pub is_important: bool,+ /// Thread display name or subject.pub name: Option<String>,+ /// Thread snippet.pub snippet: Option<String>,+ /// Sender email address for the preview.pub sender_email: Option<String>,+ /// Sender display name for the preview.pub sender_name: Option<String>,+ /// Sender photo URL for the preview.pub sender_photo_url: Option<String>,+ /// Timestamp used for email thread sorting.pub sort_ts: DateTime<Utc>,+ /// Timestamp when the thread was created.pub created_at: DateTime<Utc>,+ /// Timestamp when the thread was last updated.pub updated_at: DateTime<Utc>,+ /// Timestamp when the requesting user last viewed the thread.pub viewed_at: Option<DateTime<Utc>>,+ /// Project id associated with the thread.pub project_id: Option<String>,}+/// Email thread preview enriched with related metadata for Soup.#[derive(Debug, Serialize, Deserialize)]#[cfg_attr(feature = "schema", derive(utoipa::ToSchema))]#[serde(rename_all = "camelCase")]pub struct SoupEnrichedEmailThreadPreview {+ /// Base email thread preview.#[serde(flatten)]pub thread: SoupEmailThreadPreview,+ /// Attachments on the thread.pub attachments: Vec<SoupAttachment>,+ /// Contacts participating in the thread.pub participants: Vec<SoupContact>,+ /// Labels attached to the thread.pub labels: Vec<SoupLabel>,+ /// Properties attached to the thread.pub properties: Vec<SoupProperty>,}diff --git a/rust/cloud-storage/models_soup/src/item.rs b/rust/cloud-storage/models_soup/src/item.rsindex bb63cdabec..c6c7c7b571 100644--- a/rust/cloud-storage/models_soup/src/item.rs+++ b/rust/cloud-storage/models_soup/src/item.rs@@ -4,7 +4,10 @@ use crate::document::SoupDocument;use crate::email_thread::SoupEnrichedEmailThreadPreview;use crate::foreign_entity::SoupForeignEntity;use crate::project::SoupProject;-use crate::{chat::SoupChat, comms::SoupChannel};+use crate::{+ chat::SoupChat,+ comms::{SoupChannel, SoupChannelThread},+};use chrono::{DateTime, Utc};use model_entity::{Entity, EntityType};use models_pagination::{Identify, SimpleSortMethod, SortOn};@@ -12,17 +15,28 @@ use models_properties::{EntityReference, EntityType as PropertiesEntityType};use serde::{Deserialize, Serialize};use uuid::Uuid;+/// A single item in the Soup feed.#[derive(Serialize, Deserialize, Debug)]#[serde(rename_all = "camelCase", tag = "tag", content = "data")]#[cfg_attr(feature = "schema", derive(utoipa::ToSchema))]pub enum SoupItem {+ /// Document item.Document(SoupDocument),+ /// Chat item.Chat(SoupChat),+ /// Project item.Project(SoupProject),+ /// Email thread item.EmailThread(SoupEnrichedEmailThreadPreview),+ /// Channel item.Channel(SoupChannel),+ /// Channel thread item.+ ChannelThread(SoupChannelThread),+ /// Call record item.Call(SoupCallRecord),+ /// CRM company item.CrmCompany(SoupCrmCompany),+ /// Foreign entity item.ForeignEntity(SoupForeignEntity),}@@ -45,6 +59,8 @@ impl SoupItem {SoupItem::Channel(channel) => {EntityType::Channel.with_entity_string(channel.channel.channel.id.0.to_string())}+ SoupItem::ChannelThread(thread) => EntityType::ChannelMessage+ .with_entity_string(thread.root_message.message_id.to_string()),SoupItem::Call(record) => {EntityType::Call.with_entity_string(record.call_id.to_string())}@@ -57,6 +73,7 @@ impl SoupItem {}}+ /// Returns the timestamp used as this item's update time.pub fn updated_at(&self) -> DateTime<Utc> {match self {SoupItem::Document(soup_document) => soup_document.updated_at,@@ -64,6 +81,7 @@ impl SoupItem {SoupItem::Project(soup_project) => soup_project.updated_at,SoupItem::EmailThread(soup_thread) => soup_thread.thread.updated_at,SoupItem::Channel(soup_channel) => soup_channel.channel.channel.updated_at,+ SoupItem::ChannelThread(thread) => thread.updated_at(),SoupItem::Call(record) => record.ended_at.unwrap_or(record.started_at),SoupItem::CrmCompany(company) => company.updated_at,SoupItem::ForeignEntity(foreign_entity) => foreign_entity.updated_at,@@ -124,6 +142,10 @@ impl SoupItem {(SoupItem::Channel(soup_channel), SimpleSortMethod::ViewedUpdated) => soup_channel.viewed_at.unwrap_or(soup_channel.channel.channel.updated_at),+ (SoupItem::ChannelThread(thread), SimpleSortMethod::CreatedAt) => {+ thread.root_message.created_at+ }+ (SoupItem::ChannelThread(thread), _) => thread.updated_at(),(SoupItem::Call(record), SimpleSortMethod::CreatedAt) => record.started_at,(SoupItem::Call(record), _) => record.ended_at.unwrap_or(record.started_at),(SoupItem::CrmCompany(company), SimpleSortMethod::CreatedAt) => company.created_at,@@ -152,6 +174,7 @@ impl Identify for SoupItem {SoupItem::Project(soup_project) => soup_project.id,SoupItem::EmailThread(thread) => thread.thread.id,SoupItem::Channel(soup_channel) => soup_channel.channel.channel.id.0,+ SoupItem::ChannelThread(thread) => thread.root_message.message_id,SoupItem::Call(record) => record.call_id,SoupItem::CrmCompany(company) => company.id,SoupItem::ForeignEntity(foreign_entity) => foreign_entity.id,@@ -196,6 +219,7 @@ impl SoupItem {PropertiesEntityType::Chat,)),SoupItem::Channel(_) => None,+ SoupItem::ChannelThread(_) => None,SoupItem::Call(_) => None,// CRM companies are not in entity_properties.SoupItem::CrmCompany(_) => None,diff --git a/rust/cloud-storage/models_soup/src/lib.rs b/rust/cloud-storage/models_soup/src/lib.rsindex 2d7812d998..e941f1190c 100644--- a/rust/cloud-storage/models_soup/src/lib.rs+++ b/rust/cloud-storage/models_soup/src/lib.rs@@ -1,12 +1,26 @@+//! Shared API models for the Soup feed.++#![deny(missing_docs)]++/// Call record models for Soup responses.pub mod call_record;+/// Chat models for Soup responses.pub mod chat;+/// Channel and channel message models for Soup responses.pub mod comms;+/// CRM company models for Soup responses.pub mod crm_company;+/// Document models for Soup responses.pub mod document;+/// Email thread models for Soup responses.pub mod email_thread;+/// Foreign entity models for Soup responses.pub mod foreign_entity;+/// Unified Soup feed item model.pub mod item;+/// Project models for Soup responses.pub mod project;+/// Property models attached to Soup items.pub mod properties;pub use properties::SoupProperty;diff --git a/rust/cloud-storage/models_soup/src/project.rs b/rust/cloud-storage/models_soup/src/project.rsindex d0b1af749a..013e24dc74 100644--- a/rust/cloud-storage/models_soup/src/project.rs+++ b/rust/cloud-storage/models_soup/src/project.rs@@ -5,6 +5,7 @@ use uuid::Uuid;use crate::SoupProperty;+/// A project as displayed in Soup.#[derive(Serialize, Clone, Deserialize, Debug)]#[serde(rename_all = "camelCase")]#[cfg_attr(feature = "schema", derive(utoipa::ToSchema))]diff --git a/rust/cloud-storage/soup/src/domain.rs b/rust/cloud-storage/soup/src/domain.rsindex 60276d3351..12fca29a0f 100644--- a/rust/cloud-storage/soup/src/domain.rs+++ b/rust/cloud-storage/soup/src/domain.rs@@ -1,5 +1,8 @@+/// Domain model types for soup requests, responses, grouping, and errors.pub mod models;#[cfg(feature = "ports")]+/// Domain traits implemented by soup repositories and services.pub mod ports;#[cfg(feature = "ports")]+/// Default soup service implementation.pub mod service;diff --git a/rust/cloud-storage/soup/src/domain/models.rs b/rust/cloud-storage/soup/src/domain/models.rsindex b48793b3c4..99e529b08f 100644--- a/rust/cloud-storage/soup/src/domain/models.rs+++ b/rust/cloud-storage/soup/src/domain/models.rs@@ -33,9 +33,12 @@ use non_empty::IsEmpty;use thiserror::Error;use uuid::Uuid;+/// Controls whether soup items should include expanded nested data.#[derive(Debug, Clone, Copy)]pub enum SoupType {+ /// Return fully expanded soup items.Expanded,+ /// Return compact soup items without expanded nested data.UnExpanded,}@@ -120,15 +123,21 @@ impl SimpleSortQuery {}}+/// Parameters for fetching soup items by an explicit ordered entity list.#[derive(Debug)]pub struct AdvancedSortParams<'a> {+ /// Entities to fetch and preserve in the requested order.pub entities: &'a [Entity<'a>],+ /// User whose accessible soup items should be fetched.pub user_id: MacroUserIdStr<'a>,}+/// Cursor or initial-sort query for a soup request.#[derive(Debug)]pub enum SoupQuery<T> {+ /// Query sorted by a simple timestamp-based method.Simple(SimpleQueryInner<T>),+ /// Query sorted by frecency.Frecency(FrecencyQueryInner<T>),}@@ -187,6 +196,7 @@ impl<T> SoupQuery<T> {SoupQuery::Frecency(FrecencyQueryInner(models_pagination::Query::Cursor(cursor)))}+ /// Returns the filter payload embedded in this query.pub fn filter(&self) -> &T {match self {SoupQuery::Simple(SimpleQueryInner(query)) => query.filter(),@@ -196,6 +206,7 @@ impl<T> SoupQuery<T> {}impl SoupQuery<EntityFilters> {+ /// Converts high-level entity filters into an AST-backed soup query.pub fn into_ast(self) -> Result<SoupQuery<Option<EntityFilterAst>>, ExpandErr> {match self {SoupQuery::Simple(SimpleQueryInner(query)) => Ok(SoupQuery::Simple(SimpleQueryInner(@@ -208,12 +219,18 @@ impl SoupQuery<EntityFilters> {}}+/// Request to fetch a page of soup items for a user.#[derive(Debug)]pub struct SoupRequest<T> {+ /// Whether to return expanded or unexpanded soup items.pub soup_type: SoupType,+ /// Maximum number of items to return.pub limit: u16,+ /// Initial query or pagination cursor to execute.pub cursor: SoupQuery<T>,+ /// User whose soup should be queried.pub user: MacroUserIdStr<'static>,+ /// Email preview view used when hydrating email soup items.pub email_preview_view: PreviewView,/// Every inbox the caller can read (own + delegated via macro_user_links)./// Empty when the caller has no inboxes — `build_email_request` returns@@ -645,22 +662,31 @@ pub struct GroupedSoupItem {pub group_display_order: Option<i32>,}+/// Errors returned while building or executing soup queries.#[derive(Debug, Error)]pub enum SoupErr {+ /// Frecency query failed.#[error(transparent)]FrecencyErr(#[from] FrecencyQueryErr),+ /// Soup repository query failed.#[error(transparent)]SoupDbErr(#[from] anyhow::Error),+ /// Email preview lookup failed.#[error(transparent)]EmailErr(#[from] email::domain::models::EmailErr),+ /// Channel or communication lookup failed.#[error("A comms error has occured, see logs for more details")]CommsErr,+ /// Call record lookup failed.#[error("A call error has occurred, see logs for more details")]CallErr,+ /// CRM lookup failed.#[error("A CRM error has occurred, see logs for more details")]CrmErr,+ /// Foreign entity lookup failed.#[error(transparent)]ForeignEntityErr(#[from] ForeignEntityError),+ /// Entity filter AST expansion failed.#[error(transparent)]AstErr(#[from] ExpandErr),}diff --git a/rust/cloud-storage/soup/src/domain/ports.rs b/rust/cloud-storage/soup/src/domain/ports.rsindex 35bd27b19a..6d5dabbe56 100644--- a/rust/cloud-storage/soup/src/domain/ports.rs+++ b/rust/cloud-storage/soup/src/domain/ports.rs@@ -8,24 +8,30 @@ use models_pagination::{Frecency, PaginatedCursor, SimpleSortMethod};use models_soup::item::SoupItem;use serde::Serialize;+/// Repository abstraction for loading soup items from storage.#[cfg_attr(test, mockall::automock(type Err = anyhow::Error;))]pub trait SoupRepo: Send + Sync + 'static {+ /// Error returned by repository operations.type Err;+ /// Fetch expanded soup items for a simple sorted cursor query.fn expanded_generic_cursor_soup<'a>(&self,req: SimpleSortRequest<'a>,) -> impl Future<Output = Result<Vec<SoupItem>, Self::Err>> + Send;+ /// Fetch unexpanded soup items for a simple sorted cursor query.fn unexpanded_generic_cursor_soup<'a>(&self,req: SimpleSortRequest<'a>,) -> impl Future<Output = Result<Vec<SoupItem>, Self::Err>> + Send;+ /// Fetch expanded soup items for an explicit list of entity ids.fn expanded_soup_by_ids<'a>(&self,req: AdvancedSortParams<'a>,) -> impl Future<Output = Result<Vec<SoupItem>, Self::Err>> + Send;+ /// Fetch unexpanded soup items for an explicit list of entity ids.fn unexpanded_soup_by_ids<'a>(&self,req: AdvancedSortParams<'a>,@@ -55,6 +61,7 @@ pub type SoupOutput<T> = Either<PaginatedCursor<FrecencySoupItem, String, Frecency, T>,>;+/// Service abstraction for executing user-facing soup queries.pub trait SoupService: Send + Sync + 'static {/// Run a soup query for the authenticated user.///@@ -71,6 +78,7 @@ pub trait SoupService: Send + Sync + 'static {SoupRequest<T>: IntoSoupReqAst,T: Clone + Serialize + Send;+ /// Run a grouped soup query for the authenticated user.fn get_user_soup_grouped(&self,req: GroupedSortRequest<'_>,diff --git a/rust/cloud-storage/soup/src/domain/service.rs b/rust/cloud-storage/soup/src/domain/service.rsindex f107fe0d77..5165097cf9 100644--- a/rust/cloud-storage/soup/src/domain/service.rs+++ b/rust/cloud-storage/soup/src/domain/service.rs@@ -90,6 +90,7 @@ whereCrm: CrmService,F: ForeignEntityService,{+ /// Creates a soup service from its repository and dependent domain services.pub fn new(soup_storage: T,frecency: U,@@ -389,7 +390,7 @@ where.map(|r| {r.into_iter().map(|mut c| {let frecency_score = c.frecency_score.take();- let soup_channel = SoupChannel::from(c);+ let soup_channel = SoupChannel::new_from_channels(c);FrecencySoupItem {item: SoupItem::Channel(soup_channel),frecency_score,diff --git a/rust/cloud-storage/soup/src/inbound.rs b/rust/cloud-storage/soup/src/inbound.rsindex c92ecdd06c..3eb3a34905 100644--- a/rust/cloud-storage/soup/src/inbound.rs+++ b/rust/cloud-storage/soup/src/inbound.rs@@ -1,4 +1,6 @@#[cfg(feature = "axum")]+/// Axum router and request/response types for soup endpoints.pub mod axum_router;#[cfg(feature = "ai_tools")]+/// AI tool definitions backed by soup queries.pub mod toolset;diff --git a/rust/cloud-storage/soup/src/inbound/axum_router.rs b/rust/cloud-storage/soup/src/inbound/axum_router.rsindex 46649d4f37..a36e3d7efd 100644--- a/rust/cloud-storage/soup/src/inbound/axum_router.rs+++ b/rust/cloud-storage/soup/src/inbound/axum_router.rs@@ -65,6 +65,7 @@ use uuid::Uuid;#[cfg(test)]mod tests;+/// Query parameters shared by soup endpoints.#[derive(Debug, Default, serde::Deserialize, IntoParams, ToSchema)]#[into_params(parameter_in = Query)]pub struct Params {@@ -79,13 +80,19 @@ pub struct Params {sort_method: Option<SoupApiSort>,}+/// Sort options accepted by non-grouped soup API endpoints.#[derive(Debug, Deserialize, utoipa::ToSchema)]#[serde(rename_all = "snake_case")]pub enum SoupApiSort {+ /// Sort by last viewed time.ViewedAt,+ /// Sort by creation time.CreatedAt,+ /// Sort by last update time.UpdatedAt,+ /// Sort by viewed and updated activity.ViewedUpdated,+ /// Sort by frecency score.Frecency,}@@ -105,9 +112,13 @@ impl SoupApiSort {#[derive(Debug, Deserialize, utoipa::ToSchema)]#[serde(rename_all = "snake_case")]pub enum GroupedSoupSort {+ /// Sort by last viewed time.ViewedAt,+ /// Sort by creation time.CreatedAt,+ /// Sort by last update time.UpdatedAt,+ /// Sort by viewed and updated activity.ViewedUpdated,}@@ -299,6 +310,7 @@ impl From<GroupMeta> for ApiGroupMeta {}}+/// Response page for non-grouped soup endpoints.#[derive(Debug, Serialize, utoipa::ToSchema)]pub struct SoupPage {items: Vec<SoupApiItem>,@@ -330,7 +342,9 @@ pub struct GroupedSoupGroupPage {#[derive(Debug, Serialize, ToSchema)]#[serde(tag = "mode", rename_all = "snake_case")]pub enum GroupedSoupPage {+ /// Initial grouped response containing multiple groups.Initial(GroupedSoupInitialPage),+ /// Follow-up response for one specific group.GroupPage(GroupedSoupGroupPage),}@@ -339,6 +353,7 @@ struct ApiGroupedSoupParts {groups: Vec<ApiGroupMeta>,}+/// Shared state for soup API routes.pub struct SoupRouterState<T, U, EAS> {service: Arc<T>,email: EmailRouterState<U>,@@ -373,6 +388,7 @@ whereU: EmailService,EAS: entity_access::domain::ports::EntityAccessService,{+ /// Creates router state from the soup service, email service, and entity access service.pub fn new(service: T, email: U, entity_access_service: Arc<EAS>) -> Self {SoupRouterState {service: Arc::new(service),@@ -572,6 +588,7 @@ fn ast_requests_crm_admin(expr: &Expr<CrmCompanyLiteral>) -> bool {}}+/// Builds the Axum router for soup HTTP endpoints.pub fn soup_router<T, U, EAS, S>(state: SoupRouterState<T, U, EAS>) -> Router<S>whereT: SoupService,@@ -587,6 +604,7 @@ where.with_state(state)}+/// API representation of a soup item with its frecency score.#[derive(Debug, Serialize, utoipa::ToSchema)]pub struct SoupApiItem {#[serde(flatten)]@@ -609,18 +627,25 @@ impl SoupApiItem {}}+/// Errors returned by soup HTTP handlers.#[derive(Debug, Error)]pub enum SoupHandlerErr {+ /// Internal soup service error.#[error("An internal server error has occurred")]Internal(SoupErr),+ /// Internal email service error.#[error("An internal email server error has occurred")]EmailErr(#[from] EmailErr),+ /// Invalid filter AST expansion.#[error("Invalid filter arguments provided")]ExpandErr(ExpandErr),+ /// Invalid compound filter expansion.#[error("Invalid compound filter could not be expanded")]Expand,+ /// CRM-scoped query was requested without team membership.#[error("CRM-scoped queries require team membership")]CrmScopeForbidden,+ /// Hidden CRM company query was requested without admin privileges.#[error("Querying hidden CRM companies requires admin/owner team role")]CrmAdminRequired,}@@ -721,6 +746,7 @@ where.await}+/// Request body for the typed soup endpoint.#[derive(Debug, Deserialize, ToSchema)]#[serde(rename_all = "camelCase")]pub struct PostSoupRequest {@@ -795,6 +821,7 @@ where.await}+/// Request body for the AST soup endpoint.#[derive(Debug, Deserialize, ToSchema)]#[serde(rename_all = "camelCase")]pub struct PostSoupAstRequest {@@ -887,7 +914,9 @@ pub struct PostGroupedSoupAstGroupPageRequest {#[derive(Debug, Deserialize, ToSchema)]#[serde(tag = "mode", rename_all = "snake_case")]pub enum PostGroupedSoupAstRequest {+ /// Initial grouped soup request.Initial(PostGroupedSoupAstInitialRequest),+ /// Request for a page within one group.GroupPage(PostGroupedSoupAstGroupPageRequest),}@@ -998,6 +1027,7 @@ fn require_crm_admin_role(Ok(())}+/// Wire-format entity filter AST accepted by soup AST endpoints.#[derive(Debug, Default, Serialize, Deserialize, Clone, ToSchema)]pub struct ApiEntityFilterAst {/// the filters that should be applied to the document entity@@ -1054,15 +1084,20 @@ pub struct ApiEntityFilterAst {pub email_crm_addresses: Vec<String>,}+/// Document literal accepted by the soup AST API.#[derive(Debug, Serialize, Deserialize, Clone)]#[serde(untagged)]pub enum ApiDocumentLiteral {+ /// A plain document filter literal.Plain(DocumentLiteral),+ /// A compound literal for document file associations.FileAssoc(CompoundDocumentLiteral),}+/// Compound document filter literal accepted by the soup AST API.#[derive(Debug, Serialize, Deserialize, Clone)]pub enum CompoundDocumentLiteral {+ /// Match documents associated with a file id.#[serde(rename = "fa")]FileAssoc(String),}diff --git a/rust/cloud-storage/soup/src/inbound/toolset/list_entities.rs b/rust/cloud-storage/soup/src/inbound/toolset/list_entities.rsindex f14a2a6bef..a7db085d53 100644--- a/rust/cloud-storage/soup/src/inbound/toolset/list_entities.rs+++ b/rust/cloud-storage/soup/src/inbound/toolset/list_entities.rs@@ -32,12 +32,16 @@ use super::SoupToolContext;const RESULT_LIMIT: u16 = 50;const MAX_RESULT_LIMIT: u16 = 500;+/// Sort order for the list entities AI tool.#[derive(Debug, Clone, Copy, Default, Deserialize, JsonSchema)]#[serde(rename_all = "snake_case")]pub enum SortBy {+ /// Sort by most recently viewed.RecentlyViewed,+ /// Sort by most recently updated.#[default]RecentlyUpdated,+ /// Sort by most recently created.RecentlyCreated,}@@ -68,38 +72,96 @@ impl EmailPreset {}}+/// Entity types that can be returned by the list entities AI tool.#[derive(Debug, Clone, Copy, Deserialize, JsonSchema, PartialEq, Eq)]#[serde(rename_all = "snake_case")]pub enum ItemType {+ /// Macro document.Document,+ /// AI chat conversation.AiChat,+ /// Macro project.Project,+ /// Email thread.Email,+ /// Chat channel.Channel,+ /// Call record.Call,+ /// Foreign entity record.ForeignEntity,}+/// Item returned by the list entities AI tool.#[derive(Debug, Serialize, JsonSchema)]#[serde(rename_all = "camelCase", tag = "type")]pub enum EntityItem {+ /// Macro document item.#[serde(rename_all = "camelCase")]- Document { id: Uuid, name: String },+ Document {+ /// Document id.+ id: Uuid,+ /// Document name.+ name: String,+ },+ /// AI chat item.#[serde(rename_all = "camelCase")]- AiChat { id: Uuid, name: String },+ AiChat {+ /// Chat id.+ id: Uuid,+ /// Chat name.+ name: String,+ },+ /// Project item.#[serde(rename_all = "camelCase")]- Project { id: Uuid, name: String },+ Project {+ /// Project id.+ id: Uuid,+ /// Project name.+ name: String,+ },+ /// Email thread item.#[serde(rename_all = "camelCase")]- Email { id: Uuid, subject: Option<String> },+ Email {+ /// Email thread id.+ id: Uuid,+ /// Email subject, when present.+ subject: Option<String>,+ },+ /// Channel item.#[serde(rename_all = "camelCase")]- Channel { id: Uuid, name: Option<String> },+ Channel {+ /// Channel id.+ id: Uuid,+ /// Channel name, when present.+ name: Option<String>,+ },+ /// Channel thread item.#[serde(rename_all = "camelCase")]- Call { id: Uuid, created_by: String },+ ChannelThread {+ /// Parent message id for the thread.+ id: Uuid,+ /// Channel id containing the thread.+ channel_id: Uuid,+ },+ /// Call record item.+ #[serde(rename_all = "camelCase")]+ Call {+ /// Call id.+ id: Uuid,+ /// User or actor that created the call.+ created_by: String,+ },+ /// Foreign entity item.#[serde(rename_all = "camelCase")]ForeignEntity {+ /// Foreign entity row id.id: Uuid,+ /// Provider-specific foreign entity id.foreign_entity_id: String,+ /// Provider/source name for the foreign entity.foreign_entity_source: String,+ /// Foreign entity metadata.metadata: serde_json::Value,},}@@ -127,6 +189,10 @@ impl From<SoupItem> for EntityItem {id: channel.channel.channel.id.0,name: channel.channel.channel.name.clone(),},+ SoupItem::ChannelThread(thread) => EntityItem::ChannelThread {+ id: thread.root_message.message_id,+ channel_id: thread.channel_id.0,+ },SoupItem::Call(record) => EntityItem::Call {id: record.call_id,created_by: record.created_by,@@ -146,13 +212,17 @@ impl From<SoupItem> for EntityItem {}}+/// Response returned by the list entities AI tool.#[derive(Debug, Serialize, JsonSchema)]#[serde(rename_all = "camelCase")]pub struct ListEntitiesResponse {+ /// Items returned for the request.pub items: Vec<EntityItem>,+ /// Human-readable summary of the returned items.pub summary: String,}+/// AI tool request for browsing workspace entities through soup.#[derive(Debug, Deserialize, JsonSchema, Clone, Default)]#[serde(rename_all = "camelCase")]#[schemars(@@ -160,18 +230,21 @@ pub struct ListEntitiesResponse {description = "Browse the user's Macro workspace to see recent items they have access to. Returns Macro documents, AI conversations, projects, emails, chat channels, call records, and foreign entities. Use this to get an overview of what the user has been working on or to find items by type. Start here for activity-summary questions such as \"what happened today\", \"what's going on\", \"catch me up\", or \"what happened in standup today\"; apply precise time, type, channel, or mailbox filters when the user gives that scope. For Macro task requests such as \"list my tasks\", \"tasks assigned to me\", or \"tasks I completed yesterday\", prefer this tool over external task trackers such as Linear unless the user explicitly asks for Linear. Macro tasks are document items with df subtype {\"l\":{\"dst\":\"task\"}} and includeTypes [\"document\"]. Filter task Status and Assignees through propf using entity_type TASK: Status property 00000001-0000-0000-0000-000000000002, Completed option 00000001-0000-0000-0002-000000000004, Assignees property 00000001-0000-0000-0000-000000000001. The current user's assignee entity id is their Macro user id, usually macro|<their email address from context>. For \"completed yesterday\", combine status Completed, assigned-to-me, and a df updatedAt yesterday window with ua gte/lt ISO timestamps. For finding specific items by name or content, use the search tool instead.")]pub struct ListEntities {+ /// Filter returned items to specific item types.#[schemars(description = "Filter returned items to specific item types. If not provided, returns all types. Example: [\"document\", \"email\"] returns only documents and emails. Macro tasks are returned as document items, so use includeTypes=[\"document\"] with df subtype task for task requests. This is folded into the AST and applied as part of cursor-level filtering.")]#[serde(default)]pub include_types: Option<Vec<ItemType>>,+ /// Sort order for returned items.#[schemars(description = "How to sort results: recently_viewed, recently_updated (default to this), or recently_created. Use recently_updated for updated_at-style soup results.")]#[serde(default)]pub sort_by: SortBy,+ /// Document entity AST filter.#[schemars(description = "Full soup AST document filter (df). Use the same shape as /items/soup/ast, e.g. {\"l\":{\"id\":\"...\"}}. For Macro tasks, use {\"l\":{\"dst\":\"task\"}}. For \"completed yesterday\", AND the task subtype with updatedAt bounds, e.g. {\"&\":[{\"l\":{\"dst\":\"task\"}},{\"&\":[{\"l\":{\"ua\":{\"gte\":\"<start>\"}}},{\"l\":{\"ua\":{\"lt\":\"<end>\"}}}]}]} using ISO timestamps.",with = "Option<serde_json::Value>"@@ -179,6 +252,7 @@ pub struct ListEntities {#[serde(default, rename = "df")]pub document_filter: LiteralTree<DocumentLiteral>,+ /// Project entity AST filter.#[schemars(description = "Full soup AST project filter (pf).",with = "Option<serde_json::Value>"@@ -186,6 +260,7 @@ pub struct ListEntities {#[serde(default, rename = "pf")]pub project_filter: LiteralTree<ProjectLiteral>,+ /// AI chat entity AST filter.#[schemars(description = "Full soup AST AI chat filter (cf).",with = "Option<serde_json::Value>"@@ -193,12 +268,14 @@ pub struct ListEntities {#[serde(default, rename = "cf")]pub chat_filter: LiteralTree<ChatLiteral>,+ /// High-level email filter preset.#[schemars(description = "High-level email filter preset. Use \"signal\" for signal emails. Signal emails and important emails are synonymous: if the user asks for important emails, use emailPreset=\"signal\". This expands to the email AST {\"&\":[{\"l\":{\"Importance\":true}},{\"l\":{\"Shared\":\"exclude\"}}]} and defaults results to emails if includeTypes is omitted.")]#[serde(default)]pub email_preset: Option<EmailPreset>,+ /// Email entity AST filter.#[schemars(description = "Advanced full soup AST email filter (ef). Prefer emailPreset=\"signal\" for common requests. Signal emails and important emails are synonymous; they use {\"&\":[{\"l\":{\"Importance\":true}},{\"l\":{\"Shared\":\"exclude\"}}]}.",with = "Option<serde_json::Value>"@@ -206,6 +283,7 @@ pub struct ListEntities {#[serde(default, rename = "ef")]pub email_filter: LiteralTree<EmailLiteral>,+ /// Channel entity AST filter.#[schemars(description = "Full soup AST channel filter (chanf).",with = "Option<serde_json::Value>"@@ -213,6 +291,7 @@ pub struct ListEntities {#[serde(default, rename = "chanf")]pub channel_filter: LiteralTree<ChannelLiteral>,+ /// Call entity AST filter.#[schemars(description = "Full soup AST call filter (callf).",with = "Option<serde_json::Value>"@@ -220,6 +299,7 @@ pub struct ListEntities {#[serde(default, rename = "callf")]pub call_filter: LiteralTree<CallLiteral>,+ /// Foreign entity AST filter.#[schemars(description = "Full soup AST foreign entity filter (fef).",with = "Option<serde_json::Value>"@@ -227,6 +307,7 @@ pub struct ListEntities {#[serde(default, rename = "fef")]pub foreign_entity_filter: LiteralTree<ForeignEntityLiteral>,+ /// Entity property AST filter.#[schemars(description = "Full soup AST property filter (propf). Use this for Macro task Status, Assignees, Priority, and other entity properties. For task Status Completed: {\"l\":{\"pd\":\"00000001-0000-0000-0000-000000000002\",\"et\":\"TASK\",\"v\":{\"so\":\"00000001-0000-0000-0002-000000000004\"}}}. For tasks assigned to the current user: {\"l\":{\"pd\":\"00000001-0000-0000-0000-000000000001\",\"et\":\"TASK\",\"v\":{\"er\":\"macro|[email protected]\"}}}. Combine both with &: {\"&\":[statusCompleted, assignedToMe]}. Prefer this over Linear tools for unqualified task requests.",with = "Option<serde_json::Value>"@@ -234,6 +315,7 @@ pub struct ListEntities {#[serde(default, rename = "propf")]pub properties_filter: LiteralTree<PropertiesLiteral>,+ /// Mailbox view used to hydrate email previews.#[schemars(description = "\Which mailbox view to hydrate previews from for email results. Valid values: inbox \(default), sent, drafts, starred, all, important, other, or user:<label>.\n\@@ -245,6 +327,7 @@ override the default when the user explicitly asks for a specific mailbox or lab#[serde(default, rename = "emailView")]pub email_view: Option<String>,+ /// Maximum number of items to return.#[schemars(description = "Maximum number of items to return. Defaults to 50; max 500.")]#[serde(default)]pub limit: Option<u16>,@@ -441,6 +524,7 @@ pub(super) fn build_summary(let mut projects = 0;let mut emails = 0;let mut channels = 0;+ let mut channel_threads = 0;let mut call_records = 0;let mut foreign_entities = 0;@@ -451,6 +535,7 @@ pub(super) fn build_summary(EntityItem::Project { .. } => projects += 1,EntityItem::Email { .. } => emails += 1,EntityItem::Channel { .. } => channels += 1,+ EntityItem::ChannelThread { .. } => channel_threads += 1,EntityItem::Call { .. } => call_records += 1,EntityItem::ForeignEntity { .. } => foreign_entities += 1,}@@ -487,6 +572,12 @@ pub(super) fn build_summary(if channels == 1 { "" } else { "s" }));}+ if channel_threads > 0 {+ parts.push(format!(+ "{channel_threads} channel thread{}",+ if channel_threads == 1 { "" } else { "s" }+ ));+ }if call_records > 0 {parts.push(format!("{call_records} call record{}",diff --git a/rust/cloud-storage/soup/src/lib.rs b/rust/cloud-storage/soup/src/lib.rsindex 9c87e37381..7fa2c14893 100644--- a/rust/cloud-storage/soup/src/lib.rs+++ b/rust/cloud-storage/soup/src/lib.rs@@ -1,5 +1,11 @@+#![deny(missing_docs)]+//! Soup is an amalgamated service which allows callers to query for data by filters and receive many entities of different types++/// Domain models, ports, and service implementation for soup queries.pub mod domain;#[cfg(any(feature = "inbound", feature = "ai_tools"))]+/// Inbound HTTP and AI-tool adapters for the soup service.pub mod inbound;#[cfg(feature = "outbound")]+/// Outbound persistence adapters for the soup service.pub mod outbound;diff --git a/rust/cloud-storage/soup/src/outbound.rs b/rust/cloud-storage/soup/src/outbound.rsindex adad76b68e..8dc9cf8f11 100644--- a/rust/cloud-storage/soup/src/outbound.rs+++ b/rust/cloud-storage/soup/src/outbound.rs@@ -1 +1,2 @@+/// PostgreSQL-backed soup repository implementation.pub mod pg_soup_repo;diff --git a/rust/cloud-storage/soup/src/outbound/pg_soup_repo.rs b/rust/cloud-storage/soup/src/outbound/pg_soup_repo.rsindex 862cda3ff0..66fd573c49 100644--- a/rust/cloud-storage/soup/src/outbound/pg_soup_repo.rs+++ b/rust/cloud-storage/soup/src/outbound/pg_soup_repo.rs@@ -19,11 +19,13 @@ mod expanded;pub mod grouping;mod unexpanded;+/// PostgreSQL implementation of [`SoupRepo`].pub struct PgSoupRepo {pool: ReadOnlyPool,}impl PgSoupRepo {+ /// Creates a PostgreSQL soup repository using the provided read-only pool.pub fn new(pool: ReadOnlyPool) -> Self {PgSoupRepo { pool }}@@ -200,6 +202,7 @@ pub(crate) async fn populate_properties(SoupItem::Chat(x) => properties_map.get(&x.id.to_string()),// Channels, calls, CRM companies, and foreign entities are not in entity_properties.SoupItem::Channel(_)+ | SoupItem::ChannelThread(_)| SoupItem::Call(_)| SoupItem::CrmCompany(_)| SoupItem::ForeignEntity(_) => None,@@ -213,6 +216,7 @@ pub(crate) async fn populate_properties(SoupItem::EmailThread(x) => x.properties = soup_props,SoupItem::Chat(x) => x.properties = soup_props,SoupItem::Channel(_)+ | SoupItem::ChannelThread(_)| SoupItem::Call(_)| SoupItem::CrmCompany(_)| SoupItem::ForeignEntity(_) => {}diff --git a/rust/cloud-storage/soup/src/outbound/pg_soup_repo/expanded/tests.rs b/rust/cloud-storage/soup/src/outbound/pg_soup_repo/expanded/tests.rsindex af019a0917..4cc1a62460 100644--- a/rust/cloud-storage/soup/src/outbound/pg_soup_repo/expanded/tests.rs+++ b/rust/cloud-storage/soup/src/outbound/pg_soup_repo/expanded/tests.rs@@ -365,6 +365,7 @@ async fn test_expanded_soup_by_ids(pool: Pool<Postgres>) {| SoupItem::Project(_)| SoupItem::EmailThread(_)| SoupItem::Channel(_)+ | SoupItem::ChannelThread(_)| SoupItem::Call(_)| SoupItem::CrmCompany(_)| SoupItem::ForeignEntity(_) => None,