Skip to content

Commit a3c6836

Browse files
committed
message: fixed send reaction signature
1 parent ea2112d commit a3c6836

File tree

3 files changed

+6
-22
lines changed

3 files changed

+6
-22
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "evolution-api-sdk",
33
"private": false,
4-
"version": "0.6.7",
4+
"version": "0.6.8",
55
"description": "Unofficial SDK for the Evolution Whatsapp API v2",
66
"main": "lib/index.js",
77
"types": "lib/index.d.ts",

src/modules/chats/index.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import type { ApiService } from "@/api/service";
33
import type { MethodOptions } from "@/types/api";
44

55
import type * as Archive from "./schemas/archive";
6-
import * as Check from "./schemas/check";
6+
import type * as Check from "./schemas/check";
77
import type * as DeleteMessage from "./schemas/delete-message";
88
import type * as FetchProfilePicture from "./schemas/fetch-profile-picture";
99
import type * as FindAll from "./schemas/find-all";
@@ -27,13 +27,15 @@ export class ChatsModule {
2727
numbers: Check.CheckOptions,
2828
methodOptions?: MethodOptions
2929
): Promise<Check.CheckResponse> {
30-
const body = Check.BodySchema.parse(numbers);
30+
const body = {
31+
numbers: Array.isArray(numbers) ? numbers : [numbers],
32+
};
3133
const response = await this.api.post(Routes.Chats.Check, {
3234
body,
3335
...methodOptions,
3436
});
3537

36-
return Check.ResponseSchema.parse(response as Check.CheckResponseRaw[]);
38+
return response as Check.CheckResponse;
3739
}
3840

3941
/**

src/modules/chats/schemas/check.ts

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -18,21 +18,3 @@ export interface CheckResponseItem {
1818

1919
export type CheckOptions = string | string[];
2020
export type CheckResponse = CheckResponseItem[];
21-
22-
// Transform functions
23-
export const CheckBodyTransform = (data: CheckOptions) => ({
24-
numbers: Array.isArray(data) ? data : [data],
25-
});
26-
27-
export const CheckResponseTransform = (
28-
numbers: CheckResponseRaw[]
29-
): CheckResponse =>
30-
numbers.map((number) => ({
31-
exists: number.exists,
32-
jid: Jid(number.jid),
33-
number: parsePhoneNumber(number.number).number,
34-
}));
35-
36-
// Backward compatibility aliases
37-
export const BodySchema = { parse: CheckBodyTransform };
38-
export const ResponseSchema = { parse: CheckResponseTransform };

0 commit comments

Comments
 (0)