@whanext/core 0.14.1 → 0.14.3
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/CHANGELOG.md +18 -0
- package/README.md +2 -0
- package/dist/index.d.ts +0 -6
- package/dist/index.js +6 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,23 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
|
|
4
|
+
## 0.14.3
|
|
5
|
+
|
|
6
|
+
- Corrige uma rejeição órfã durante o login quando a solicitação de código de pareamento falha ao mesmo tempo em que o socket é fechado.
|
|
7
|
+
- Mantém o erro principal de autenticação sem gerar `unhandledRejection` paralelo no processo.
|
|
8
|
+
|
|
9
|
+
## 0.14.2
|
|
10
|
+
|
|
11
|
+
### Corrigido
|
|
12
|
+
|
|
13
|
+
- Mensagens privadas recebidas agora combinam `remoteJid` e `remoteJidAlt` nas identidades normalizadas do remetente, preservando PN JID e LID quando o WhatsApp fornece ambos.
|
|
14
|
+
- `message.sender`, `message.senderIds` e `ctx.user.phone` passam a expor corretamente o número do remetente em chats privados LID sem exigir tratamento de Baileys na aplicação.
|
|
15
|
+
- A identidade alternativa só é usada para mensagens recebidas em chats privados; mensagens de grupo e mensagens `fromMe` mantêm o comportamento anterior.
|
|
16
|
+
|
|
17
|
+
### Compatibilidade
|
|
18
|
+
|
|
19
|
+
- Nenhuma API pública foi removida ou alterada. Aplicações que já usam `ctx.user.phone` passam apenas a receber o número em mais casos.
|
|
20
|
+
|
|
3
21
|
## 0.14.1
|
|
4
22
|
|
|
5
23
|
### Corrigido
|
package/README.md
CHANGED
|
@@ -584,6 +584,8 @@ console.log(app.account.selfChatId); // destino preferencial para falar consigo
|
|
|
584
584
|
|
|
585
585
|
`selfChatId` prioriza o PN JID canônico e remove automaticamente sufixos de dispositivo como `:12@s.whatsapp.net`.
|
|
586
586
|
|
|
587
|
+
Em conversas privadas endereçadas por LID, o provider também aproveita o `remoteJidAlt` enviado pelo WhatsApp para preencher a identidade PN do remetente. Assim, quando esse mapeamento estiver presente no evento ao vivo, `ctx.user.phone` continua retornando o número normalmente mesmo que `ctx.chatId` termine em `@lid`.
|
|
588
|
+
|
|
587
589
|
Na API legada, use `onlyOwner: true`:
|
|
588
590
|
|
|
589
591
|
```ts
|
package/dist/index.d.ts
CHANGED
|
@@ -86,14 +86,8 @@ interface QuotedMessage {
|
|
|
86
86
|
senderId?: string;
|
|
87
87
|
sender?: User;
|
|
88
88
|
hasMedia: boolean;
|
|
89
|
-
/**
|
|
90
|
-
* Indica se a mensagem citada foi enviada como visualização única.
|
|
91
|
-
* O provider oficial sempre preenche este campo.
|
|
92
|
-
*/
|
|
93
89
|
isViewOnce?: boolean;
|
|
94
|
-
/** Classificação normalizada do conteúdo citado. */
|
|
95
90
|
contentKind?: MessageContentKind;
|
|
96
|
-
/** Metadados da mídia citada, quando houver. */
|
|
97
91
|
media?: MessageMedia;
|
|
98
92
|
}
|
|
99
93
|
interface Message {
|
package/dist/index.js
CHANGED
|
@@ -2149,6 +2149,7 @@ var WhaNextApp = class {
|
|
|
2149
2149
|
);
|
|
2150
2150
|
}, options.timeoutMs ?? 3e5);
|
|
2151
2151
|
});
|
|
2152
|
+
void connected.catch(() => void 0);
|
|
2152
2153
|
try {
|
|
2153
2154
|
await this.#provider.connect();
|
|
2154
2155
|
if (this.#phone) {
|
|
@@ -2388,10 +2389,14 @@ function normalizeBaileysMessage(input) {
|
|
|
2388
2389
|
const type = getContentType(content);
|
|
2389
2390
|
const node = type ? content[type] : void 0;
|
|
2390
2391
|
const context = getContextInfo(node);
|
|
2392
|
+
const isPrivateIncoming = !chatId.endsWith("@g.us") && input.key.fromMe !== true;
|
|
2393
|
+
const remoteJidAlt = input.key.remoteJidAlt;
|
|
2391
2394
|
const senderIds = uniqueIdentities([
|
|
2392
2395
|
input.key.participant,
|
|
2393
2396
|
input.key.participantAlt,
|
|
2394
|
-
input.key.participantUsername?.includes("@") ? input.key.participantUsername : void 0
|
|
2397
|
+
input.key.participantUsername?.includes("@") ? input.key.participantUsername : void 0,
|
|
2398
|
+
isPrivateIncoming ? remoteJidAlt : void 0,
|
|
2399
|
+
isPrivateIncoming ? chatId : void 0
|
|
2395
2400
|
]);
|
|
2396
2401
|
const senderJid = senderIds.find((identity) => identity.endsWith("@s.whatsapp.net") || identity.endsWith("@c.us"));
|
|
2397
2402
|
const senderLid = senderIds.find((identity) => identity.endsWith("@lid"));
|