fix: Corregir imports de Baileys para ESM/CJS
Some checks failed
build-and-deploy / build-and-deploy (push) Has been cancelled

This commit is contained in:
2025-12-02 19:15:08 -06:00
parent a0b1502bb1
commit 767b0800a8
2 changed files with 15 additions and 10 deletions

View File

@@ -3,10 +3,14 @@
* Stores credentials and keys in the database instead of files
*/
import type { AuthenticationCreds, SignalDataTypeMap } from '@whiskeysockets/baileys'
import pkg from '@whiskeysockets/baileys'
const { initAuthCreds, BufferJSON, proto } = pkg
import * as baileys from '@whiskeysockets/baileys'
import { query } from '../../utils/database'
// Get functions from baileys module
const initAuthCreds = (baileys as any).initAuthCreds || (baileys as any).default?.initAuthCreds
const BufferJSON = (baileys as any).BufferJSON || (baileys as any).default?.BufferJSON
const proto = (baileys as any).proto || (baileys as any).default?.proto
export interface PostgresAuthState {
state: {
creds: AuthenticationCreds