204 lines
3.6 KiB
TypeScript
204 lines
3.6 KiB
TypeScript
export type JsonValue =
|
|
| string
|
|
| number
|
|
| boolean
|
|
| null
|
|
| JsonValue[]
|
|
| {
|
|
[key: string]: JsonValue;
|
|
};
|
|
|
|
export interface SerializedId {
|
|
_serialized?: string;
|
|
user?: string;
|
|
server?: string;
|
|
domain?: string;
|
|
device?: string;
|
|
agent?: string;
|
|
[key: string]: JsonValue | undefined;
|
|
}
|
|
|
|
export interface ContactDTO {
|
|
id: SerializedId | string | null;
|
|
|
|
accountLid?: string | null;
|
|
|
|
name?: string | null;
|
|
pushname?: string | null;
|
|
shortName?: string | null;
|
|
formattedName?: string | null;
|
|
notifyName?: string | null;
|
|
|
|
number?: string | null;
|
|
|
|
isMe?: boolean;
|
|
isUser?: boolean;
|
|
isBusiness?: boolean;
|
|
isEnterprise?: boolean;
|
|
isGroup?: boolean;
|
|
|
|
isMyContact?: boolean;
|
|
isBlocked?: boolean;
|
|
|
|
profilePicThumbObj?: unknown;
|
|
}
|
|
|
|
export interface ChatDTO {
|
|
id: SerializedId | string | null;
|
|
|
|
accountLid?: string | null;
|
|
|
|
name?: string | null;
|
|
formattedTitle?: string | null;
|
|
|
|
isGroup?: boolean;
|
|
isUser?: boolean;
|
|
isNewsletter?: boolean;
|
|
isCommunity?: boolean;
|
|
|
|
isReadOnly?: boolean;
|
|
isAnnounceGrpRestrict?: boolean;
|
|
|
|
archived?: boolean;
|
|
pinned?: boolean;
|
|
muted?: boolean;
|
|
|
|
unreadCount?: number;
|
|
unreadMentionsCount?: number;
|
|
|
|
timestamp?: number | null;
|
|
lastMessage?: MessageDTO | null;
|
|
contact?: ContactDTO | null;
|
|
groupMetadata?: GroupMetadataDTO | null;
|
|
|
|
previewMessage?: MessageDTO | null;
|
|
}
|
|
|
|
export interface GroupMetadataDTO {
|
|
id: SerializedId | string | null;
|
|
|
|
subject?: string | null;
|
|
subjectOwner?: SerializedId | string | null;
|
|
|
|
subjectTime?: number | null;
|
|
creation?: number | null;
|
|
|
|
owner?: SerializedId | string | null;
|
|
|
|
participants?: GroupParticipantDTO[];
|
|
|
|
size?: number;
|
|
|
|
restrict?: boolean;
|
|
announce?: boolean;
|
|
|
|
isCommunity?: boolean;
|
|
isCommunityAnnounce?: boolean;
|
|
}
|
|
|
|
export interface GroupParticipantDTO {
|
|
id: SerializedId | string | null;
|
|
|
|
isAdmin?: boolean;
|
|
isSuperAdmin?: boolean;
|
|
isSuperParticipant?: boolean;
|
|
|
|
isBusiness?: boolean;
|
|
}
|
|
|
|
export interface MessageDTO {
|
|
id: MessageIdDTO;
|
|
|
|
chatId?: string | null;
|
|
|
|
from?: SerializedId | string | null;
|
|
to?: SerializedId | string | null;
|
|
|
|
author?: SerializedId | string | null;
|
|
|
|
fromMe?: boolean;
|
|
|
|
body?: string | null;
|
|
caption?: string | null;
|
|
|
|
type?: string | null;
|
|
subtype?: string | null;
|
|
|
|
timestamp?: number | null;
|
|
|
|
ack?: number | null;
|
|
|
|
hasMedia?: boolean;
|
|
mediaKey?: string | null;
|
|
|
|
isForwarded?: boolean;
|
|
forwardingScore?: number;
|
|
|
|
isStarred?: boolean;
|
|
|
|
broadcast?: boolean;
|
|
notifyName?: string | null;
|
|
|
|
mentionedIds?: (SerializedId | string)[];
|
|
|
|
quotedMsgId?: MessageIdDTO | null;
|
|
|
|
quotedMsg?: MessageDTO | null;
|
|
|
|
links?: MessageLinkDTO[];
|
|
|
|
location?: LocationDTO | null;
|
|
|
|
vCard?: string | null;
|
|
vCards?: string[];
|
|
|
|
filename?: string | null;
|
|
mimetype?: string | null;
|
|
size?: number | null;
|
|
|
|
duration?: number | null;
|
|
}
|
|
|
|
export interface MessageIdDTO {
|
|
id?: string | null;
|
|
_serialized?: string | null;
|
|
|
|
fromMe?: boolean;
|
|
remote?: SerializedId | string | null;
|
|
participant?: SerializedId | string | null;
|
|
}
|
|
|
|
export interface MessageLinkDTO {
|
|
link?: string | null;
|
|
isSuspicious?: boolean;
|
|
}
|
|
|
|
export interface LocationDTO {
|
|
latitude?: number | null;
|
|
longitude?: number | null;
|
|
|
|
description?: string | null;
|
|
address?: string | null;
|
|
|
|
url?: string | null;
|
|
|
|
name?: string | null;
|
|
}
|
|
|
|
export interface SentMessageDTO {
|
|
id: MessageIdDTO | null;
|
|
|
|
ack?: number | null;
|
|
|
|
timestamp?: number | null;
|
|
|
|
chatId?: string | null;
|
|
|
|
from?: SerializedId | string | null;
|
|
to?: SerializedId | string | null;
|
|
|
|
body?: string | null;
|
|
|
|
type?: string | null;
|
|
}
|