talkyzap-wapp-api 1.0.22 → 1.0.23
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 +1 -1
- package/README.md +22 -0
- package/dist/conn/functions/getABProps.d.ts +83 -0
- package/dist/conn/functions/getAutoDownloadSettings.d.ts +34 -0
- package/dist/conn/functions/getBuildConstants.d.ts +15 -0
- package/dist/conn/functions/getMigrationState.d.ts +0 -2
- package/dist/{whatsapp/misc/UsernameGatingUtils.d.ts → conn/functions/getMyUserLid.d.ts} +9 -9
- package/dist/conn/functions/getTheme.d.ts +39 -0
- package/dist/conn/functions/index.d.ts +7 -0
- package/dist/conn/functions/setAutoDownloadSettings.d.ts +56 -0
- package/dist/conn/functions/setTheme.d.ts +36 -0
- package/dist/contact/functions/index.d.ts +1 -0
- package/dist/contact/functions/reportContact.d.ts +62 -0
- package/dist/newsletter/functions/follow.d.ts +27 -0
- package/dist/newsletter/functions/index.d.ts +3 -0
- package/dist/newsletter/functions/search.d.ts +64 -0
- package/dist/newsletter/functions/unfollow.d.ts +27 -0
- package/dist/util/index.d.ts +1 -0
- package/dist/util/toArrayBuffer.d.ts +21 -0
- package/dist/whatsapp/enums/CHANNEL_EVENT_SURFACE.d.ts +27 -0
- package/dist/whatsapp/enums/index.d.ts +1 -0
- package/dist/whatsapp/functions/abPropsCache.d.ts +36 -0
- package/dist/whatsapp/functions/index.d.ts +6 -0
- package/dist/whatsapp/functions/markSeen.d.ts +13 -4
- package/dist/whatsapp/functions/mexFetchNewsletterDirectorySearchResults.d.ts +24 -0
- package/dist/whatsapp/functions/mexJoinNewsletter.d.ts +19 -0
- package/dist/whatsapp/functions/mexLeaveNewsletter.d.ts +19 -0
- package/dist/whatsapp/functions/reportSpam.d.ts +34 -0
- package/dist/whatsapp/functions/shouldHaveAccountLid.d.ts +3 -1
- package/dist/whatsapp/functions/toUserLid.d.ts +6 -0
- package/dist/whatsapp/functions/toggleNewsletterAdminActivityMuteStateAction.d.ts +22 -0
- package/dist/whatsapp/misc/Cmd.d.ts +7 -1
- package/dist/whatsapp/misc/DBCreateLidPnMappings.d.ts +31 -0
- package/dist/whatsapp/misc/LruMediaStore.d.ts +24 -0
- package/dist/whatsapp/misc/UserPrefsGeneral.d.ts +67 -0
- package/dist/whatsapp/misc/index.d.ts +2 -1
- package/dist/whatsapp/stores.d.ts +67 -56
- package/dist/wppconnect-wa.js +1 -1
- package/dist/wppconnect-wa.js.LICENSE.txt +17 -1
- package/eslint.config.mjs +1 -0
- package/package.json +19 -18
- package/scripts/compare-wa-versions.sh +85 -0
package/CHANGELOG.md
CHANGED
package/README.md
CHANGED
|
@@ -169,6 +169,28 @@ To debug or inspect `wa-source` folder, format the files to be easier to underst
|
|
|
169
169
|
npm run wa-source:format
|
|
170
170
|
```
|
|
171
171
|
|
|
172
|
+
### Comparing WhatsApp Web Versions
|
|
173
|
+
|
|
174
|
+
To compare changes between two WhatsApp Web versions, use the helper script:
|
|
175
|
+
|
|
176
|
+
Note: You need to run locally in multiple versions to download the scripts to wa-source folder, otherwise will not have anything to compare. To do it use: `WA_VERSION="<version-here>" npm run launch:local`
|
|
177
|
+
|
|
178
|
+
```bash
|
|
179
|
+
# Compare two versions (overview of module differences)
|
|
180
|
+
./scripts/compare-wa-versions.sh 2.3000.1031980585 2.3000.1031992593
|
|
181
|
+
|
|
182
|
+
# Compare a specific module between versions
|
|
183
|
+
./scripts/compare-wa-versions.sh 2.3000.1031980585 2.3000.1031992593 WAWebUpdateUnreadChatAction
|
|
184
|
+
|
|
185
|
+
# List available versions
|
|
186
|
+
./scripts/compare-wa-versions.sh
|
|
187
|
+
```
|
|
188
|
+
|
|
189
|
+
This is useful for:
|
|
190
|
+
- Tracking API changes between WhatsApp Web updates
|
|
191
|
+
- Identifying when function signatures changed
|
|
192
|
+
- Finding new or removed modules
|
|
193
|
+
|
|
172
194
|
## How to use this project
|
|
173
195
|
|
|
174
196
|
Basically, you need to inject the `wppconnect-wa.js` file into the browser after WhatsApp page load.
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright 2021 WPPConnect Team
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
import { RawABPropConfig } from '../../whatsapp/functions/abPropsCache';
|
|
17
|
+
/**
|
|
18
|
+
* A/B test property configuration
|
|
19
|
+
*/
|
|
20
|
+
export interface ABPropConfig extends RawABPropConfig {
|
|
21
|
+
/** The human-readable config name (e.g., "web_pwa_background_sync") */
|
|
22
|
+
name: string | null;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Get all A/B test property configurations for the current session
|
|
26
|
+
* These are experimental flags that WhatsApp uses for feature testing
|
|
27
|
+
*
|
|
28
|
+
* @example
|
|
29
|
+
* ```javascript
|
|
30
|
+
* // Get all A/B props as an array
|
|
31
|
+
* const abProps = WPP.conn.getABProps();
|
|
32
|
+
* console.log('Total A/B props:', abProps.length);
|
|
33
|
+
*
|
|
34
|
+
* // Log each prop with its name
|
|
35
|
+
* abProps.forEach(prop => {
|
|
36
|
+
* console.log(`${prop.name}: ${prop.configValue}`);
|
|
37
|
+
* });
|
|
38
|
+
* ```
|
|
39
|
+
*
|
|
40
|
+
* @returns {ABPropConfig[]} Array of A/B property configurations with names
|
|
41
|
+
*/
|
|
42
|
+
export declare function getABProps(): ABPropConfig[];
|
|
43
|
+
/**
|
|
44
|
+
* Get all A/B test property configurations as a Map
|
|
45
|
+
* The map is keyed by the config code for easier lookup
|
|
46
|
+
*
|
|
47
|
+
* @example
|
|
48
|
+
* ```javascript
|
|
49
|
+
* // Get all A/B props as a Map
|
|
50
|
+
* const abPropsMap = WPP.conn.getABPropsMap();
|
|
51
|
+
*
|
|
52
|
+
* // Check a specific config by code
|
|
53
|
+
* const specificProp = abPropsMap.get('12345');
|
|
54
|
+
* if (specificProp) {
|
|
55
|
+
* console.log('Name:', specificProp.name);
|
|
56
|
+
* console.log('Value:', specificProp.configValue);
|
|
57
|
+
* }
|
|
58
|
+
*
|
|
59
|
+
* // Convert to object for easy viewing
|
|
60
|
+
* const result = {};
|
|
61
|
+
* abPropsMap.forEach((value, key) => {
|
|
62
|
+
* result[value.name || key] = value.configValue;
|
|
63
|
+
* });
|
|
64
|
+
* console.table(result);
|
|
65
|
+
* ```
|
|
66
|
+
*
|
|
67
|
+
* @returns {Map<string, ABPropConfig>} Map of config code to A/B property configuration with names
|
|
68
|
+
*/
|
|
69
|
+
export declare function getABPropsMap(): Map<string, ABPropConfig>;
|
|
70
|
+
/**
|
|
71
|
+
* Get the human-readable name of an A/B config from its code
|
|
72
|
+
*
|
|
73
|
+
* @example
|
|
74
|
+
* ```javascript
|
|
75
|
+
* // Get name from config code
|
|
76
|
+
* const name = WPP.conn.getABPropName('12345');
|
|
77
|
+
* console.log('Config name:', name);
|
|
78
|
+
* ```
|
|
79
|
+
*
|
|
80
|
+
* @param configCode - The numeric config code
|
|
81
|
+
* @returns {string|null} The human-readable config name or null if not found
|
|
82
|
+
*/
|
|
83
|
+
export declare function getABPropName(configCode: string): string | null;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright 2026 WPPConnect Team
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
/**
|
|
17
|
+
* Get auto-download settings for media types
|
|
18
|
+
*
|
|
19
|
+
* @example
|
|
20
|
+
* ```javascript
|
|
21
|
+
* // Get current settings
|
|
22
|
+
* const settings = WPP.conn.getAutoDownloadSettings();
|
|
23
|
+
* console.log(settings);
|
|
24
|
+
* // { photos: true, audio: true, videos: false, documents: false }
|
|
25
|
+
* ```
|
|
26
|
+
*
|
|
27
|
+
* @category Config
|
|
28
|
+
*/
|
|
29
|
+
export declare function getAutoDownloadSettings(): {
|
|
30
|
+
photos: boolean;
|
|
31
|
+
audio: boolean;
|
|
32
|
+
videos: boolean;
|
|
33
|
+
documents: boolean;
|
|
34
|
+
};
|
|
@@ -64,3 +64,18 @@ export declare function getBuildConstants(): BuildConstants | null;
|
|
|
64
64
|
* @returns {boolean} True if current version is >= specified version
|
|
65
65
|
*/
|
|
66
66
|
export declare function isWhatsAppVersionGTE(version: string): boolean;
|
|
67
|
+
/**
|
|
68
|
+
* Check if the current WhatsApp version is less than or equal to a specified version
|
|
69
|
+
*
|
|
70
|
+
* @example
|
|
71
|
+
* ```javascript
|
|
72
|
+
* // Check if version is <= 2.3000.1029960097
|
|
73
|
+
* if (WPP.conn.isWhatsAppVersionLTE('2.3000.1029960097')) {
|
|
74
|
+
* console.log('Using legacy API');
|
|
75
|
+
* }
|
|
76
|
+
* ```
|
|
77
|
+
*
|
|
78
|
+
* @param version - Version string to compare against (e.g., "2.3000.1029")
|
|
79
|
+
* @returns {boolean} True if current version is <= specified version
|
|
80
|
+
*/
|
|
81
|
+
export declare function isWhatsAppVersionLTE(version: string): boolean;
|
|
@@ -24,8 +24,6 @@ export interface MigrationState {
|
|
|
24
24
|
isSyncdSessionMigrated: boolean;
|
|
25
25
|
/** Whether old messaging rules should still be applied */
|
|
26
26
|
shouldApplyNonMigratedMessagingRules: boolean;
|
|
27
|
-
/** Whether the account should have an account LID */
|
|
28
|
-
shouldHaveAccountLid: boolean;
|
|
29
27
|
/** The current user's LID, if available */
|
|
30
28
|
currentLid?: Wid;
|
|
31
29
|
/** The current user's PN, if available */
|
|
@@ -13,14 +13,14 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
+
import { Wid } from '../../whatsapp';
|
|
16
17
|
/**
|
|
17
|
-
*
|
|
18
|
+
* Return the current logged user LID (Locally Identified) without device id
|
|
19
|
+
*
|
|
20
|
+
* @example
|
|
21
|
+
* ```javascript
|
|
22
|
+
* const lid = WPP.conn.getMyUserLid();
|
|
23
|
+
* console.log(lid.toString()); // Output: 123@lid
|
|
24
|
+
* ```
|
|
18
25
|
*/
|
|
19
|
-
export declare
|
|
20
|
-
/**
|
|
21
|
-
* Check if username feature is supported
|
|
22
|
-
* @whatsapp >= 2.3000.1030318976
|
|
23
|
-
* @returns true if username feature is supported
|
|
24
|
-
*/
|
|
25
|
-
function usernameSupported(): boolean;
|
|
26
|
-
}
|
|
26
|
+
export declare function getMyUserLid(): Wid;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright 2026 WPPConnect Team
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
export declare enum Theme {
|
|
17
|
+
LIGHT = "light",
|
|
18
|
+
DARK = "dark",
|
|
19
|
+
SYSTEM = "system"
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Get current theme setting
|
|
23
|
+
*
|
|
24
|
+
* @example
|
|
25
|
+
* ```javascript
|
|
26
|
+
* // Get current theme
|
|
27
|
+
* const theme = WPP.conn.getTheme();
|
|
28
|
+
* console.log(theme); // "light", "dark", or "system"
|
|
29
|
+
*
|
|
30
|
+
* // Using enum
|
|
31
|
+
* import { Theme } from '@wppconnect/wa-js';
|
|
32
|
+
* if (theme === Theme.DARK) {
|
|
33
|
+
* console.log('Dark mode is enabled');
|
|
34
|
+
* }
|
|
35
|
+
* ```
|
|
36
|
+
*
|
|
37
|
+
* @category Config
|
|
38
|
+
*/
|
|
39
|
+
export declare function getTheme(): Theme;
|
|
@@ -15,13 +15,18 @@
|
|
|
15
15
|
*/
|
|
16
16
|
export { changeEnviromentDevice } from './changeEnviromentDevice';
|
|
17
17
|
export { genLinkDeviceCodeForPhoneNumber } from './genLinkDeviceCodeForPhoneNumber';
|
|
18
|
+
export { ABPropConfig, getABPropName, getABProps, getABPropsMap, } from './getABProps';
|
|
18
19
|
export { getAuthCode } from './getAuthCode';
|
|
20
|
+
export { getAutoDownloadSettings } from './getAutoDownloadSettings';
|
|
19
21
|
export { BuildConstants, getBuildConstants, isWhatsAppVersionGTE, } from './getBuildConstants';
|
|
20
22
|
export { getHistorySyncProgress, HistorySyncProgress, } from './getHistorySyncProgress';
|
|
21
23
|
export { getMigrationState, MigrationState } from './getMigrationState';
|
|
22
24
|
export { getMyDeviceId } from './getMyDeviceId';
|
|
23
25
|
export { getMyUserId } from './getMyUserId';
|
|
26
|
+
export { getMyUserLid } from './getMyUserLid';
|
|
27
|
+
export { getMyUserWid } from './getMyUserWid';
|
|
24
28
|
export { getPlatform } from './getPlatform';
|
|
29
|
+
export { getTheme, Theme } from './getTheme';
|
|
25
30
|
export { isAuthenticated } from './isAuthenticated';
|
|
26
31
|
export { isIdle } from './isIdle';
|
|
27
32
|
export { isMainInit } from './isMainInit';
|
|
@@ -35,6 +40,8 @@ export { logout } from './logout';
|
|
|
35
40
|
export { markAvailable, markUnavailable } from './markAvailable';
|
|
36
41
|
export { needsUpdate } from './needsUpdate';
|
|
37
42
|
export { refreshQR } from './refreshQR';
|
|
43
|
+
export { AutoDownloadSettings, setAutoDownloadSettings, } from './setAutoDownloadSettings';
|
|
38
44
|
export { setKeepAlive } from './setKeepAlive';
|
|
39
45
|
export { setLimit } from './setLimit';
|
|
40
46
|
export { setMultiDevice } from './setMultiDevice';
|
|
47
|
+
export { setTheme } from './setTheme';
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright 2026 WPPConnect Team
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
export interface AutoDownloadSettings {
|
|
17
|
+
/**
|
|
18
|
+
* Enable/disable auto-download for photos
|
|
19
|
+
*/
|
|
20
|
+
photos?: boolean;
|
|
21
|
+
/**
|
|
22
|
+
* Enable/disable auto-download for audio
|
|
23
|
+
*/
|
|
24
|
+
audio?: boolean;
|
|
25
|
+
/**
|
|
26
|
+
* Enable/disable auto-download for videos
|
|
27
|
+
*/
|
|
28
|
+
videos?: boolean;
|
|
29
|
+
/**
|
|
30
|
+
* Enable/disable auto-download for documents
|
|
31
|
+
*/
|
|
32
|
+
documents?: boolean;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Set auto-download settings for media types
|
|
36
|
+
*
|
|
37
|
+
* @example
|
|
38
|
+
* ```javascript
|
|
39
|
+
* // Disable video and document auto-download
|
|
40
|
+
* await WPP.conn.setAutoDownloadSettings({
|
|
41
|
+
* videos: false,
|
|
42
|
+
* documents: false
|
|
43
|
+
* });
|
|
44
|
+
*
|
|
45
|
+
* // Enable only photos
|
|
46
|
+
* await WPP.conn.setAutoDownloadSettings({
|
|
47
|
+
* photos: true,
|
|
48
|
+
* audio: false,
|
|
49
|
+
* videos: false,
|
|
50
|
+
* documents: false
|
|
51
|
+
* });
|
|
52
|
+
* ```
|
|
53
|
+
*
|
|
54
|
+
* @category Config
|
|
55
|
+
*/
|
|
56
|
+
export declare function setAutoDownloadSettings(settings: AutoDownloadSettings): Promise<void>;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright 2026 WPPConnect Team
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
import { Theme } from './getTheme';
|
|
17
|
+
/**
|
|
18
|
+
* Set theme and reload the page to apply changes
|
|
19
|
+
*
|
|
20
|
+
* @example
|
|
21
|
+
* ```javascript
|
|
22
|
+
* // Using Enum
|
|
23
|
+
* import { Theme } from '@wppconnect/wa-js';
|
|
24
|
+
* await WPP.conn.setTheme(Theme.LIGHT);
|
|
25
|
+
* await WPP.conn.setTheme(Theme.DARK);
|
|
26
|
+
* await WPP.conn.setTheme(Theme.SYSTEM);
|
|
27
|
+
*
|
|
28
|
+
* // Using string ("light", "dark", "system")
|
|
29
|
+
* await WPP.conn.setTheme("light");
|
|
30
|
+
* await WPP.conn.setTheme("dark");
|
|
31
|
+
* await WPP.conn.setTheme("system");
|
|
32
|
+
* ```
|
|
33
|
+
*
|
|
34
|
+
* @category Config
|
|
35
|
+
*/
|
|
36
|
+
export declare function setTheme(theme: Theme): Promise<void>;
|
|
@@ -22,6 +22,7 @@ export { getStatus } from './getStatus';
|
|
|
22
22
|
export { ContactListOptions, list } from './list';
|
|
23
23
|
export { queryExists } from './queryExists';
|
|
24
24
|
export { remove } from './remove';
|
|
25
|
+
export { reportContact, ReportContactResult } from './reportContact';
|
|
25
26
|
export { save } from './save';
|
|
26
27
|
export { subscribePresence } from './subscribePresence';
|
|
27
28
|
export { unsubscribePresence } from './unsubscribePresence';
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright 2026 WPPConnect Team
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
import { MsgModel, Wid } from '../../whatsapp';
|
|
17
|
+
export interface ReportContactResult {
|
|
18
|
+
wid: Wid;
|
|
19
|
+
reportId?: string;
|
|
20
|
+
errorCode?: number;
|
|
21
|
+
errorText?: string;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Report a contact or chat to WhatsApp
|
|
25
|
+
*
|
|
26
|
+
* This function allows you to report contacts for spam, inappropriate behavior, or other violations.
|
|
27
|
+
*
|
|
28
|
+
* Available spam flow types:
|
|
29
|
+
* - 'ChatInfoReport' (default) - Report from chat info screen
|
|
30
|
+
* - 'MessageMenu' - Report from message menu
|
|
31
|
+
* - 'GroupInfoReport' - Report from group info screen
|
|
32
|
+
* - 'ChatFmxCardSafetyToolsReport' - Report from safety tools (trusted)
|
|
33
|
+
* - 'ChatFmxCardSafetyToolsReportSuspicious' - Report suspicious contact
|
|
34
|
+
* - 'GroupInfoLeaveReportUpsell' - Report when leaving group
|
|
35
|
+
*
|
|
36
|
+
* @example
|
|
37
|
+
* ```javascript
|
|
38
|
+
* // Basic contact report
|
|
39
|
+
* const result = await WPP.contact.reportContact('5511999999999@c.us');
|
|
40
|
+
* console.log('Report ID:', result.reportId);
|
|
41
|
+
* ```
|
|
42
|
+
*
|
|
43
|
+
* @example
|
|
44
|
+
* ```javascript
|
|
45
|
+
* // Report with specific type
|
|
46
|
+
* await WPP.contact.reportContact('5511999999999@c.us', 'ChatFmxCardSafetyToolsReportSuspicious');
|
|
47
|
+
* ```
|
|
48
|
+
*
|
|
49
|
+
* @example
|
|
50
|
+
* ```javascript
|
|
51
|
+
* // Report specific message
|
|
52
|
+
* const msg = await WPP.chat.getMessageById('msgId');
|
|
53
|
+
* await WPP.contact.reportContact('5511999999999@c.us', 'MessageMenu', msg);
|
|
54
|
+
* ```
|
|
55
|
+
*
|
|
56
|
+
* @category Contact
|
|
57
|
+
* @param contactId - Contact ID or Wid to report
|
|
58
|
+
* @param spamFlow - Optional spam flow type (default: 'ChatInfoReport')
|
|
59
|
+
* @param msg - Optional specific message to report
|
|
60
|
+
* @returns Promise with report result containing reportId or error details
|
|
61
|
+
*/
|
|
62
|
+
export declare function reportContact(contactId: string | Wid, spamFlow?: string, msg?: MsgModel): Promise<ReportContactResult>;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright 2026 WPPConnect Team
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
/**
|
|
17
|
+
* Follow/subscribe to a newsletter
|
|
18
|
+
*
|
|
19
|
+
* @example
|
|
20
|
+
* ```javascript
|
|
21
|
+
* // Follow a newsletter
|
|
22
|
+
* const success = await WPP.newsletter.follow('120363xxxxx@newsletter');
|
|
23
|
+
* ```
|
|
24
|
+
*
|
|
25
|
+
* @category Newsletter
|
|
26
|
+
*/
|
|
27
|
+
export declare function follow(id: string): Promise<boolean>;
|
|
@@ -16,5 +16,8 @@
|
|
|
16
16
|
export { create } from './create';
|
|
17
17
|
export { destroy } from './destroy';
|
|
18
18
|
export { edit } from './edit';
|
|
19
|
+
export { follow } from './follow';
|
|
19
20
|
export { getSubscribers } from './getSubscribers';
|
|
20
21
|
export { mute } from './mute';
|
|
22
|
+
export { search } from './search';
|
|
23
|
+
export { unfollow } from './unfollow';
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright 2026 WPPConnect Team
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
export interface NewsletterSearchOptions {
|
|
17
|
+
categories?: string[];
|
|
18
|
+
limit?: number;
|
|
19
|
+
cursorToken?: string;
|
|
20
|
+
}
|
|
21
|
+
export interface NewsletterSearchResult {
|
|
22
|
+
newsletters: Array<{
|
|
23
|
+
idJid: string;
|
|
24
|
+
name: string;
|
|
25
|
+
description: string;
|
|
26
|
+
picture: string;
|
|
27
|
+
subscribersCount: number;
|
|
28
|
+
verification: string;
|
|
29
|
+
handle: string | null;
|
|
30
|
+
inviteCode: string;
|
|
31
|
+
creationTime: number;
|
|
32
|
+
_raw?: any;
|
|
33
|
+
}>;
|
|
34
|
+
pageInfo?: {
|
|
35
|
+
hasNextPage?: boolean;
|
|
36
|
+
endCursor?: string;
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Search for newsletters in the directory
|
|
41
|
+
*
|
|
42
|
+
* @example
|
|
43
|
+
* ```javascript
|
|
44
|
+
* // Basic search
|
|
45
|
+
* const result = await WPP.newsletter.search('technology');
|
|
46
|
+
*
|
|
47
|
+
* // Search with options
|
|
48
|
+
* const result = await WPP.newsletter.search('news', {
|
|
49
|
+
* limit: 10,
|
|
50
|
+
* categories: ['TECHNOLOGY', 'NEWS']
|
|
51
|
+
* });
|
|
52
|
+
*
|
|
53
|
+
* // Pagination
|
|
54
|
+
* const firstPage = await WPP.newsletter.search('tech');
|
|
55
|
+
* if (firstPage.pageInfo?.hasNextPage) {
|
|
56
|
+
* const nextPage = await WPP.newsletter.search('tech', {
|
|
57
|
+
* cursorToken: firstPage.pageInfo.endCursor
|
|
58
|
+
* });
|
|
59
|
+
* }
|
|
60
|
+
* ```
|
|
61
|
+
*
|
|
62
|
+
* @category Newsletter
|
|
63
|
+
*/
|
|
64
|
+
export declare function search(query: string, options?: NewsletterSearchOptions): Promise<NewsletterSearchResult>;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright 2026 WPPConnect Team
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
/**
|
|
17
|
+
* Unfollow/unsubscribe from a newsletter
|
|
18
|
+
*
|
|
19
|
+
* @example
|
|
20
|
+
* ```javascript
|
|
21
|
+
* // Unfollow a newsletter
|
|
22
|
+
* const success = await WPP.newsletter.unfollow('120363xxxxx@newsletter');
|
|
23
|
+
* ```
|
|
24
|
+
*
|
|
25
|
+
* @category Newsletter
|
|
26
|
+
*/
|
|
27
|
+
export declare function unfollow(id: string): Promise<boolean>;
|
package/dist/util/index.d.ts
CHANGED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright 2026 WPPConnect Team
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
/**
|
|
17
|
+
* Convert different binary container types to a plain ArrayBuffer.
|
|
18
|
+
*
|
|
19
|
+
* Useful when dealing with APIs that may return TypedArrays or SharedArrayBuffer.
|
|
20
|
+
*/
|
|
21
|
+
export declare function toArrayBuffer(data: ArrayBuffer | ArrayBufferView | ArrayBufferLike | null | undefined): ArrayBuffer | null;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright 2026 WPPConnect Team
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
/** @whatsapp WAWebWamEnumChannelEventSurface >= 2.3000.1032373751
|
|
17
|
+
*/
|
|
18
|
+
export declare enum CHANNEL_EVENT_SURFACE {
|
|
19
|
+
CHANNEL_UPDATES_HOME = 1,
|
|
20
|
+
CHANNEL_THREAD = 2,
|
|
21
|
+
CHANNEL_DIRECTORY = 3,
|
|
22
|
+
CHANNEL_DIRECTORY_SEARCH = 4,
|
|
23
|
+
CHANNEL_PROFILE = 5,
|
|
24
|
+
CHANNEL_UPDATES_HOME_SEARCH = 6,
|
|
25
|
+
CHANNEL_DIRECTORY_CATEGORIES = 7,
|
|
26
|
+
CHANNEL_DIRECTORY_CATEGORIES_SEARCH = 8
|
|
27
|
+
}
|