This commit is contained in:
Alan Mosko
2023-07-26 10:58:13 -03:00
parent 03f3020e9f
commit 249aecbc0d
70 changed files with 9184 additions and 9768 deletions

View File

@@ -1,93 +1,84 @@
import {
proto,
WAPrivacyOnlineValue,
WAPrivacyValue,
WAReadReceiptsValue,
} from '@whiskeysockets/baileys';
import { proto, WAPrivacyOnlineValue, WAPrivacyValue, WAReadReceiptsValue } from '@whiskeysockets/baileys';
export class OnWhatsAppDto {
constructor(
public readonly jid: string,
public readonly exists: boolean,
public readonly name?: string,
) {}
constructor(public readonly jid: string, public readonly exists: boolean, public readonly name?: string) {}
}
export class getBase64FromMediaMessageDto {
message: proto.WebMessageInfo;
convertToMp4?: boolean;
message: proto.WebMessageInfo;
convertToMp4?: boolean;
}
export class WhatsAppNumberDto {
numbers: string[];
numbers: string[];
}
export class NumberDto {
number: string;
number: string;
}
export class NumberBusiness {
wid?: string;
jid?: string;
exists?: boolean;
isBusiness: boolean;
name?: string;
message?: string;
description?: string;
email?: string;
website?: string[];
address?: string;
wid?: string;
jid?: string;
exists?: boolean;
isBusiness: boolean;
name?: string;
message?: string;
description?: string;
email?: string;
website?: string[];
address?: string;
}
export class ProfileNameDto {
name: string;
name: string;
}
export class ProfileStatusDto {
status: string;
status: string;
}
export class ProfilePictureDto {
number?: string;
// url or base64
picture?: string;
number?: string;
// url or base64
picture?: string;
}
class Key {
id: string;
fromMe: boolean;
remoteJid: string;
id: string;
fromMe: boolean;
remoteJid: string;
}
export class ReadMessageDto {
readMessages: Key[];
readMessages: Key[];
}
class LastMessage {
key: Key;
messageTimestamp?: number;
key: Key;
messageTimestamp?: number;
}
export class ArchiveChatDto {
lastMessage: LastMessage;
archive: boolean;
lastMessage: LastMessage;
archive: boolean;
}
class PrivacySetting {
readreceipts: WAReadReceiptsValue;
profile: WAPrivacyValue;
status: WAPrivacyValue;
online: WAPrivacyOnlineValue;
last: WAPrivacyValue;
groupadd: WAPrivacyValue;
readreceipts: WAReadReceiptsValue;
profile: WAPrivacyValue;
status: WAPrivacyValue;
online: WAPrivacyOnlineValue;
last: WAPrivacyValue;
groupadd: WAPrivacyValue;
}
export class PrivacySettingDto {
privacySettings: PrivacySetting;
privacySettings: PrivacySetting;
}
export class DeleteMessage {
id: string;
fromMe: boolean;
remoteJid: string;
participant?: string;
id: string;
fromMe: boolean;
remoteJid: string;
participant?: string;
}

View File

@@ -1,9 +1,9 @@
export class ChatwootDto {
enabled?: boolean;
account_id?: string;
token?: string;
url?: string;
name_inbox?: string;
sign_msg?: boolean;
number?: string;
enabled?: boolean;
account_id?: string;
token?: string;
url?: string;
name_inbox?: string;
sign_msg?: boolean;
number?: string;
}

View File

@@ -1,51 +1,51 @@
export class CreateGroupDto {
subject: string;
description?: string;
participants: string[];
subject: string;
description?: string;
participants: string[];
}
export class GroupPictureDto {
groupJid: string;
image: string;
groupJid: string;
image: string;
}
export class GroupSubjectDto {
groupJid: string;
subject: string;
groupJid: string;
subject: string;
}
export class GroupDescriptionDto {
groupJid: string;
description: string;
groupJid: string;
description: string;
}
export class GroupJid {
groupJid: string;
groupJid: string;
}
export class GetParticipant {
getParticipants: string;
getParticipants: string;
}
export class GroupInvite {
inviteCode: string;
inviteCode: string;
}
export class GroupSendInvite {
groupJid: string;
description: string;
numbers: string[];
groupJid: string;
description: string;
numbers: string[];
}
export class GroupUpdateParticipantDto extends GroupJid {
action: 'add' | 'remove' | 'promote' | 'demote';
participants: string[];
action: 'add' | 'remove' | 'promote' | 'demote';
participants: string[];
}
export class GroupUpdateSettingDto extends GroupJid {
action: 'announcement' | 'not_announcement' | 'unlocked' | 'locked';
action: 'announcement' | 'not_announcement' | 'unlocked' | 'locked';
}
export class GroupToggleEphemeralDto extends GroupJid {
expiration: 0 | 86400 | 604800 | 7776000;
expiration: 0 | 86400 | 604800 | 7776000;
}

View File

@@ -1,13 +1,13 @@
export class InstanceDto {
instanceName: string;
webhook?: string;
webhook_by_events?: boolean;
events?: string[];
qrcode?: boolean;
number?: string;
token?: string;
chatwoot_account_id?: string;
chatwoot_token?: string;
chatwoot_url?: string;
chatwoot_sign_msg?: boolean;
instanceName: string;
webhook?: string;
webhook_by_events?: boolean;
events?: string[];
qrcode?: boolean;
number?: string;
token?: string;
chatwoot_account_id?: string;
chatwoot_token?: string;
chatwoot_url?: string;
chatwoot_sign_msg?: boolean;
}

View File

@@ -1,150 +1,150 @@
import { proto, WAPresence } from '@whiskeysockets/baileys';
export class Quoted {
key: proto.IMessageKey;
message: proto.IMessage;
key: proto.IMessageKey;
message: proto.IMessage;
}
export class Mentions {
everyOne: boolean;
mentioned: string[];
everyOne: boolean;
mentioned: string[];
}
export class Options {
delay?: number;
presence?: WAPresence;
quoted?: Quoted;
mentions?: Mentions;
linkPreview?: boolean;
encoding?: boolean;
delay?: number;
presence?: WAPresence;
quoted?: Quoted;
mentions?: Mentions;
linkPreview?: boolean;
encoding?: boolean;
}
class OptionsMessage {
options: Options;
options: Options;
}
export class Metadata extends OptionsMessage {
number: string;
number: string;
}
class TextMessage {
text: string;
text: string;
}
export class StatusMessage {
type: string;
content: string;
statusJidList?: string[];
allContacts?: boolean;
caption?: string;
backgroundColor?: string;
font?: number;
type: string;
content: string;
statusJidList?: string[];
allContacts?: boolean;
caption?: string;
backgroundColor?: string;
font?: number;
}
class PollMessage {
name: string;
selectableCount: number;
values: string[];
messageSecret?: Uint8Array;
name: string;
selectableCount: number;
values: string[];
messageSecret?: Uint8Array;
}
export class SendTextDto extends Metadata {
textMessage: TextMessage;
textMessage: TextMessage;
}
export class SendStatusDto extends Metadata {
statusMessage: StatusMessage;
statusMessage: StatusMessage;
}
export class SendPollDto extends Metadata {
pollMessage: PollMessage;
pollMessage: PollMessage;
}
export type MediaType = 'image' | 'document' | 'video' | 'audio';
export class MediaMessage {
mediatype: MediaType;
caption?: string;
// for document
fileName?: string;
// url or base64
media: string;
mediatype: MediaType;
caption?: string;
// for document
fileName?: string;
// url or base64
media: string;
}
export class SendMediaDto extends Metadata {
mediaMessage: MediaMessage;
mediaMessage: MediaMessage;
}
class Sticker {
image: string;
image: string;
}
export class SendStickerDto extends Metadata {
stickerMessage: Sticker;
stickerMessage: Sticker;
}
class Audio {
audio: string;
audio: string;
}
export class SendAudioDto extends Metadata {
audioMessage: Audio;
audioMessage: Audio;
}
class Button {
buttonText: string;
buttonId: string;
buttonText: string;
buttonId: string;
}
class ButtonMessage {
title: string;
description: string;
footerText?: string;
buttons: Button[];
mediaMessage?: MediaMessage;
title: string;
description: string;
footerText?: string;
buttons: Button[];
mediaMessage?: MediaMessage;
}
export class SendButtonDto extends Metadata {
buttonMessage: ButtonMessage;
buttonMessage: ButtonMessage;
}
class LocationMessage {
latitude: number;
longitude: number;
name?: string;
address?: string;
latitude: number;
longitude: number;
name?: string;
address?: string;
}
export class SendLocationDto extends Metadata {
locationMessage: LocationMessage;
locationMessage: LocationMessage;
}
class Row {
title: string;
description: string;
rowId: string;
title: string;
description: string;
rowId: string;
}
class Section {
title: string;
rows: Row[];
title: string;
rows: Row[];
}
class ListMessage {
title: string;
description: string;
footerText?: string;
buttonText: string;
sections: Section[];
title: string;
description: string;
footerText?: string;
buttonText: string;
sections: Section[];
}
export class SendListDto extends Metadata {
listMessage: ListMessage;
listMessage: ListMessage;
}
export class ContactMessage {
fullName: string;
wuid: string;
phoneNumber: string;
organization?: string;
email?: string;
url?: string;
fullName: string;
wuid: string;
phoneNumber: string;
organization?: string;
email?: string;
url?: string;
}
export class SendContactDto extends Metadata {
contactMessage: ContactMessage[];
contactMessage: ContactMessage[];
}
class ReactionMessage {
key: proto.IMessageKey;
reaction: string;
key: proto.IMessageKey;
reaction: string;
}
export class SendReactionDto {
reactionMessage: ReactionMessage;
reactionMessage: ReactionMessage;
}

View File

@@ -1,5 +1,5 @@
export class SettingsDto {
reject_call?: boolean;
msg_call?: string;
groups_ignore?: boolean;
reject_call?: boolean;
msg_call?: string;
groups_ignore?: boolean;
}

View File

@@ -1,6 +1,6 @@
export class WebhookDto {
enabled?: boolean;
url?: string;
events?: string[];
webhook_by_events?: boolean;
enabled?: boolean;
url?: string;
events?: string[];
webhook_by_events?: boolean;
}