diff --git a/CHANGELOG.md b/CHANGELOG.md index ad7d50170b..9b175c0fbd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,9 +1,4 @@ -# 3.8.0 (2024-07-26) - - -### Bug Fixes - -* Fixed sendListMessage and send product (close [#2162](https://github.com/wppconnect-team/wa-js/issues/2162) close [#2163](https://github.com/wppconnect-team/wa-js/issues/2163)) ([1136e0a](https://github.com/wppconnect-team/wa-js/commit/1136e0aeee2ab4682851b0ec3464db52b247c9f3)) +## 3.8.1 (2024-07-31) diff --git a/package-lock.json b/package-lock.json index 47a19b1482..be357759e2 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@wppconnect/wa-js", - "version": "3.8.0", + "version": "3.8.1", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@wppconnect/wa-js", - "version": "3.8.0", + "version": "3.8.1", "license": "Apache-2.0", "devDependencies": { "@commitlint/cli": "^19.3.0", @@ -21,7 +21,7 @@ "@types/shelljs": "^0.8.15", "@typescript-eslint/eslint-plugin": "^7.18.0", "@typescript-eslint/parser": "^7.18.0", - "@wppconnect/wa-version": "^1.5.143", + "@wppconnect/wa-version": "^1.5.149", "buffer": "^6.0.3", "compare-versions": "^6.1.1", "compressorjs": "^1.2.1", @@ -1756,9 +1756,9 @@ } }, "node_modules/@wppconnect/wa-version": { - "version": "1.5.143", - "resolved": "https://registry.npmjs.org/@wppconnect/wa-version/-/wa-version-1.5.143.tgz", - "integrity": "sha512-6uT33iOsX5/EqsYt1CSN7qtV9n49uc39HPqnM3/9DNEbzGW689zt83BoCh5e9109xUctpej2qif5/XkpGMcsGQ==", + "version": "1.5.149", + "resolved": "https://registry.npmjs.org/@wppconnect/wa-version/-/wa-version-1.5.149.tgz", + "integrity": "sha512-HmwDmP6PmXZrw5R//rUUbI9k3twwMDz+96bl3anPb93zwEX/yEVgh5ZitL37Gl/aF2qaMjPdgS0xV4v4N/RSGQ==", "dev": true, "license": "Apache-2.0", "dependencies": { diff --git a/package.json b/package.json index c82638256a..e87fe28a01 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@wppconnect/wa-js", - "version": "3.8.0", + "version": "3.8.1", "description": "WPPConnect/WA-JS is an open-source project with the aim of exporting functions from WhatsApp Web", "license": "Apache-2.0", "author": { @@ -51,7 +51,7 @@ "@types/shelljs": "^0.8.15", "@typescript-eslint/eslint-plugin": "^7.18.0", "@typescript-eslint/parser": "^7.18.0", - "@wppconnect/wa-version": "^1.5.143", + "@wppconnect/wa-version": "^1.5.149", "buffer": "^6.0.3", "compare-versions": "^6.1.1", "compressorjs": "^1.2.1", diff --git a/src/conn/patch.ts b/src/conn/patch.ts index 2bca80a768..dcd486f63e 100644 --- a/src/conn/patch.ts +++ b/src/conn/patch.ts @@ -16,8 +16,8 @@ import * as webpack from '../webpack'; import { IsOfficialClient } from '../whatsapp'; -import { wrapModuleFunction } from '../whatsapp/exportModule'; -import { isLegitErrorStack } from '../whatsapp/functions'; +//import { wrapModuleFunction } from '../whatsapp/exportModule'; +//import { isLegitErrorStack } from '../whatsapp/functions'; webpack.onInjected(() => { /** @@ -26,8 +26,11 @@ webpack.onInjected(() => { IsOfficialClient.isOfficialClient = true; }); +/* +// Commented for >= 2.3000.1015x run, i will fix soon webpack.onFullReady(() => { wrapModuleFunction(isLegitErrorStack, () => { return true; }); }, 1000); +*/ diff --git a/src/webpack/index.ts b/src/webpack/index.ts index b88528e21a..d60ddc1c37 100644 --- a/src/webpack/index.ts +++ b/src/webpack/index.ts @@ -348,6 +348,7 @@ export function search( condition: SearchModuleCondition, reverse = false ): T | null { + console.log(condition); const moduleId = searchId(condition, reverse); if (!moduleId) { diff --git a/src/whatsapp/collections/BlocklistCollection.ts b/src/whatsapp/collections/BlocklistCollection.ts index d34475f8cf..710a08a5c2 100644 --- a/src/whatsapp/collections/BlocklistCollection.ts +++ b/src/whatsapp/collections/BlocklistCollection.ts @@ -29,7 +29,7 @@ export declare class BlocklistCollection extends Collection { exportModule( exports, { - BlocklistCollection: 'BlocklistCollectionImpl', + BlocklistCollection: ['BlocklistCollectionImpl', 'BlocklistCollection'], }, - (m) => m.BlocklistCollectionImpl + (m) => m.BlocklistCollectionImpl || m.BlocklistCollection ); diff --git a/src/whatsapp/collections/BusinessProfileCollection.ts b/src/whatsapp/collections/BusinessProfileCollection.ts index 021f13d754..a0c85a4cde 100644 --- a/src/whatsapp/collections/BusinessProfileCollection.ts +++ b/src/whatsapp/collections/BusinessProfileCollection.ts @@ -31,7 +31,10 @@ export declare class BusinessProfileCollection extends Collection m.BusinessProfileCollectionImpl + (m) => m.BusinessProfileCollectionImpl || m.BusinessProfileCollection ); diff --git a/src/whatsapp/collections/CartCollection.ts b/src/whatsapp/collections/CartCollection.ts index 4c16384827..5daefe2cfb 100644 --- a/src/whatsapp/collections/CartCollection.ts +++ b/src/whatsapp/collections/CartCollection.ts @@ -30,6 +30,6 @@ export declare class CartCollection extends Collection { } exportModule( exports, - { CartCollection: 'CartCollectionImpl' }, - (m) => m.CartCollectionImpl + { CartCollection: ['CartCollectionImpl', 'CartCollection'] }, + (m) => m.CartCollectionImpl || m.CartCollection ); diff --git a/src/whatsapp/collections/CatalogCollection.ts b/src/whatsapp/collections/CatalogCollection.ts index 81b7858d5b..d7debbfcfd 100644 --- a/src/whatsapp/collections/CatalogCollection.ts +++ b/src/whatsapp/collections/CatalogCollection.ts @@ -46,6 +46,6 @@ export declare class CatalogCollection extends Collection { } exportModule( exports, - { CatalogCollection: 'CatalogCollectionImpl' }, + { CatalogCollection: ['CatalogCollectionImpl', 'CatalogCollection'] }, (m) => m.CatalogCollectionImpl || m.CatalogCollection ); diff --git a/src/whatsapp/collections/EmojiVariantCollection.ts b/src/whatsapp/collections/EmojiVariantCollection.ts index 473593998f..90ce689b21 100644 --- a/src/whatsapp/collections/EmojiVariantCollection.ts +++ b/src/whatsapp/collections/EmojiVariantCollection.ts @@ -31,7 +31,10 @@ export declare class EmojiVariantCollection extends Collection m.EmojiVariantCollectionImpl + (m) => m.EmojiVariantCollectionImpl || m.EmojiVariantCollection ); diff --git a/src/whatsapp/collections/MuteCollection.ts b/src/whatsapp/collections/MuteCollection.ts index e302157fea..3d8c8c0fbc 100644 --- a/src/whatsapp/collections/MuteCollection.ts +++ b/src/whatsapp/collections/MuteCollection.ts @@ -36,6 +36,6 @@ export declare class MuteCollection extends Collection { } exportModule( exports, - { MuteCollection: 'MuteCollectionImpl' }, - (m) => m.MuteCollectionImpl + { MuteCollection: ['MuteCollectionImpl', 'MuteCollection'] }, + (m) => m.MuteCollectionImpl || m.MuteCollection ); diff --git a/src/whatsapp/collections/OrderCollection.ts b/src/whatsapp/collections/OrderCollection.ts index 68f5f7409a..bf25b24ed9 100644 --- a/src/whatsapp/collections/OrderCollection.ts +++ b/src/whatsapp/collections/OrderCollection.ts @@ -31,6 +31,6 @@ export declare class OrderCollection extends Collection { } exportModule( exports, - { OrderCollection: 'OrderCollectionImpl' }, - (m) => m.OrderCollectionImpl + { OrderCollection: ['OrderCollectionImpl', 'OrderCollection'] }, + (m) => m.OrderCollectionImpl || m.OrderCollection ); diff --git a/src/whatsapp/collections/PinInChatCollection.ts b/src/whatsapp/collections/PinInChatCollection.ts index 5a2bb2e847..8c80e1018a 100644 --- a/src/whatsapp/collections/PinInChatCollection.ts +++ b/src/whatsapp/collections/PinInChatCollection.ts @@ -32,6 +32,6 @@ export declare class PinInChatCollection extends Collection { } exportModule( exports, - { PinInChatCollection: 'PinInChatCollectionImpl' }, - (m) => m.PinInChatCollectionImpl + { PinInChatCollection: ['PinInChatCollectionImpl', 'PinInChatCollection'] }, + (m) => m.PinInChatCollectionImpl || m.PinInChatCollection ); diff --git a/src/whatsapp/collections/PresenceCollection.ts b/src/whatsapp/collections/PresenceCollection.ts index 5fb6c77b6d..5b3e9bd8cd 100644 --- a/src/whatsapp/collections/PresenceCollection.ts +++ b/src/whatsapp/collections/PresenceCollection.ts @@ -29,7 +29,7 @@ export declare class PresenceCollection extends BaseCollection { exportModule( exports, { - PresenceCollection: 'PresenceCollectionImpl', + PresenceCollection: ['PresenceCollectionImpl', 'PresenceCollection'], }, (m) => m.PresenceCollectionImpl || m.PresenceCollection ); diff --git a/src/whatsapp/collections/ProductMessageListCollection.ts b/src/whatsapp/collections/ProductMessageListCollection.ts index 8ae3ec5331..1dd5929e38 100644 --- a/src/whatsapp/collections/ProductMessageListCollection.ts +++ b/src/whatsapp/collections/ProductMessageListCollection.ts @@ -27,7 +27,10 @@ export declare class ProductMessageListCollection extends Collection m.ProductMessageListCollectionImpl + (m) => m.ProductMessageListCollectionImpl || m.ProductMessageListCollection ); diff --git a/src/whatsapp/collections/RecentEmojiCollection.ts b/src/whatsapp/collections/RecentEmojiCollection.ts index dc07a562cb..a04ee0a678 100644 --- a/src/whatsapp/collections/RecentEmojiCollection.ts +++ b/src/whatsapp/collections/RecentEmojiCollection.ts @@ -33,7 +33,10 @@ export declare class RecentEmojiCollection extends Collection exportModule( exports, { - RecentEmojiCollection: 'RecentEmojiCollectionImpl', + RecentEmojiCollection: [ + 'RecentEmojiCollectionImpl', + 'RecentEmojiCollection', + ], }, - (m) => m.RecentEmojiCollectionImpl + (m) => m.RecentEmojiCollectionImpl || m.RecentEmojiCollection ); diff --git a/src/whatsapp/collections/RecentStickerCollection.ts b/src/whatsapp/collections/RecentStickerCollection.ts index bdd7cb7e92..294f884a53 100644 --- a/src/whatsapp/collections/RecentStickerCollection.ts +++ b/src/whatsapp/collections/RecentStickerCollection.ts @@ -32,7 +32,10 @@ export declare class RecentStickerCollection extends Collection { exportModule( exports, { - RecentStickerCollection: 'RecentStickerCollectionImpl', + RecentStickerCollection: [ + 'RecentStickerCollectionImpl', + 'RecentStickerCollection', + ], }, - (m) => m.RecentStickerCollectionImpl + (m) => m.RecentStickerCollectionImpl || m.RecentStickerCollection ); diff --git a/src/whatsapp/collections/StickerPackCollection.ts b/src/whatsapp/collections/StickerPackCollection.ts index 852a630275..377dcb79b3 100644 --- a/src/whatsapp/collections/StickerPackCollection.ts +++ b/src/whatsapp/collections/StickerPackCollection.ts @@ -39,7 +39,10 @@ export declare class StickerPackCollection extends Collection exportModule( exports, { - StickerPackCollection: 'StickerPackCollectionImpl', + StickerPackCollection: [ + 'StickerPackCollectionImpl', + 'StickerPackCollection', + ], }, - (m) => m.StickerPackCollectionImpl + (m) => m.StickerPackCollectionImpl || m.StickerPackCollection ); diff --git a/src/whatsapp/collections/StickerSearchCollection.ts b/src/whatsapp/collections/StickerSearchCollection.ts index a055a7f580..50645dbcb2 100644 --- a/src/whatsapp/collections/StickerSearchCollection.ts +++ b/src/whatsapp/collections/StickerSearchCollection.ts @@ -33,7 +33,10 @@ export declare class StickerSearchCollection extends Collection { exportModule( exports, { - StickerSearchCollection: 'StickerSearchCollectionImpl', + StickerSearchCollection: [ + 'StickerSearchCollectionImpl', + 'StickerSearchCollection', + ], }, - (m) => m.StickerSearchCollectionImpl + (m) => m.StickerSearchCollectionImpl || m.StickerSearchCollection ); diff --git a/src/whatsapp/functions/isLegitErrorStack.ts b/src/whatsapp/functions/isLegitErrorStack.ts index 2e18678a04..86b926d2c2 100644 --- a/src/whatsapp/functions/isLegitErrorStack.ts +++ b/src/whatsapp/functions/isLegitErrorStack.ts @@ -24,7 +24,7 @@ export declare function isLegitErrorStack(): boolean; exportModule( exports, { - isLegitErrorStack: 'isLegitErrorStack', + isLegitErrorStack: ['isLegitErrorStack', 'isOfficialClient'], }, - (m) => m.isLegitErrorStack + (m) => m.isLegitErrorStack || m.isOfficialClient ); diff --git a/src/whatsapp/misc/Conn.ts b/src/whatsapp/misc/Conn.ts index 583d0d6355..417056508f 100644 --- a/src/whatsapp/misc/Conn.ts +++ b/src/whatsapp/misc/Conn.ts @@ -22,4 +22,9 @@ import { ConnModel } from '../models'; */ export declare const Conn: ConnModel; -exportModule(exports, { Conn: 'Conn' }, (m) => m.Conn && m.ConnImpl1); +exportModule( + exports, + { Conn: 'Conn' }, + (m) => (m.Conn && m.ConnImpl1) || (m.Conn && m.ConnImpl) || m.Conn +); + diff --git a/src/whatsapp/models/ChatstateModel.ts b/src/whatsapp/models/ChatstateModel.ts index 25eec2e3e8..3ffb998056 100644 --- a/src/whatsapp/models/ChatstateModel.ts +++ b/src/whatsapp/models/ChatstateModel.ts @@ -61,5 +61,5 @@ exportModule( { ChatstateModel: 'Chatstate', }, - (m) => m.Chatstate && m.ChatstateCollection + (m) => (m.Chatstate && m.ChatstateCollection) || m.Chatstate ); diff --git a/src/whatsapp/models/ConnModel.ts b/src/whatsapp/models/ConnModel.ts index 146d13cff4..bd61be2055 100644 --- a/src/whatsapp/models/ConnModel.ts +++ b/src/whatsapp/models/ConnModel.ts @@ -88,8 +88,7 @@ export declare class ConnModel extends Model { exportModule( exports, - { - ConnModel: 'ConnImpl1', - }, - (m) => m.ConnImpl1 + { Conn: 'Conn' }, + (m) => (m.Conn && m.ConnImpl1) || (m.Conn && m.ConnImpl) || m.Conn +); ); diff --git a/src/whatsapp/models/PresenceModel.ts b/src/whatsapp/models/PresenceModel.ts index 0bdd8ae941..e3fed51551 100644 --- a/src/whatsapp/models/PresenceModel.ts +++ b/src/whatsapp/models/PresenceModel.ts @@ -71,5 +71,5 @@ exportModule( { PresenceModel: 'Presence', }, - (m) => m.Presence && m.ChatstateCollection + (m) => (m.Presence && m.ChatstateCollection) || (m.Presence && m.Chatstate) ); diff --git a/src/whatsapp/stores.ts b/src/whatsapp/stores.ts index 2189ce787e..60077dccb2 100644 --- a/src/whatsapp/stores.ts +++ b/src/whatsapp/stores.ts @@ -228,3 +228,124 @@ exportModule( }, (m) => m.StatusV3CollectionImpl || m.StatusCollection ); + +exportModule( + exports, + { + BlocklistStore: ['default', 'BlocklistCollection'], + }, + (m) => m.BlocklistCollection +); + +exportModule( + exports, + { + PresenceStore: ['PresenceCollectionImpl', 'PresenceCollection'], + }, + (m) => m.PresenceCollectionImpl || m.PresenceCollection +); + +exportModule( + exports, + { + CartStore: ['CartCollectionImpl', 'CartCollection'], + }, + (m) => m.CartCollectionImpl || m.CartCollection +); + +exportModule( + exports, + { + CatalogStore: ['CatalogCollectionImpl', 'CatalogCollection'], + }, + (m) => m.CatalogCollectionImpl || m.CatalogCollection +); + +exportModule( + exports, + { + EmojiVariantStore: ['EmojiVariantCollectionImpl', 'EmojiVariantCollection'], + }, + (m) => m.EmojiVariantCollectionImpl || m.EmojiVariantCollection +); + +exportModule( + exports, + { + LabelStore: ['LabelCollectionImpl', 'LabelCollection'], + }, + (m) => m.LabelCollectionImpl || m.LabelCollection +); + +exportModule( + exports, + { + MsgInfoStore: ['MsgInfoCollectionImpl', 'MsgInfoCollection'], + }, + (m) => m.MsgInfoCollectionImpl || m.MsgInfoCollection +); + +exportModule( + exports, + { + MuteStore: ['MuteCollectionImpl', 'MuteCollection'], + }, + (m) => m.MuteCollectionImpl || m.MuteCollection +); + +exportModule( + exports, + { + OrderStore: ['OrderCollectionImpl', 'OrderCollection'], + }, + (m) => m.OrderCollectionImpl || m.OrderCollection +); + +exportModule( + exports, + { + PinInChatStore: ['PinInChatCollectionImpl', 'PinInChatCollection'], + }, + (m) => m.PinInChatCollectionImpl || m.PinInChatCollection +); + +exportModule( + exports, + { + ProductMessageListStore: [ + 'ProductMessageListCollectionImpl', + 'ProductMessageListCollection', + ], + }, + (m) => m.ProductMessageListCollectionImpl || m.ProductMessageListCollection +); + +exportModule( + exports, + { + RecentEmojiStore: ['RecentEmojiCollectionImpl', 'RecentEmojiCollection'], + }, + (m) => m.RecentEmojiCollectionImpl || m.RecentEmojiCollection +); + +exportModule( + exports, + { + StickerSearchStore: [ + 'StickerSearchCollectionImpl', + 'StickerSearchCollection', + ], + }, + (m) => m.StickerSearchCollectionImpl || m.StickerSearchCollection +); + +exportModule( + exports, + { + BusinessProfileStore: [ + 'BusinessProfileCollectionImpl', + 'BusinessProfileCollection', + ], + }, + (m) => m.BusinessProfileCollectionImpl || m.BusinessProfileCollection +);