diff --git a/src/Socket/business.ts b/src/Socket/business.ts index f410636..e3ea374 100644 --- a/src/Socket/business.ts +++ b/src/Socket/business.ts @@ -278,5 +278,5 @@ export const makeBusinessSocket = (config: SocketConfig) => { productCreate, productDelete, productUpdate - } + } as const } diff --git a/src/Socket/groups.ts b/src/Socket/groups.ts index 98db53e..3fa34a4 100644 --- a/src/Socket/groups.ts +++ b/src/Socket/groups.ts @@ -302,7 +302,7 @@ export const makeGroupsSocket = (config: SocketConfig) => { ]) }, groupFetchAllParticipating - } + } as const } export const extractGroupMetadata = (result: BinaryNode) => { diff --git a/src/Socket/index.ts b/src/Socket/index.ts index 3b07852..6df924e 100644 --- a/src/Socket/index.ts +++ b/src/Socket/index.ts @@ -3,10 +3,11 @@ import { UserFacingSocketConfig } from '../Types' import { makeBusinessSocket } from './business' // export the last socket layer -const makeWASocket = (config: UserFacingSocketConfig) => - makeBusinessSocket({ +const makeWASocket = (config: UserFacingSocketConfig) => { + return makeBusinessSocket({ ...DEFAULT_CONNECTION_CONFIG, ...config }) +} export default makeWASocket diff --git a/src/Socket/newsletter.ts b/src/Socket/newsletter.ts index c0457e8..3592eec 100644 --- a/src/Socket/newsletter.ts +++ b/src/Socket/newsletter.ts @@ -221,7 +221,7 @@ export const makeNewsletterSocket = (sock: GroupsSocket) => { newsletterDelete: async (jid: string) => { await executeWMexQuery({ newsletter_id: jid }, QueryIds.DELETE, XWAPaths.xwa2_newsletter_delete_v2) } - } + } as const } export type NewsletterSocket = ReturnType