@raphaelvserafim/client-api-whatsapp 1.4.0 → 1.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/types/index.d.ts +29 -18
- package/dist/types/index.js.map +1 -1
- package/package.json +1 -1
package/dist/types/index.d.ts
CHANGED
|
@@ -91,33 +91,43 @@ export interface InfoInstance {
|
|
|
91
91
|
status: number;
|
|
92
92
|
instance: Instance;
|
|
93
93
|
}
|
|
94
|
-
export interface
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
94
|
+
export interface IInstanceConfig {
|
|
95
|
+
markMessages: boolean;
|
|
96
|
+
receiveStatusMessage: boolean;
|
|
97
|
+
receivePresence: boolean;
|
|
98
|
+
saveMedia: boolean;
|
|
98
99
|
permission: number;
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
100
|
+
proxy: string | null;
|
|
101
|
+
mongoDB: {
|
|
102
|
+
uri: string | null;
|
|
103
|
+
dbName: string | null;
|
|
104
|
+
};
|
|
105
|
+
}
|
|
106
|
+
export interface Instance {
|
|
107
|
+
mobile: boolean;
|
|
108
|
+
socketConnection: number;
|
|
109
|
+
user: User;
|
|
102
110
|
phoneConnected: boolean;
|
|
111
|
+
status: string;
|
|
103
112
|
webhook: Webhook;
|
|
104
|
-
|
|
113
|
+
config: IInstanceConfig;
|
|
114
|
+
businessProfile: BusinessProfile;
|
|
105
115
|
}
|
|
106
116
|
export interface User {
|
|
107
|
-
id
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
imageProfile
|
|
117
|
+
id: string;
|
|
118
|
+
name: string;
|
|
119
|
+
lid: string;
|
|
120
|
+
imageProfile: string;
|
|
111
121
|
}
|
|
112
122
|
export interface Webhook {
|
|
113
123
|
allowWebhook: boolean;
|
|
114
|
-
allowNumber
|
|
124
|
+
allowNumber: string;
|
|
115
125
|
webhookMessage: string;
|
|
116
|
-
webhookGroup: string;
|
|
117
126
|
webhookConnection: string;
|
|
118
|
-
|
|
119
|
-
webhookMessageFromMe: string;
|
|
127
|
+
webhookGroup: string;
|
|
120
128
|
webhookHistory: string;
|
|
129
|
+
webhookMessageFromMe: string;
|
|
130
|
+
webhookQrCode: string;
|
|
121
131
|
}
|
|
122
132
|
export interface SendMessageRoot {
|
|
123
133
|
status: number;
|
|
@@ -154,9 +164,10 @@ export interface PairingCodeResponse {
|
|
|
154
164
|
export interface BusinessProfile {
|
|
155
165
|
wid: string;
|
|
156
166
|
description: string;
|
|
157
|
-
|
|
167
|
+
address: string;
|
|
168
|
+
email: string;
|
|
169
|
+
website: any[];
|
|
158
170
|
category: string;
|
|
159
|
-
business_hours: Record<string, unknown>;
|
|
160
171
|
}
|
|
161
172
|
export interface Buttons {
|
|
162
173
|
type: "quick_reply" | "cta_copy" | "cta_url" | "cta_call";
|
package/dist/types/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":";;;AAKA,IAAY,UAMX;AAND,WAAY,UAAU;IACpB,yBAAW,CAAA;IACX,2BAAa,CAAA;IACb,yBAAW,CAAA;IACX,+BAAiB,CAAA;IACjB,6BAAe,CAAA;AACjB,CAAC,EANW,UAAU,0BAAV,UAAU,QAMrB;AAGD,IAAY,MAaX;AAbD,WAAY,MAAM;IAChB,gCAAsB,CAAA;IACtB,8BAAoB,CAAA;IACpB,+BAAqB,CAAA;IACrB,2BAAiB,CAAA;IACjB,6BAAmB,CAAA;IACnB,uBAAa,CAAA;IACb,uBAAa,CAAA;IACb,2BAAiB,CAAA;IACjB,iCAAuB,CAAA;IACvB,+BAAqB,CAAA;IACrB,mCAAyB,CAAA;IACzB,2BAAiB,CAAA;AACnB,CAAC,EAbW,MAAM,sBAAN,MAAM,QAajB;AAGD,IAAY,WAuBX;AAvBD,WAAY,WAAW;IACrB,oCAAqB,CAAA;IACrB,4BAAa,CAAA;IACb,8BAAe,CAAA;IACf,8BAAe,CAAA;IACf,8BAAe,CAAA;IACf,oCAAqB,CAAA;IACrB,kCAAmB,CAAA;IACnB,oCAAqB,CAAA;IACrB,oCAAqB,CAAA;IACrB,4BAAa,CAAA;IACb,8BAAe,CAAA;IACf,4CAA6B,CAAA;IAC7B,8CAA+B,CAAA;IAC/B,iCAAkB,CAAA;IAClB,8BAAe,CAAA;IACf,4BAAa,CAAA;IACb,kCAAmB,CAAA;IACnB,wCAAyB,CAAA;IACzB,+BAAgB,CAAA;IAChB,8BAAe,CAAA;IACf,0BAAW,CAAA;IACX,sCAAuB,CAAA;AACzB,CAAC,EAvBW,WAAW,2BAAX,WAAW,QAuBtB;AAGD,IAAY,cAMX;AAND,WAAY,cAAc;IACxB,6CAA2B,CAAA;IAC3B,yCAAuB,CAAA;IACvB,yCAAuB,CAAA;IACvB,yCAAuB,CAAA;IACvB,mCAAiB,CAAA;AACnB,CAAC,EANW,cAAc,8BAAd,cAAc,QAMzB","sourcesContent":["export interface Init {\n server: string;\n key: string;\n}\n\nexport enum HttpMethod {\n GET = 'GET',\n POST = 'POST',\n PUT = 'PUT',\n DELETE = 'DELETE',\n PATCH = 'PATCH',\n}\n\n\nexport enum Routes {\n INSTANCES = 'instance',\n MESSAGES = 'message',\n CONTACTS = 'contacts',\n GROUPS = 'groups',\n ACTIONS = 'actions',\n CALL = 'call',\n CHAT = 'chat',\n LABELS = 'labels',\n COMMUNITY = 'community',\n BUSINESS = 'business',\n NEWSLETTER = 'newsletter',\n STATUS = 'status',\n}\n\n\nexport enum TypeMessage {\n PRESENCE = 'presence',\n TEXT = 'text',\n AUDIO = 'audio',\n IMAGE = 'image',\n VIDEO = 'video',\n DOCUMENT = 'document',\n CONTACT = 'contact',\n LOCATION = 'location',\n REACTION = 'reaction',\n LINK = 'link',\n TITLE = 'title',\n BUTTON_REPLY = 'button_reply',\n BUTTON_ACTION = 'button_action',\n BUTTON_PIX = 'pix',\n POLL = 'survey',\n MENU = 'list',\n STICKER = 'sticker',\n VIDEO_NOTE = 'video-note',\n POLL_V2 = 'poll',\n EVENT = 'event',\n PIN = 'pin',\n CALL_LINK = 'call-link',\n}\n\n\nexport enum StatusPresence {\n UNAVAILABLE = 'unavailable',\n AVAILABLE = 'available',\n COMPOSING = 'composing',\n RECORDING = 'recording',\n PAUSED = 'paused',\n}\n\n\nexport interface ApiResponse {\n status: number;\n message: string;\n}\n\n\nexport interface WebhookBody {\n allowWebhook: boolean;\n allowNumber?: string;\n webhookMessage: string;\n webhookGroup: string;\n webhookConnection: string;\n webhookQrCode: string;\n webhookMessageFromMe: string;\n webhookHistory: string;\n}\n\nexport interface Contact {\n fullName: string;\n phoneNumber: string;\n organization?: string;\n}\n\n\nexport interface Location {\n latitude: number;\n longitude: number;\n address: string;\n}\n\nexport interface Row {\n title: string;\n description: string;\n rowId: string;\n}\n\nexport interface Section {\n title: string;\n rows: Row[];\n}\n\
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":";;;AAKA,IAAY,UAMX;AAND,WAAY,UAAU;IACpB,yBAAW,CAAA;IACX,2BAAa,CAAA;IACb,yBAAW,CAAA;IACX,+BAAiB,CAAA;IACjB,6BAAe,CAAA;AACjB,CAAC,EANW,UAAU,0BAAV,UAAU,QAMrB;AAGD,IAAY,MAaX;AAbD,WAAY,MAAM;IAChB,gCAAsB,CAAA;IACtB,8BAAoB,CAAA;IACpB,+BAAqB,CAAA;IACrB,2BAAiB,CAAA;IACjB,6BAAmB,CAAA;IACnB,uBAAa,CAAA;IACb,uBAAa,CAAA;IACb,2BAAiB,CAAA;IACjB,iCAAuB,CAAA;IACvB,+BAAqB,CAAA;IACrB,mCAAyB,CAAA;IACzB,2BAAiB,CAAA;AACnB,CAAC,EAbW,MAAM,sBAAN,MAAM,QAajB;AAGD,IAAY,WAuBX;AAvBD,WAAY,WAAW;IACrB,oCAAqB,CAAA;IACrB,4BAAa,CAAA;IACb,8BAAe,CAAA;IACf,8BAAe,CAAA;IACf,8BAAe,CAAA;IACf,oCAAqB,CAAA;IACrB,kCAAmB,CAAA;IACnB,oCAAqB,CAAA;IACrB,oCAAqB,CAAA;IACrB,4BAAa,CAAA;IACb,8BAAe,CAAA;IACf,4CAA6B,CAAA;IAC7B,8CAA+B,CAAA;IAC/B,iCAAkB,CAAA;IAClB,8BAAe,CAAA;IACf,4BAAa,CAAA;IACb,kCAAmB,CAAA;IACnB,wCAAyB,CAAA;IACzB,+BAAgB,CAAA;IAChB,8BAAe,CAAA;IACf,0BAAW,CAAA;IACX,sCAAuB,CAAA;AACzB,CAAC,EAvBW,WAAW,2BAAX,WAAW,QAuBtB;AAGD,IAAY,cAMX;AAND,WAAY,cAAc;IACxB,6CAA2B,CAAA;IAC3B,yCAAuB,CAAA;IACvB,yCAAuB,CAAA;IACvB,yCAAuB,CAAA;IACvB,mCAAiB,CAAA;AACnB,CAAC,EANW,cAAc,8BAAd,cAAc,QAMzB","sourcesContent":["export interface Init {\n server: string;\n key: string;\n}\n\nexport enum HttpMethod {\n GET = 'GET',\n POST = 'POST',\n PUT = 'PUT',\n DELETE = 'DELETE',\n PATCH = 'PATCH',\n}\n\n\nexport enum Routes {\n INSTANCES = 'instance',\n MESSAGES = 'message',\n CONTACTS = 'contacts',\n GROUPS = 'groups',\n ACTIONS = 'actions',\n CALL = 'call',\n CHAT = 'chat',\n LABELS = 'labels',\n COMMUNITY = 'community',\n BUSINESS = 'business',\n NEWSLETTER = 'newsletter',\n STATUS = 'status',\n}\n\n\nexport enum TypeMessage {\n PRESENCE = 'presence',\n TEXT = 'text',\n AUDIO = 'audio',\n IMAGE = 'image',\n VIDEO = 'video',\n DOCUMENT = 'document',\n CONTACT = 'contact',\n LOCATION = 'location',\n REACTION = 'reaction',\n LINK = 'link',\n TITLE = 'title',\n BUTTON_REPLY = 'button_reply',\n BUTTON_ACTION = 'button_action',\n BUTTON_PIX = 'pix',\n POLL = 'survey',\n MENU = 'list',\n STICKER = 'sticker',\n VIDEO_NOTE = 'video-note',\n POLL_V2 = 'poll',\n EVENT = 'event',\n PIN = 'pin',\n CALL_LINK = 'call-link',\n}\n\n\nexport enum StatusPresence {\n UNAVAILABLE = 'unavailable',\n AVAILABLE = 'available',\n COMPOSING = 'composing',\n RECORDING = 'recording',\n PAUSED = 'paused',\n}\n\n\nexport interface ApiResponse {\n status: number;\n message: string;\n}\n\n\nexport interface WebhookBody {\n allowWebhook: boolean;\n allowNumber?: string;\n webhookMessage: string;\n webhookGroup: string;\n webhookConnection: string;\n webhookQrCode: string;\n webhookMessageFromMe: string;\n webhookHistory: string;\n}\n\nexport interface Contact {\n fullName: string;\n phoneNumber: string;\n organization?: string;\n}\n\n\nexport interface Location {\n latitude: number;\n longitude: number;\n address: string;\n}\n\nexport interface Row {\n title: string;\n description: string;\n rowId: string;\n}\n\nexport interface Section {\n title: string;\n rows: Row[];\n}\n\nexport interface InfoInstance {\n status: number;\n instance: Instance;\n}\n\nexport interface IInstanceConfig {\n markMessages: boolean\n receiveStatusMessage: boolean\n receivePresence: boolean\n saveMedia: boolean\n permission: number\n proxy: string | null\n mongoDB: {\n uri: string | null\n dbName: string | null\n }\n}\n\nexport interface Instance {\n mobile: boolean\n socketConnection: number\n user: User\n phoneConnected: boolean\n status: string\n webhook: Webhook\n config: IInstanceConfig\n businessProfile: BusinessProfile\n}\n\nexport interface User {\n id: string\n name: string\n lid: string\n imageProfile: string\n}\n\nexport interface Webhook {\n allowWebhook: boolean\n allowNumber: string\n webhookMessage: string\n webhookConnection: string\n webhookGroup: string\n webhookHistory: string\n webhookMessageFromMe: string\n webhookQrCode: string\n}\n\nexport interface SendMessageRoot {\n status: number;\n data: MessageData;\n}\n\nexport interface MessageData {\n key: MessageKey;\n message: MessageContent;\n messageTimestamp: string;\n status: string;\n}\n\nexport interface MessageKey {\n remoteJid: string;\n fromMe: boolean;\n id: string;\n}\n\nexport interface MessageContent {\n extendedTextMessage?: ExtendedTextMessage;\n}\n\nexport interface ExtendedTextMessage {\n text: string;\n}\n\nexport interface Connect {\n status: number;\n phoneConnected: boolean;\n qrcode: string;\n image: string;\n user?: User;\n}\n\n\nexport interface PairingCodeResponse {\n status: number;\n code: string;\n}\n\n\nexport interface BusinessProfile {\n wid: string\n description: string\n address: string\n email: string\n website: any[]\n category: string\n}\n\n\n\n\nexport interface Buttons {\n type: \"quick_reply\" | \"cta_copy\" | \"cta_url\" | \"cta_call\";\n copy_code?: string;\n phone_number?: string;\n url?: string;\n id?: string;\n text: string;\n}\n\n\nexport interface Items {\n id: string;\n name: string;\n price: number;\n quantity: number;\n}\n\n\nexport interface HeaderMedia {\n title?: string;\n hasMediaAttachment?: boolean;\n imageMessage?: { url: string };\n videoMessage?: { url: string };\n documentMessage?: { url: string; mimetype?: string; fileName?: string };\n}\n\n\nexport interface DownloadableMessage {\n mediaKey: string;\n directPath: string;\n url: string;\n}\n\n\nexport interface Product {\n name: string;\n description?: string;\n originCountryCode?: string;\n currency?: string;\n price?: number;\n images?: { url: string }[];\n}\n\n\nexport interface CommunityCreate {\n name: string;\n subject: string;\n}\n\nexport interface CommunityUpdate {\n subject: string;\n description: string;\n}\n\n\nexport interface GroupParticipantsAction {\n participants: string[];\n action: 'reject' | 'approve';\n}\n\n\nexport interface MobileRegisterData {\n phoneNumberCountryCode: string;\n phoneNumberNationalNumber: string;\n phoneNumberMobileNetworkCode: string;\n}\n\n\nexport interface EventData {\n to: string;\n name: string;\n description?: string;\n startTime?: string;\n locationName?: string;\n locationAddress?: string;\n}\n\n\nexport interface RegisteredResponse {\n status: number;\n registered: boolean;\n}\n\n\nexport interface ContactInfo {\n id: string;\n name?: string;\n notify?: string;\n imgUrl?: string;\n}\n\n\nexport interface GroupInfo {\n id: string;\n subject: string;\n owner: string;\n creation: number;\n desc?: string;\n participants: GroupParticipant[];\n}\n\nexport interface GroupParticipant {\n id: string;\n admin?: string;\n}\n\n\nexport interface InviteCodeResponse {\n status: number;\n inviteCode: string;\n}\n\n\nexport interface ChatInfo {\n id: string;\n name?: string;\n timestamp?: number;\n unreadCount?: number;\n}\n\n\nexport interface LabelInfo {\n id: string;\n name: string;\n color?: number;\n}\n\n\nexport interface CommunityInfo {\n id: string;\n name: string;\n subject?: string;\n description?: string;\n participants?: GroupParticipant[];\n}\n\n\nexport interface CatalogResponse {\n status: number;\n data: Product[];\n cursor?: string;\n}\n\n\nexport interface WebhookStatistics {\n status: number;\n data: Record<string, unknown>;\n}\n\n\nexport interface ListMessagesResponse {\n status: number;\n data: MessageData[];\n page?: number;\n limit?: number;\n total?: number;\n}\n\n\nexport interface DownloadMediaResponse {\n status: number;\n data: string;\n}\n\n\nexport interface CallResponse {\n status: number;\n data: Record<string, unknown>;\n}\n\n\nexport interface LiveLocationData {\n to: string;\n latitude: number;\n longitude: number;\n caption?: string;\n}\n\n\nexport interface SendContactsData {\n to: string;\n displayName: string;\n contacts: Contact[];\n}\n\n\nexport interface ProductMessageData {\n to: string;\n businessOwnerJid: string;\n productId: string;\n catalogId: string;\n body?: string;\n footer?: string;\n}\n\n\nexport interface GroupInviteMessageData {\n to: string;\n groupJid: string;\n groupName: string;\n inviteCode: string;\n inviteExpiration?: number;\n caption?: string;\n}\n\n\nexport interface StatusTextData {\n text: string;\n statusJidList?: string[];\n}\n\n\nexport interface StatusMediaData {\n url: string;\n caption?: string;\n statusJidList?: string[];\n}\n\n\nexport interface StatusMentionData {\n jid: string;\n statusMsgId: string;\n}\n\n\nexport interface NewsletterInfo {\n id: string;\n name?: string;\n description?: string;\n subscribers?: number;\n}\n\n\nexport interface CommunityGroupCreate {\n subject: string;\n participants?: string[];\n}\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@raphaelvserafim/client-api-whatsapp",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.5.0",
|
|
4
4
|
"description": "With our API, you can send text, audio, video, and image messages quickly and easily. Adapt to your business communication needs comprehensively.",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|