Skip to content

Commit

Permalink
Merge branch 'main' into customMarcelo9
Browse files Browse the repository at this point in the history
  • Loading branch information
marcelo386 authored Jul 31, 2024
2 parents 4eac1a3 + a0bb666 commit b10b2c6
Show file tree
Hide file tree
Showing 25 changed files with 196 additions and 51 deletions.
7 changes: 1 addition & 6 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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)



12 changes: 6 additions & 6 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -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": {
Expand Down Expand Up @@ -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",
Expand Down
7 changes: 5 additions & 2 deletions src/conn/patch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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(() => {
/**
Expand All @@ -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);
*/
1 change: 1 addition & 0 deletions src/webpack/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -348,6 +348,7 @@ export function search<T = any>(
condition: SearchModuleCondition,
reverse = false
): T | null {
console.log(condition);
const moduleId = searchId(condition, reverse);

if (!moduleId) {
Expand Down
4 changes: 2 additions & 2 deletions src/whatsapp/collections/BlocklistCollection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export declare class BlocklistCollection extends Collection<BlocklistModel> {
exportModule(
exports,
{
BlocklistCollection: 'BlocklistCollectionImpl',
BlocklistCollection: ['BlocklistCollectionImpl', 'BlocklistCollection'],
},
(m) => m.BlocklistCollectionImpl
(m) => m.BlocklistCollectionImpl || m.BlocklistCollection
);
7 changes: 5 additions & 2 deletions src/whatsapp/collections/BusinessProfileCollection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,10 @@ export declare class BusinessProfileCollection extends Collection<BusinessProfil
exportModule(
exports,
{
BusinessProfileCollection: 'BusinessProfileCollectionImpl',
BusinessProfileCollection: [
'BusinessProfileCollectionImpl',
'BusinessProfileCollection',
],
},
(m) => m.BusinessProfileCollectionImpl
(m) => m.BusinessProfileCollectionImpl || m.BusinessProfileCollection
);
4 changes: 2 additions & 2 deletions src/whatsapp/collections/CartCollection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,6 @@ export declare class CartCollection extends Collection<CartModel> {
}
exportModule(
exports,
{ CartCollection: 'CartCollectionImpl' },
(m) => m.CartCollectionImpl
{ CartCollection: ['CartCollectionImpl', 'CartCollection'] },
(m) => m.CartCollectionImpl || m.CartCollection
);
2 changes: 1 addition & 1 deletion src/whatsapp/collections/CatalogCollection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,6 @@ export declare class CatalogCollection extends Collection<CatalogModel> {
}
exportModule(
exports,
{ CatalogCollection: 'CatalogCollectionImpl' },
{ CatalogCollection: ['CatalogCollectionImpl', 'CatalogCollection'] },
(m) => m.CatalogCollectionImpl || m.CatalogCollection
);
7 changes: 5 additions & 2 deletions src/whatsapp/collections/EmojiVariantCollection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,10 @@ export declare class EmojiVariantCollection extends Collection<EmojiVariantModel
exportModule(
exports,
{
EmojiVariantCollection: 'EmojiVariantCollectionImpl',
EmojiVariantCollection: [
'EmojiVariantCollectionImpl',
'EmojiVariantCollection',
],
},
(m) => m.EmojiVariantCollectionImpl
(m) => m.EmojiVariantCollectionImpl || m.EmojiVariantCollection
);
4 changes: 2 additions & 2 deletions src/whatsapp/collections/MuteCollection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,6 @@ export declare class MuteCollection extends Collection<MuteModel> {
}
exportModule(
exports,
{ MuteCollection: 'MuteCollectionImpl' },
(m) => m.MuteCollectionImpl
{ MuteCollection: ['MuteCollectionImpl', 'MuteCollection'] },
(m) => m.MuteCollectionImpl || m.MuteCollection
);
4 changes: 2 additions & 2 deletions src/whatsapp/collections/OrderCollection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,6 @@ export declare class OrderCollection extends Collection<OrderModel> {
}
exportModule(
exports,
{ OrderCollection: 'OrderCollectionImpl' },
(m) => m.OrderCollectionImpl
{ OrderCollection: ['OrderCollectionImpl', 'OrderCollection'] },
(m) => m.OrderCollectionImpl || m.OrderCollection
);
4 changes: 2 additions & 2 deletions src/whatsapp/collections/PinInChatCollection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,6 @@ export declare class PinInChatCollection extends Collection<PinInChatModel> {
}
exportModule(
exports,
{ PinInChatCollection: 'PinInChatCollectionImpl' },
(m) => m.PinInChatCollectionImpl
{ PinInChatCollection: ['PinInChatCollectionImpl', 'PinInChatCollection'] },
(m) => m.PinInChatCollectionImpl || m.PinInChatCollection
);
2 changes: 1 addition & 1 deletion src/whatsapp/collections/PresenceCollection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export declare class PresenceCollection extends BaseCollection<PresenceModel> {
exportModule(
exports,
{
PresenceCollection: 'PresenceCollectionImpl',
PresenceCollection: ['PresenceCollectionImpl', 'PresenceCollection'],
},
(m) => m.PresenceCollectionImpl || m.PresenceCollection
);
7 changes: 5 additions & 2 deletions src/whatsapp/collections/ProductMessageListCollection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,10 @@ export declare class ProductMessageListCollection extends Collection<ProductMess
exportModule(
exports,
{
ProductMessageListCollection: 'ProductMessageListCollectionImpl',
ProductMessageListCollection: [
'ProductMessageListCollectionImpl',
'ProductMessageListCollection',
],
},
(m) => m.ProductMessageListCollectionImpl
(m) => m.ProductMessageListCollectionImpl || m.ProductMessageListCollection
);
7 changes: 5 additions & 2 deletions src/whatsapp/collections/RecentEmojiCollection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,10 @@ export declare class RecentEmojiCollection extends Collection<RecentEmojiModel>
exportModule(
exports,
{
RecentEmojiCollection: 'RecentEmojiCollectionImpl',
RecentEmojiCollection: [
'RecentEmojiCollectionImpl',
'RecentEmojiCollection',
],
},
(m) => m.RecentEmojiCollectionImpl
(m) => m.RecentEmojiCollectionImpl || m.RecentEmojiCollection
);
7 changes: 5 additions & 2 deletions src/whatsapp/collections/RecentStickerCollection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,10 @@ export declare class RecentStickerCollection extends Collection<StickerModel> {
exportModule(
exports,
{
RecentStickerCollection: 'RecentStickerCollectionImpl',
RecentStickerCollection: [
'RecentStickerCollectionImpl',
'RecentStickerCollection',
],
},
(m) => m.RecentStickerCollectionImpl
(m) => m.RecentStickerCollectionImpl || m.RecentStickerCollection
);
7 changes: 5 additions & 2 deletions src/whatsapp/collections/StickerPackCollection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,10 @@ export declare class StickerPackCollection extends Collection<StickerPackModel>
exportModule(
exports,
{
StickerPackCollection: 'StickerPackCollectionImpl',
StickerPackCollection: [
'StickerPackCollectionImpl',
'StickerPackCollection',
],
},
(m) => m.StickerPackCollectionImpl
(m) => m.StickerPackCollectionImpl || m.StickerPackCollection
);
7 changes: 5 additions & 2 deletions src/whatsapp/collections/StickerSearchCollection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,10 @@ export declare class StickerSearchCollection extends Collection<StickerModel> {
exportModule(
exports,
{
StickerSearchCollection: 'StickerSearchCollectionImpl',
StickerSearchCollection: [
'StickerSearchCollectionImpl',
'StickerSearchCollection',
],
},
(m) => m.StickerSearchCollectionImpl
(m) => m.StickerSearchCollectionImpl || m.StickerSearchCollection
);
4 changes: 2 additions & 2 deletions src/whatsapp/functions/isLegitErrorStack.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export declare function isLegitErrorStack(): boolean;
exportModule(
exports,
{
isLegitErrorStack: 'isLegitErrorStack',
isLegitErrorStack: ['isLegitErrorStack', 'isOfficialClient'],
},
(m) => m.isLegitErrorStack
(m) => m.isLegitErrorStack || m.isOfficialClient
);
7 changes: 6 additions & 1 deletion src/whatsapp/misc/Conn.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
);

2 changes: 1 addition & 1 deletion src/whatsapp/models/ChatstateModel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,5 +61,5 @@ exportModule(
{
ChatstateModel: 'Chatstate',
},
(m) => m.Chatstate && m.ChatstateCollection
(m) => (m.Chatstate && m.ChatstateCollection) || m.Chatstate
);
7 changes: 3 additions & 4 deletions src/whatsapp/models/ConnModel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
);
);
2 changes: 1 addition & 1 deletion src/whatsapp/models/PresenceModel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,5 +71,5 @@ exportModule(
{
PresenceModel: 'Presence',
},
(m) => m.Presence && m.ChatstateCollection
(m) => (m.Presence && m.ChatstateCollection) || (m.Presence && m.Chatstate)
);
Loading

0 comments on commit b10b2c6

Please sign in to comment.