createThreadSchema()
function createThreadSchema(linkBaseUrl?: string): ZodPipe<ZodObject<{
actions: ZodOptional<ZodNullable<ZodArray<ZodUnknown>>>;
attachments: ZodOptional<ZodNullable<ZodArray<ZodObject<{
attachmentId: ZodString;
description: ZodOptional<ZodNullable<ZodString>>;
duration: ZodOptional<ZodNullable<ZodString>>;
fileName: ZodOptional<ZodNullable<ZodString>>;
fileSize: ZodOptional<ZodNullable<ZodNumber>>;
image: ZodOptional<ZodNullable<ZodString>>;
imageHeight: ZodOptional<ZodNullable<ZodNumber>>;
imageWidth: ZodOptional<ZodNullable<ZodNumber>>;
title: ZodOptional<ZodNullable<ZodString>>;
underlyingType: ZodOptional<ZodNullable<ZodString>>;
uploadState: ZodOptional<ZodNullable<ZodString>>;
url: ZodOptional<ZodNullable<ZodString>>;
urlType: ZodString;
video: ZodOptional<ZodNullable<ZodString>>;
videoAutoPlay: ZodOptional<ZodNullable<ZodBoolean>>;
videoType: ZodOptional<ZodNullable<ZodString>>;
}, $loose>>>>;
channelId: ZodString;
closed: ZodOptional<ZodNullable<ZodBoolean>>;
commentCount: ZodNumber;
content: ZodString;
creator: ZodNumber;
creatorName: ZodOptional<ZodNullable<ZodString>>;
directGroupMentions: ZodOptional<ZodNullable<ZodArray<ZodString>>>;
directMentions: ZodOptional<ZodNullable<ZodArray<ZodNumber>>>;
groups: ZodOptional<ZodNullable<ZodArray<ZodString>>>;
id: ZodString;
inInbox: ZodOptional<ZodNullable<ZodBoolean>>;
isArchived: ZodBoolean;
isSaved: ZodOptional<ZodNullable<ZodBoolean>>;
lastComment: ZodOptional<ZodNullable<ZodObject<{
actions: ZodOptional<ZodNullable<ZodArray<ZodUnknown>>>;
attachments: ZodOptional<ZodNullable<ZodArray<ZodObject<..., ...>>>>;
channelId: ZodString;
content: ZodString;
creator: ZodNumber;
creatorName: ZodString;
deleted: ZodBoolean;
deletedBy: ZodOptional<ZodNullable<ZodNumber>>;
directGroupMentions: ZodOptional<ZodNullable<ZodArray<ZodString>>>;
directMentions: ZodOptional<ZodNullable<ZodArray<ZodNumber>>>;
groups: ZodOptional<ZodNullable<ZodArray<ZodString>>>;
id: ZodString;
lastEdited: ZodOptional<ZodNullable<ZodDate>>;
objIndex: ZodNumber;
posted: ZodDate;
reactions: ZodOptional<ZodNullable<ZodRecord<ZodString, ZodArray<...>>>>;
recipients: ZodOptional<ZodNullable<ZodArray<ZodNumber>>>;
systemMessage: ZodOptional<ZodNullable<ZodUnion<readonly [..., ...]>>>;
threadId: ZodString;
toEmails: ZodOptional<ZodNullable<ZodArray<ZodString>>>;
version: ZodNumber;
workspaceId: ZodNumber;
}, $strip>>>;
lastEdited: ZodOptional<ZodNullable<ZodDate>>;
lastObjIndex: ZodOptional<ZodNullable<ZodNumber>>;
lastUpdated: ZodDate;
mutedUntil: ZodOptional<ZodNullable<ZodDate>>;
participants: ZodOptional<ZodNullable<ZodArray<ZodNumber>>>;
pinned: ZodOptional<ZodBoolean>;
pinnedTs: ZodOptional<ZodNullable<ZodNumber>>;
posted: ZodDate;
reactions: ZodOptional<ZodNullable<ZodRecord<ZodString, ZodUnknown>>>;
recipients: ZodOptional<ZodNullable<ZodArray<ZodNumber>>>;
responders: ZodOptional<ZodNullable<ZodArray<ZodNumber>>>;
snippet: ZodString;
snippetCreator: ZodNumber;
snippetMaskAvatarUrl: ZodOptional<ZodNullable<ZodString>>;
snippetMaskPoster: ZodOptional<ZodNullable<ZodString>>;
systemMessage: ZodOptional<ZodNullable<ZodUnion<readonly [ZodString, ZodUnknown]>>>;
title: ZodString;
toEmails: ZodOptional<ZodNullable<ZodArray<ZodString>>>;
workspaceId: ZodNumber;
}, $strip>, ZodTransform<{
actions?: unknown[] | null;
attachments?: | {
[key: string]: unknown;
attachmentId: string;
description?: string | null;
duration?: string | null;
fileName?: string | null;
fileSize?: number | null;
image?: string | null;
imageHeight?: number | null;
imageWidth?: number | null;
title?: string | null;
underlyingType?: string | null;
uploadState?: string | null;
url?: string | null;
urlType: string;
video?: string | null;
videoAutoPlay?: boolean | null;
videoType?: string | null;
}[]
| null;
channelId: string;
closed?: boolean | null;
commentCount: number;
content: string;
creator: number;
creatorName?: string | null;
directGroupMentions?: string[] | null;
directMentions?: number[] | null;
groups?: string[] | null;
id: string;
inInbox?: boolean | null;
isArchived: boolean;
isSaved?: boolean | null;
lastComment?: | {
actions?: unknown[] | null;
attachments?: | {
[key: string]: unknown;
attachmentId: string;
description?: string | null;
duration?: string | null;
fileName?: string | null;
fileSize?: number | null;
image?: string | null;
imageHeight?: number | null;
imageWidth?: number | null;
title?: string | null;
underlyingType?: string | null;
uploadState?: string | null;
url?: string | null;
urlType: string;
video?: string | null;
videoAutoPlay?: boolean | null;
videoType?: string | null;
}[]
| null;
channelId: string;
content: string;
creator: number;
creatorName: string;
deleted: boolean;
deletedBy?: number | null;
directGroupMentions?: string[] | null;
directMentions?: number[] | null;
groups?: string[] | null;
id: string;
lastEdited?: Date | null;
objIndex: number;
posted: Date;
reactions?: Record<string, number[]> | null;
recipients?: number[] | null;
systemMessage?: unknown;
threadId: string;
toEmails?: string[] | null;
version: number;
workspaceId: number;
}
| null;
lastEdited?: Date | null;
lastObjIndex?: number | null;
lastUpdated: Date;
mutedUntil?: Date | null;
participants?: number[] | null;
pinned?: boolean;
pinnedTs?: number | null;
posted: Date;
reactions?: Record<string, unknown> | null;
recipients?: number[] | null;
responders?: number[] | null;
snippet: string;
snippetCreator: number;
snippetMaskAvatarUrl?: string | null;
snippetMaskPoster?: string | null;
systemMessage?: unknown;
title: string;
toEmails?: string[] | null;
url: string;
workspaceId: number;
}, {
actions?: unknown[] | null;
attachments?: | {
[key: string]: unknown;
attachmentId: string;
description?: string | null;
duration?: string | null;
fileName?: string | null;
fileSize?: number | null;
image?: string | null;
imageHeight?: number | null;
imageWidth?: number | null;
title?: string | null;
underlyingType?: string | null;
uploadState?: string | null;
url?: string | null;
urlType: string;
video?: string | null;
videoAutoPlay?: boolean | null;
videoType?: string | null;
}[]
| null;
channelId: string;
closed?: boolean | null;
commentCount: number;
content: string;
creator: number;
creatorName?: string | null;
directGroupMentions?: string[] | null;
directMentions?: number[] | null;
groups?: string[] | null;
id: string;
inInbox?: boolean | null;
isArchived: boolean;
isSaved?: boolean | null;
lastComment?: | {
actions?: unknown[] | null;
attachments?: | {
[key: string]: unknown;
attachmentId: string;
description?: string | null;
duration?: string | null;
fileName?: string | null;
fileSize?: number | null;
image?: string | null;
imageHeight?: number | null;
imageWidth?: number | null;
title?: string | null;
underlyingType?: string | null;
uploadState?: string | null;
url?: string | null;
urlType: string;
video?: string | null;
videoAutoPlay?: boolean | null;
videoType?: string | null;
}[]
| null;
channelId: string;
content: string;
creator: number;
creatorName: string;
deleted: boolean;
deletedBy?: number | null;
directGroupMentions?: string[] | null;
directMentions?: number[] | null;
groups?: string[] | null;
id: string;
lastEdited?: Date | null;
objIndex: number;
posted: Date;
reactions?: Record<string, number[]> | null;
recipients?: number[] | null;
systemMessage?: unknown;
threadId: string;
toEmails?: string[] | null;
version: number;
workspaceId: number;
}
| null;
lastEdited?: Date | null;
lastObjIndex?: number | null;
lastUpdated: Date;
mutedUntil?: Date | null;
participants?: number[] | null;
pinned?: boolean;
pinnedTs?: number | null;
posted: Date;
reactions?: Record<string, unknown> | null;
recipients?: number[] | null;
responders?: number[] | null;
snippet: string;
snippetCreator: number;
snippetMaskAvatarUrl?: string | null;
snippetMaskPoster?: string | null;
systemMessage?: unknown;
title: string;
toEmails?: string[] | null;
workspaceId: number;
}>>;
Parameters
| Parameter | Type |
|---|---|
linkBaseUrl? | string |
Returns
ZodPipe<ZodObject<{
actions: ZodOptional<ZodNullable<ZodArray<ZodUnknown>>>;
attachments: ZodOptional<ZodNullable<ZodArray<ZodObject<{
attachmentId: ZodString;
description: ZodOptional<ZodNullable<ZodString>>;
duration: ZodOptional<ZodNullable<ZodString>>;
fileName: ZodOptional<ZodNullable<ZodString>>;
fileSize: ZodOptional<ZodNullable<ZodNumber>>;
image: ZodOptional<ZodNullable<ZodString>>;
imageHeight: ZodOptional<ZodNullable<ZodNumber>>;
imageWidth: ZodOptional<ZodNullable<ZodNumber>>;
title: ZodOptional<ZodNullable<ZodString>>;
underlyingType: ZodOptional<ZodNullable<ZodString>>;
uploadState: ZodOptional<ZodNullable<ZodString>>;
url: ZodOptional<ZodNullable<ZodString>>;
urlType: ZodString;
video: ZodOptional<ZodNullable<ZodString>>;
videoAutoPlay: ZodOptional<ZodNullable<ZodBoolean>>;
videoType: ZodOptional<ZodNullable<ZodString>>;
}, $loose>>>>;
channelId: ZodString;
closed: ZodOptional<ZodNullable<ZodBoolean>>;
commentCount: ZodNumber;
content: ZodString;
creator: ZodNumber;
creatorName: ZodOptional<ZodNullable<ZodString>>;
directGroupMentions: ZodOptional<ZodNullable<ZodArray<ZodString>>>;
directMentions: ZodOptional<ZodNullable<ZodArray<ZodNumber>>>;
groups: ZodOptional<ZodNullable<ZodArray<ZodString>>>;
id: ZodString;
inInbox: ZodOptional<ZodNullable<ZodBoolean>>;
isArchived: ZodBoolean;
isSaved: ZodOptional<ZodNullable<ZodBoolean>>;
lastComment: ZodOptional<ZodNullable<ZodObject<{
actions: ZodOptional<ZodNullable<ZodArray<ZodUnknown>>>;
attachments: ZodOptional<ZodNullable<ZodArray<ZodObject<..., ...>>>>;
channelId: ZodString;
content: ZodString;
creator: ZodNumber;
creatorName: ZodString;
deleted: ZodBoolean;
deletedBy: ZodOptional<ZodNullable<ZodNumber>>;
directGroupMentions: ZodOptional<ZodNullable<ZodArray<ZodString>>>;
directMentions: ZodOptional<ZodNullable<ZodArray<ZodNumber>>>;
groups: ZodOptional<ZodNullable<ZodArray<ZodString>>>;
id: ZodString;
lastEdited: ZodOptional<ZodNullable<ZodDate>>;
objIndex: ZodNumber;
posted: ZodDate;
reactions: ZodOptional<ZodNullable<ZodRecord<ZodString, ZodArray<...>>>>;
recipients: ZodOptional<ZodNullable<ZodArray<ZodNumber>>>;
systemMessage: ZodOptional<ZodNullable<ZodUnion<readonly [..., ...]>>>;
threadId: ZodString;
toEmails: ZodOptional<ZodNullable<ZodArray<ZodString>>>;
version: ZodNumber;
workspaceId: ZodNumber;
}, $strip>>>;
lastEdited: ZodOptional<ZodNullable<ZodDate>>;
lastObjIndex: ZodOptional<ZodNullable<ZodNumber>>;
lastUpdated: ZodDate;
mutedUntil: ZodOptional<ZodNullable<ZodDate>>;
participants: ZodOptional<ZodNullable<ZodArray<ZodNumber>>>;
pinned: ZodOptional<ZodBoolean>;
pinnedTs: ZodOptional<ZodNullable<ZodNumber>>;
posted: ZodDate;
reactions: ZodOptional<ZodNullable<ZodRecord<ZodString, ZodUnknown>>>;
recipients: ZodOptional<ZodNullable<ZodArray<ZodNumber>>>;
responders: ZodOptional<ZodNullable<ZodArray<ZodNumber>>>;
snippet: ZodString;
snippetCreator: ZodNumber;
snippetMaskAvatarUrl: ZodOptional<ZodNullable<ZodString>>;
snippetMaskPoster: ZodOptional<ZodNullable<ZodString>>;
systemMessage: ZodOptional<ZodNullable<ZodUnion<readonly [ZodString, ZodUnknown]>>>;
title: ZodString;
toEmails: ZodOptional<ZodNullable<ZodArray<ZodString>>>;
workspaceId: ZodNumber;
}, $strip>, ZodTransform<{
actions?: unknown[] | null;
attachments?: | {
[key: string]: unknown;
attachmentId: string;
description?: string | null;
duration?: string | null;
fileName?: string | null;
fileSize?: number | null;
image?: string | null;
imageHeight?: number | null;
imageWidth?: number | null;
title?: string | null;
underlyingType?: string | null;
uploadState?: string | null;
url?: string | null;
urlType: string;
video?: string | null;
videoAutoPlay?: boolean | null;
videoType?: string | null;
}[]
| null;
channelId: string;
closed?: boolean | null;
commentCount: number;
content: string;
creator: number;
creatorName?: string | null;
directGroupMentions?: string[] | null;
directMentions?: number[] | null;
groups?: string[] | null;
id: string;
inInbox?: boolean | null;
isArchived: boolean;
isSaved?: boolean | null;
lastComment?: | {
actions?: unknown[] | null;
attachments?: | {
[key: string]: unknown;
attachmentId: string;
description?: string | null;
duration?: string | null;
fileName?: string | null;
fileSize?: number | null;
image?: string | null;
imageHeight?: number | null;
imageWidth?: number | null;
title?: string | null;
underlyingType?: string | null;
uploadState?: string | null;
url?: string | null;
urlType: string;
video?: string | null;
videoAutoPlay?: boolean | null;
videoType?: string | null;
}[]
| null;
channelId: string;
content: string;
creator: number;
creatorName: string;
deleted: boolean;
deletedBy?: number | null;
directGroupMentions?: string[] | null;
directMentions?: number[] | null;
groups?: string[] | null;
id: string;
lastEdited?: Date | null;
objIndex: number;
posted: Date;
reactions?: Record<string, number[]> | null;
recipients?: number[] | null;
systemMessage?: unknown;
threadId: string;
toEmails?: string[] | null;
version: number;
workspaceId: number;
}
| null;
lastEdited?: Date | null;
lastObjIndex?: number | null;
lastUpdated: Date;
mutedUntil?: Date | null;
participants?: number[] | null;
pinned?: boolean;
pinnedTs?: number | null;
posted: Date;
reactions?: Record<string, unknown> | null;
recipients?: number[] | null;
responders?: number[] | null;
snippet: string;
snippetCreator: number;
snippetMaskAvatarUrl?: string | null;
snippetMaskPoster?: string | null;
systemMessage?: unknown;
title: string;
toEmails?: string[] | null;
url: string;
workspaceId: number;
}, {
actions?: unknown[] | null;
attachments?: | {
[key: string]: unknown;
attachmentId: string;
description?: string | null;
duration?: string | null;
fileName?: string | null;
fileSize?: number | null;
image?: string | null;
imageHeight?: number | null;
imageWidth?: number | null;
title?: string | null;
underlyingType?: string | null;
uploadState?: string | null;
url?: string | null;
urlType: string;
video?: string | null;
videoAutoPlay?: boolean | null;
videoType?: string | null;
}[]
| null;
channelId: string;
closed?: boolean | null;
commentCount: number;
content: string;
creator: number;
creatorName?: string | null;
directGroupMentions?: string[] | null;
directMentions?: number[] | null;
groups?: string[] | null;
id: string;
inInbox?: boolean | null;
isArchived: boolean;
isSaved?: boolean | null;
lastComment?: | {
actions?: unknown[] | null;
attachments?: | {
[key: string]: unknown;
attachmentId: string;
description?: string | null;
duration?: string | null;
fileName?: string | null;
fileSize?: number | null;
image?: string | null;
imageHeight?: number | null;
imageWidth?: number | null;
title?: string | null;
underlyingType?: string | null;
uploadState?: string | null;
url?: string | null;
urlType: string;
video?: string | null;
videoAutoPlay?: boolean | null;
videoType?: string | null;
}[]
| null;
channelId: string;
content: string;
creator: number;
creatorName: string;
deleted: boolean;
deletedBy?: number | null;
directGroupMentions?: string[] | null;
directMentions?: number[] | null;
groups?: string[] | null;
id: string;
lastEdited?: Date | null;
objIndex: number;
posted: Date;
reactions?: Record<string, number[]> | null;
recipients?: number[] | null;
systemMessage?: unknown;
threadId: string;
toEmails?: string[] | null;
version: number;
workspaceId: number;
}
| null;
lastEdited?: Date | null;
lastObjIndex?: number | null;
lastUpdated: Date;
mutedUntil?: Date | null;
participants?: number[] | null;
pinned?: boolean;
pinnedTs?: number | null;
posted: Date;
reactions?: Record<string, unknown> | null;
recipients?: number[] | null;
responders?: number[] | null;
snippet: string;
snippetCreator: number;
snippetMaskAvatarUrl?: string | null;
snippetMaskPoster?: string | null;
systemMessage?: unknown;
title: string;
toEmails?: string[] | null;
workspaceId: number;
}>>