@raphaelvserafim/client-api-whatsapp 1.0.3 → 1.0.5
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/README.md +17 -0
- package/dist/WhatsApp.d.ts +2 -0
- package/dist/WhatsApp.js +1 -1
- package/dist/WhatsApp.js.map +1 -1
- package/dist/model/index.d.ts +2 -1
- package/dist/model/index.js +1 -0
- package/dist/model/index.js.map +1 -1
- package/package.json +1 -1
- package/src/WhatsApp.ts +5 -6
- package/src/model/index.ts +3 -2
package/README.md
CHANGED
|
@@ -98,6 +98,23 @@ whatsapp.sendMessage({
|
|
|
98
98
|
}).catch(console.error)
|
|
99
99
|
```
|
|
100
100
|
|
|
101
|
+
### Link
|
|
102
|
+
```js
|
|
103
|
+
whatsapp.sendMessage({
|
|
104
|
+
type: TypeMessage.LINK,
|
|
105
|
+
body: {
|
|
106
|
+
to: to,
|
|
107
|
+
text: "\n",
|
|
108
|
+
title:"API WhatsApp",
|
|
109
|
+
description:"Simplify communication, send messages in a versatile way and achieve exceptional results for your business",
|
|
110
|
+
thumbnailUrl:"",
|
|
111
|
+
sourceUrl:"https://api-wa.me",
|
|
112
|
+
}
|
|
113
|
+
}).then((response) => {
|
|
114
|
+
console.log(response)
|
|
115
|
+
}).catch(console.error)
|
|
116
|
+
```
|
|
117
|
+
|
|
101
118
|
### Audio
|
|
102
119
|
```js
|
|
103
120
|
whatsapp.sendMessage({
|
package/dist/WhatsApp.d.ts
CHANGED
package/dist/WhatsApp.js
CHANGED
|
@@ -24,7 +24,7 @@ class WhatsApp {
|
|
|
24
24
|
headers: {
|
|
25
25
|
'Content-Type': 'application/json'
|
|
26
26
|
},
|
|
27
|
-
data: this.
|
|
27
|
+
data: (this.method === 'POST' || this.method === 'PUT') ? JSON.stringify(this.body) : undefined
|
|
28
28
|
};
|
|
29
29
|
try {
|
|
30
30
|
const response = await (0, axios_1.default)(options);
|
package/dist/WhatsApp.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WhatsApp.js","sourceRoot":"","sources":["../src/WhatsApp.ts"],"names":[],"mappings":";;;;AAAA,0DAAiE;AACjE,mCAA+G;AAE/G,MAAa,QAAQ;IACF,MAAM,CAAS;IACf,GAAG,CAAS;IACrB,KAAK,CAAS;IACd,MAAM,GAAsB,IAAI,CAAC;IACjC,IAAI,GAAQ,IAAI,CAAC;IAEzB,YAAY,IAAU;QACpB,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC;QAC1B,IAAI,CAAC,GAAG,GAAG,IAAI,CAAC,GAAG,CAAC;IACtB,CAAC;IAEO,KAAK,CAAC,OAAO;QACnB,IAAI,CAAC,IAAI,CAAC,KAAK,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC;YAChC,MAAM,IAAI,KAAK,CAAC,0DAA0D,CAAC,CAAC;QAC9E,CAAC;
|
|
1
|
+
{"version":3,"file":"WhatsApp.js","sourceRoot":"","sources":["../src/WhatsApp.ts"],"names":[],"mappings":";;;;AAAA,0DAAiE;AACjE,mCAA+G;AAE/G,MAAa,QAAQ;IACF,MAAM,CAAS;IACf,GAAG,CAAS;IACrB,KAAK,CAAS;IACd,MAAM,GAAsB,IAAI,CAAC;IACjC,IAAI,GAAQ,IAAI,CAAC;IAEzB,YAAY,IAAU;QACpB,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC;QAC1B,IAAI,CAAC,GAAG,GAAG,IAAI,CAAC,GAAG,CAAC;IACtB,CAAC;IAEO,KAAK,CAAC,OAAO;QACnB,IAAI,CAAC,IAAI,CAAC,KAAK,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC;YAChC,MAAM,IAAI,KAAK,CAAC,0DAA0D,CAAC,CAAC;QAC9E,CAAC;QACD,MAAM,OAAO,GAAuB;YAClC,GAAG,EAAE,GAAG,IAAI,CAAC,MAAM,IAAI,IAAI,CAAC,GAAG,IAAI,IAAI,CAAC,KAAK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AM,CAAC,MAAM,GAAG,GAAG,GAAG,EAAE,CAAC;QACtC,IAAI,CAAC,MAAM,GAAG,kBAAU,CAAC,MAAM,CAAC;QAChC,OAAO,MAAM,IAAI,CAAC,OAAO,EAAE,CAAC;IAC9B,CAAC;IAED,KAAK,CAAC,WAAW,CAAC,IAAY,EAAE,YAAsB;QACpD,IAAI,CAAC,KAAK,GAAG,cAAM,CAAC,MAAM,CAAC;QAC3B,IAAI,CAAC,MAAM,GAAG,kBAAU,CAAC,IAAI,CAAC;QAC9B,IAAI,CAAC,IAAI,GAAG;YACV,IAAI;YACJ,YAAY;SACb,CAAA;QACD,OAAO,MAAM,IAAI,CAAC,OAAO,EAAE,CAAC;IAC9B,CAAC;CAEF;AAjKD,4BAiKC;AAGD,kBAAe,QAAQ,CAAC","sourcesContent":["import axios, { AxiosRequestConfig, AxiosResponse } from 'axios';\nimport { Init, HttpMethod, WebhookBody, Routes, TypeMessage, StatusPresence, Contact, Section } from './model';\n\nexport class WhatsApp {\n private readonly server: string;\n private readonly key: string;\n private route: string;\n private method: HttpMethod | null = null;\n private body: any = null;\n\n constructor(data: Init) {\n this.server = data.server;\n this.key = data.key;\n }\n\n private async request(): Promise<any> {\n if (!this.route || !this.method) {\n throw new Error('Path and method must be defined before making a request.');\n }\n const options: AxiosRequestConfig = {\n url: `${this.server}/${this.key}/${this.route}`,\n method: this.method,\n headers: {\n 'Content-Type': 'application/json'\n },\n data: (this.method === 'POST' || this.method === 'PUT') ? JSON.stringify(this.body) : undefined\n };\n try {\n const response = await axios(options);\n return response.data;\n } catch (error: any) {\n throw new Error(`HTTP Request Error: ${error.message} (status: ${error.response?.status})`);\n }\n }\n\n async connect(): Promise<any> {\n this.route = Routes.INSTANCES;\n this.method = HttpMethod.POST;\n return await this.request();\n }\n\n async info(): Promise<any> {\n this.route = Routes.INSTANCES;\n this.method = HttpMethod.GET;\n return await this.request();\n }\n\n async logout(): Promise<any> {\n this.route = Routes.INSTANCES;\n this.method = HttpMethod.DELETE;\n return await this.request();\n }\n\n async setting(markMessageRead: boolean, saveMedia: boolean): Promise<any> {\n this.route = Routes.INSTANCES + `/?markMessageRead=${markMessageRead}&saveMedia=${saveMedia}`;\n this.method = HttpMethod.PATCH;\n return await this.request();\n }\n\n\n\n async updateWebhook(body: WebhookBody): Promise<any> {\n this.route = Routes.INSTANCES;\n this.method = HttpMethod.PUT;\n this.body = body;\n return await this.request();\n }\n\n\n async sendMessage(\n data: {\n type: TypeMessage,\n body: {\n to: string,\n msgId?: string,\n status?: StatusPresence,\n text?: string,\n url?: string,\n caption?: string,\n mimetype?: string,\n fileName?: string,\n contact?: Contact,\n location?: Location,\n name?: string,\n options?: string[],\n sections?: Section,\n footer?: string,\n description?: string,\n title?: string,\n buttonText?: string,\n thumbnailUrl?: string,\n sourceUrl?: string,\n }\n }, reply: boolean = false): Promise<any> {\n if (reply) {\n this.route = Routes.MESSAGES + \"/\" + data.body.msgId + \"/\" + data.type;\n } else {\n this.route = Routes.MESSAGES + \"/\" + data.type;\n }\n\n this.method = HttpMethod.POST;\n this.body = data.body;\n return await this.request();\n }\n\n async checkRegisteredWhatsapp(number: string) {\n this.route = Routes.ACTIONS + \"/registered?number=\" + number;\n this.method = HttpMethod.GET;\n return await this.request();\n }\n\n\n async contacts() {\n this.route = Routes.CONTACTS;\n this.method = HttpMethod.GET;\n return await this.request();\n }\n\n async contactProfile(id: string) {\n this.route = Routes.CONTACTS + \"/\" + id;\n this.method = HttpMethod.GET;\n return await this.request();\n }\n\n\n async groups() {\n this.route = Routes.GROUPS;\n this.method = HttpMethod.GET;\n return await this.request();\n }\n\n\n async infoGroup(id: string) {\n this.route = Routes.GROUPS + \"/\" + id;\n this.method = HttpMethod.GET;\n return await this.request();\n }\n\n async updateGroup(id: string, name: string, description: string) {\n this.route = Routes.GROUPS + \"/\" + id;\n this.method = HttpMethod.PUT;\n this.body = {\n name,\n description\n }\n return await this.request();\n }\n\n async leaveGroup(id: string) {\n this.route = Routes.GROUPS + \"/\" + id;\n this.method = HttpMethod.DELETE;\n return await this.request();\n }\n\n async createGroup(name: string, participants: string[]) {\n this.route = Routes.GROUPS;\n this.method = HttpMethod.POST;\n this.body = {\n name,\n participants\n }\n return await this.request();\n }\n\n}\n\n\nexport default WhatsApp;\n\n\n"]}
|
package/dist/model/index.d.ts
CHANGED
package/dist/model/index.js
CHANGED
|
@@ -28,6 +28,7 @@ var TypeMessage;
|
|
|
28
28
|
TypeMessage["CONTACT"] = "contact";
|
|
29
29
|
TypeMessage["LOCATION"] = "location";
|
|
30
30
|
TypeMessage["REACTION"] = "reaction";
|
|
31
|
+
TypeMessage["LINK"] = "link";
|
|
31
32
|
})(TypeMessage || (exports.TypeMessage = TypeMessage = {}));
|
|
32
33
|
var StatusPresence;
|
|
33
34
|
(function (StatusPresence) {
|
package/dist/model/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/model/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,MAMX;AAND,WAAY,MAAM;IAChB,gCAAsB,CAAA;IACtB,8BAAoB,CAAA;IACpB,+BAAqB,CAAA;IACrB,2BAAiB,CAAA;IACjB,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/model/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,MAMX;AAND,WAAY,MAAM;IAChB,gCAAsB,CAAA;IACtB,8BAAoB,CAAA;IACpB,+BAAqB,CAAA;IACrB,2BAAiB,CAAA;IACjB,6BAAmB,CAAA;AACrB,CAAC,EANW,MAAM,sBAAN,MAAM,QAMjB;AAGD,IAAY,WAWX;AAXD,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;AACf,CAAC,EAXW,WAAW,2BAAX,WAAW,QAWtB;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}\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}\n\n\nexport enum StatusPresence {\n UNAVAILABLE = 'unavailable',\n AVAILABLE = 'available',\n COMPOSING = 'composing',\n RECORDING = 'recording',\n PAUSED = 'paused',\n}\n\n\n\nexport interface WebhookBody {\n allowWebhook: boolean;\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}"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@raphaelvserafim/client-api-whatsapp",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.5",
|
|
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",
|
package/src/WhatsApp.ts
CHANGED
|
@@ -17,25 +17,22 @@ export class WhatsApp {
|
|
|
17
17
|
if (!this.route || !this.method) {
|
|
18
18
|
throw new Error('Path and method must be defined before making a request.');
|
|
19
19
|
}
|
|
20
|
-
|
|
21
20
|
const options: AxiosRequestConfig = {
|
|
22
21
|
url: `${this.server}/${this.key}/${this.route}`,
|
|
23
22
|
method: this.method,
|
|
24
23
|
headers: {
|
|
25
24
|
'Content-Type': 'application/json'
|
|
26
25
|
},
|
|
27
|
-
data: this.
|
|
26
|
+
data: (this.method === 'POST' || this.method === 'PUT') ? JSON.stringify(this.body) : undefined
|
|
28
27
|
};
|
|
29
|
-
|
|
30
28
|
try {
|
|
31
|
-
const response
|
|
29
|
+
const response = await axios(options);
|
|
32
30
|
return response.data;
|
|
33
31
|
} catch (error: any) {
|
|
34
32
|
throw new Error(`HTTP Request Error: ${error.message} (status: ${error.response?.status})`);
|
|
35
33
|
}
|
|
36
34
|
}
|
|
37
35
|
|
|
38
|
-
|
|
39
36
|
async connect(): Promise<any> {
|
|
40
37
|
this.route = Routes.INSTANCES;
|
|
41
38
|
this.method = HttpMethod.POST;
|
|
@@ -91,8 +88,10 @@ export class WhatsApp {
|
|
|
91
88
|
description?: string,
|
|
92
89
|
title?: string,
|
|
93
90
|
buttonText?: string,
|
|
91
|
+
thumbnailUrl?: string,
|
|
92
|
+
sourceUrl?: string,
|
|
94
93
|
}
|
|
95
|
-
}, reply: boolean = false
|
|
94
|
+
}, reply: boolean = false): Promise<any> {
|
|
96
95
|
if (reply) {
|
|
97
96
|
this.route = Routes.MESSAGES + "/" + data.body.msgId + "/" + data.type;
|
|
98
97
|
} else {
|
package/src/model/index.ts
CHANGED
|
@@ -17,7 +17,7 @@ export enum Routes {
|
|
|
17
17
|
MESSAGES = 'message',
|
|
18
18
|
CONTACTS = 'contacts',
|
|
19
19
|
GROUPS = 'groups',
|
|
20
|
-
ACTIONS= 'actions',
|
|
20
|
+
ACTIONS = 'actions',
|
|
21
21
|
}
|
|
22
22
|
|
|
23
23
|
|
|
@@ -30,7 +30,8 @@ export enum TypeMessage {
|
|
|
30
30
|
DOCUMENT = 'document',
|
|
31
31
|
CONTACT = 'contact',
|
|
32
32
|
LOCATION = 'location',
|
|
33
|
-
REACTION = 'reaction'
|
|
33
|
+
REACTION = 'reaction',
|
|
34
|
+
LINK = 'link',
|
|
34
35
|
}
|
|
35
36
|
|
|
36
37
|
|