Skip to main content

createConversationSchema()

function createConversationSchema(linkBaseUrl?: string): ZodPipe<ZodObject<{
archived: ZodBoolean;
created: ZodDate;
creator: ZodNumber;
id: ZodString;
lastActive: ZodDate;
lastMessage: ZodOptional<ZodNullable<ZodObject<{
actions: ZodOptional<ZodNullable<ZodArray<ZodUnknown>>>;
attachments: ZodOptional<ZodNullable<ZodArray<ZodObject<..., ...>>>>;
content: ZodString;
conversationId: ZodString;
creator: ZodNumber;
deleted: ZodOptional<ZodNullable<ZodBoolean>>;
directGroupMentions: ZodOptional<ZodNullable<ZodArray<ZodString>>>;
directMentions: ZodOptional<ZodNullable<ZodArray<ZodNumber>>>;
id: ZodPipe<ZodUnion<readonly [ZodString, ZodNumber]>, ZodTransform<string, string | number>>;
lastEdited: ZodOptional<ZodNullable<ZodDate>>;
objIndex: ZodOptional<ZodNullable<ZodNumber>>;
posted: ZodDate;
reactions: ZodOptional<ZodNullable<ZodRecord<ZodString, ZodArray<...>>>>;
systemMessage: ZodOptional<ZodNullable<ZodUnion<readonly [..., ...]>>>;
version: ZodOptional<ZodNullable<ZodNumber>>;
workspaceId: ZodOptional<ZodNullable<ZodNumber>>;
}, $strip>>>;
lastObjIndex: ZodNumber;
messageCount: ZodOptional<ZodNullable<ZodNumber>>;
mutedUntil: ZodOptional<ZodNullable<ZodDate>>;
private: ZodOptional<ZodNullable<ZodBoolean>>;
snippet: ZodString;
snippetCreators: ZodArray<ZodNumber>;
title: ZodOptional<ZodNullable<ZodString>>;
userIds: ZodArray<ZodNumber>;
workspaceId: ZodNumber;
}, $strip>, ZodTransform<{
archived: boolean;
created: Date;
creator: number;
id: string;
lastActive: Date;
lastMessage?: | {
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;
content: string;
conversationId: string;
creator: number;
deleted?: boolean | null;
directGroupMentions?: string[] | null;
directMentions?: number[] | null;
id: string;
lastEdited?: Date | null;
objIndex?: number | null;
posted: Date;
reactions?: Record<string, number[]> | null;
systemMessage?: unknown;
version?: number | null;
workspaceId?: number | null;
}
| null;
lastObjIndex: number;
messageCount?: number | null;
mutedUntil?: Date | null;
private?: boolean | null;
snippet: string;
snippetCreators: number[];
title?: string | null;
url: string;
userIds: number[];
workspaceId: number;
}, {
archived: boolean;
created: Date;
creator: number;
id: string;
lastActive: Date;
lastMessage?: | {
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;
content: string;
conversationId: string;
creator: number;
deleted?: boolean | null;
directGroupMentions?: string[] | null;
directMentions?: number[] | null;
id: string;
lastEdited?: Date | null;
objIndex?: number | null;
posted: Date;
reactions?: Record<string, number[]> | null;
systemMessage?: unknown;
version?: number | null;
workspaceId?: number | null;
}
| null;
lastObjIndex: number;
messageCount?: number | null;
mutedUntil?: Date | null;
private?: boolean | null;
snippet: string;
snippetCreators: number[];
title?: string | null;
userIds: number[];
workspaceId: number;
}>>;

Parameters

ParameterType
linkBaseUrl?string

Returns

ZodPipe<ZodObject<{ archived: ZodBoolean; created: ZodDate; creator: ZodNumber; id: ZodString; lastActive: ZodDate; lastMessage: ZodOptional<ZodNullable<ZodObject<{ actions: ZodOptional<ZodNullable<ZodArray<ZodUnknown>>>; attachments: ZodOptional<ZodNullable<ZodArray<ZodObject<..., ...>>>>; content: ZodString; conversationId: ZodString; creator: ZodNumber; deleted: ZodOptional<ZodNullable<ZodBoolean>>; directGroupMentions: ZodOptional<ZodNullable<ZodArray<ZodString>>>; directMentions: ZodOptional<ZodNullable<ZodArray<ZodNumber>>>; id: ZodPipe<ZodUnion<readonly [ZodString, ZodNumber]>, ZodTransform<string, string | number>>; lastEdited: ZodOptional<ZodNullable<ZodDate>>; objIndex: ZodOptional<ZodNullable<ZodNumber>>; posted: ZodDate; reactions: ZodOptional<ZodNullable<ZodRecord<ZodString, ZodArray<...>>>>; systemMessage: ZodOptional<ZodNullable<ZodUnion<readonly [..., ...]>>>; version: ZodOptional<ZodNullable<ZodNumber>>; workspaceId: ZodOptional<ZodNullable<ZodNumber>>; }, $strip>>>; lastObjIndex: ZodNumber; messageCount: ZodOptional<ZodNullable<ZodNumber>>; mutedUntil: ZodOptional<ZodNullable<ZodDate>>; private: ZodOptional<ZodNullable<ZodBoolean>>; snippet: ZodString; snippetCreators: ZodArray<ZodNumber>; title: ZodOptional<ZodNullable<ZodString>>; userIds: ZodArray<ZodNumber>; workspaceId: ZodNumber; }, $strip>, ZodTransform<{ archived: boolean; created: Date; creator: number; id: string; lastActive: Date; lastMessage?: | { 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; content: string; conversationId: string; creator: number; deleted?: boolean | null; directGroupMentions?: string[] | null; directMentions?: number[] | null; id: string; lastEdited?: Date | null; objIndex?: number | null; posted: Date; reactions?: Record<string, number[]> | null; systemMessage?: unknown; version?: number | null; workspaceId?: number | null; } | null; lastObjIndex: number; messageCount?: number | null; mutedUntil?: Date | null; private?: boolean | null; snippet: string; snippetCreators: number[]; title?: string | null; url: string; userIds: number[]; workspaceId: number; }, { archived: boolean; created: Date; creator: number; id: string; lastActive: Date; lastMessage?: | { 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; content: string; conversationId: string; creator: number; deleted?: boolean | null; directGroupMentions?: string[] | null; directMentions?: number[] | null; id: string; lastEdited?: Date | null; objIndex?: number | null; posted: Date; reactions?: Record<string, number[]> | null; systemMessage?: unknown; version?: number | null; workspaceId?: number | null; } | null; lastObjIndex: number; messageCount?: number | null; mutedUntil?: Date | null; private?: boolean | null; snippet: string; snippetCreators: number[]; title?: string | null; userIds: number[]; workspaceId: number; }>>