File tree Expand file tree Collapse file tree 3 files changed +6
-22
lines changed
Expand file tree Collapse file tree 3 files changed +6
-22
lines changed Original file line number Diff line number Diff line change 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" ,
Original file line number Diff line number Diff line change @@ -3,7 +3,7 @@ import type { ApiService } from "@/api/service";
33import type { MethodOptions } from "@/types/api" ;
44
55import type * as Archive from "./schemas/archive" ;
6- import * as Check from "./schemas/check" ;
6+ import type * as Check from "./schemas/check" ;
77import type * as DeleteMessage from "./schemas/delete-message" ;
88import type * as FetchProfilePicture from "./schemas/fetch-profile-picture" ;
99import 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 /**
Original file line number Diff line number Diff line change @@ -18,21 +18,3 @@ export interface CheckResponseItem {
1818
1919export type CheckOptions = string | string [ ] ;
2020export 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 } ;
You can’t perform that action at this time.
0 commit comments